Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
jinli gu
Jeepay
Commits
91b1c1c5
Commit
91b1c1c5
authored
Jul 29, 2021
by
terrfly
Browse files
阿里巴巴代码规范检测整改
parent
10f3c8c3
Changes
65
Hide whitespace changes
Inline
Side-by-side
jeepay-manager/src/main/java/com/jeequan/jeepay/mgr/ctrl/sysuser/SysLogController.java
View file @
91b1c1c5
...
@@ -62,12 +62,22 @@ public class SysLogController extends CommonCtrl {
...
@@ -62,12 +62,22 @@ public class SysLogController extends CommonCtrl {
// 查询列表
// 查询列表
LambdaQueryWrapper
<
SysLog
>
condition
=
SysLog
.
gw
();
LambdaQueryWrapper
<
SysLog
>
condition
=
SysLog
.
gw
();
condition
.
orderByDesc
(
SysLog:
:
getCreatedAt
);
condition
.
orderByDesc
(
SysLog:
:
getCreatedAt
);
if
(
sysLog
.
getUserId
()
!=
null
)
condition
.
eq
(
SysLog:
:
getUserId
,
sysLog
.
getUserId
());
if
(
sysLog
.
getUserId
()
!=
null
)
{
if
(
sysLog
.
getUserName
()
!=
null
)
condition
.
eq
(
SysLog:
:
getUserName
,
sysLog
.
getUserName
());
condition
.
eq
(
SysLog:
:
getUserId
,
sysLog
.
getUserId
());
if
(
StringUtils
.
isNotEmpty
(
sysLog
.
getSysType
()))
condition
.
eq
(
SysLog:
:
getSysType
,
sysLog
.
getSysType
());
}
if
(
sysLog
.
getUserName
()
!=
null
)
{
condition
.
eq
(
SysLog:
:
getUserName
,
sysLog
.
getUserName
());
}
if
(
StringUtils
.
isNotEmpty
(
sysLog
.
getSysType
()))
{
condition
.
eq
(
SysLog:
:
getSysType
,
sysLog
.
getSysType
());
}
if
(
paramJSON
!=
null
)
{
if
(
paramJSON
!=
null
)
{
if
(
StringUtils
.
isNotEmpty
(
paramJSON
.
getString
(
"createdStart"
)))
condition
.
ge
(
SysLog:
:
getCreatedAt
,
paramJSON
.
getString
(
"createdStart"
));
if
(
StringUtils
.
isNotEmpty
(
paramJSON
.
getString
(
"createdStart"
)))
{
if
(
StringUtils
.
isNotEmpty
(
paramJSON
.
getString
(
"createdEnd"
)))
condition
.
le
(
SysLog:
:
getCreatedAt
,
paramJSON
.
getString
(
"createdEnd"
));
condition
.
ge
(
SysLog:
:
getCreatedAt
,
paramJSON
.
getString
(
"createdStart"
));
}
if
(
StringUtils
.
isNotEmpty
(
paramJSON
.
getString
(
"createdEnd"
)))
{
condition
.
le
(
SysLog:
:
getCreatedAt
,
paramJSON
.
getString
(
"createdEnd"
));
}
}
}
IPage
<
SysLog
>
pages
=
sysLogService
.
page
(
getIPage
(),
condition
);
IPage
<
SysLog
>
pages
=
sysLogService
.
page
(
getIPage
(),
condition
);
return
ApiRes
.
page
(
pages
);
return
ApiRes
.
page
(
pages
);
...
@@ -82,7 +92,9 @@ public class SysLogController extends CommonCtrl {
...
@@ -82,7 +92,9 @@ public class SysLogController extends CommonCtrl {
@RequestMapping
(
value
=
"/{sysLogId}"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/{sysLogId}"
,
method
=
RequestMethod
.
GET
)
public
ApiRes
detail
(
@PathVariable
(
"sysLogId"
)
String
sysLogId
)
{
public
ApiRes
detail
(
@PathVariable
(
"sysLogId"
)
String
sysLogId
)
{
SysLog
sysLog
=
sysLogService
.
getById
(
sysLogId
);
SysLog
sysLog
=
sysLogService
.
getById
(
sysLogId
);
if
(
sysLog
==
null
)
return
ApiRes
.
fail
(
ApiCodeEnum
.
SYS_OPERATION_FAIL_SELETE
);
if
(
sysLog
==
null
)
{
return
ApiRes
.
fail
(
ApiCodeEnum
.
SYS_OPERATION_FAIL_SELETE
);
}
return
ApiRes
.
ok
(
sysLog
);
return
ApiRes
.
ok
(
sysLog
);
}
}
...
@@ -101,7 +113,9 @@ public class SysLogController extends CommonCtrl {
...
@@ -101,7 +113,9 @@ public class SysLogController extends CommonCtrl {
idsList
.
add
(
Long
.
valueOf
(
id
));
idsList
.
add
(
Long
.
valueOf
(
id
));
}
}
boolean
result
=
sysLogService
.
removeByIds
(
idsList
);
boolean
result
=
sysLogService
.
removeByIds
(
idsList
);
if
(!
result
)
return
ApiRes
.
fail
(
ApiCodeEnum
.
SYS_OPERATION_FAIL_DELETE
);
if
(!
result
)
{
return
ApiRes
.
fail
(
ApiCodeEnum
.
SYS_OPERATION_FAIL_DELETE
);
}
return
ApiRes
.
ok
();
return
ApiRes
.
ok
();
}
}
}
}
jeepay-merchant/src/main/java/com/jeequan/jeepay/mch/ctrl/CurrentUserController.java
View file @
91b1c1c5
...
@@ -103,9 +103,15 @@ public class CurrentUserController extends CommonCtrl{
...
@@ -103,9 +103,15 @@ public class CurrentUserController extends CommonCtrl{
Byte
sex
=
getValByte
(
"sex"
);
Byte
sex
=
getValByte
(
"sex"
);
SysUser
updateRecord
=
new
SysUser
();
SysUser
updateRecord
=
new
SysUser
();
updateRecord
.
setSysUserId
(
getCurrentUser
().
getSysUser
().
getSysUserId
());
updateRecord
.
setSysUserId
(
getCurrentUser
().
getSysUser
().
getSysUserId
());
if
(
StringUtils
.
isNotEmpty
(
avatarUrl
))
updateRecord
.
setAvatarUrl
(
avatarUrl
);
if
(
StringUtils
.
isNotEmpty
(
avatarUrl
))
{
if
(
StringUtils
.
isNotEmpty
(
realname
))
updateRecord
.
setRealname
(
realname
);
updateRecord
.
setAvatarUrl
(
avatarUrl
);
if
(
sex
!=
null
)
updateRecord
.
setSex
(
sex
);
}
if
(
StringUtils
.
isNotEmpty
(
realname
))
{
updateRecord
.
setRealname
(
realname
);
}
if
(
sex
!=
null
)
{
updateRecord
.
setSex
(
sex
);
}
sysUserService
.
updateById
(
updateRecord
);
sysUserService
.
updateById
(
updateRecord
);
...
...
jeepay-merchant/src/main/java/com/jeequan/jeepay/mch/ctrl/merchant/MchPayPassageConfigController.java
View file @
91b1c1c5
...
@@ -70,8 +70,12 @@ public class MchPayPassageConfigController extends CommonCtrl {
...
@@ -70,8 +70,12 @@ public class MchPayPassageConfigController extends CommonCtrl {
//支付方式集合
//支付方式集合
LambdaQueryWrapper
<
PayWay
>
wrapper
=
PayWay
.
gw
();
LambdaQueryWrapper
<
PayWay
>
wrapper
=
PayWay
.
gw
();
if
(
StrUtil
.
isNotBlank
(
wayCode
))
wrapper
.
eq
(
PayWay:
:
getWayCode
,
wayCode
);
if
(
StrUtil
.
isNotBlank
(
wayCode
))
{
if
(
StrUtil
.
isNotBlank
(
wayName
))
wrapper
.
like
(
PayWay:
:
getWayName
,
wayName
);
wrapper
.
eq
(
PayWay:
:
getWayCode
,
wayCode
);
}
if
(
StrUtil
.
isNotBlank
(
wayName
))
{
wrapper
.
like
(
PayWay:
:
getWayName
,
wayName
);
}
IPage
<
PayWay
>
payWayPage
=
payWayService
.
page
(
getIPage
(),
wrapper
);
IPage
<
PayWay
>
payWayPage
=
payWayService
.
page
(
getIPage
(),
wrapper
);
if
(!
CollectionUtils
.
isEmpty
(
payWayPage
.
getRecords
()))
{
if
(!
CollectionUtils
.
isEmpty
(
payWayPage
.
getRecords
()))
{
...
@@ -131,8 +135,12 @@ public class MchPayPassageConfigController extends CommonCtrl {
...
@@ -131,8 +135,12 @@ public class MchPayPassageConfigController extends CommonCtrl {
@GetMapping
(
"/{id}"
)
@GetMapping
(
"/{id}"
)
public
ApiRes
detail
(
@PathVariable
(
"id"
)
Long
id
)
{
public
ApiRes
detail
(
@PathVariable
(
"id"
)
Long
id
)
{
MchPayPassage
payPassage
=
mchPayPassageService
.
getById
(
id
);
MchPayPassage
payPassage
=
mchPayPassageService
.
getById
(
id
);
if
(
payPassage
==
null
)
return
ApiRes
.
fail
(
ApiCodeEnum
.
SYS_OPERATION_FAIL_SELETE
);
if
(
payPassage
==
null
)
{
if
(!
payPassage
.
getMchNo
().
equals
(
getCurrentUser
().
getSysUser
().
getBelongInfoId
()))
return
ApiRes
.
fail
(
ApiCodeEnum
.
SYS_PERMISSION_ERROR
);
return
ApiRes
.
fail
(
ApiCodeEnum
.
SYS_OPERATION_FAIL_SELETE
);
}
if
(!
payPassage
.
getMchNo
().
equals
(
getCurrentUser
().
getSysUser
().
getBelongInfoId
()))
{
return
ApiRes
.
fail
(
ApiCodeEnum
.
SYS_PERMISSION_ERROR
);
}
payPassage
.
setRate
(
payPassage
.
getRate
().
multiply
(
new
BigDecimal
(
"100"
)));
payPassage
.
setRate
(
payPassage
.
getRate
().
multiply
(
new
BigDecimal
(
"100"
)));
return
ApiRes
.
ok
(
payPassage
);
return
ApiRes
.
ok
(
payPassage
);
}
}
...
...
jeepay-merchant/src/main/java/com/jeequan/jeepay/mch/ctrl/order/PayOrderController.java
View file @
91b1c1c5
...
@@ -67,15 +67,31 @@ public class PayOrderController extends CommonCtrl {
...
@@ -67,15 +67,31 @@ public class PayOrderController extends CommonCtrl {
LambdaQueryWrapper
<
PayOrder
>
wrapper
=
PayOrder
.
gw
();
LambdaQueryWrapper
<
PayOrder
>
wrapper
=
PayOrder
.
gw
();
wrapper
.
eq
(
PayOrder:
:
getMchNo
,
getCurrentMchNo
());
wrapper
.
eq
(
PayOrder:
:
getMchNo
,
getCurrentMchNo
());
if
(
StringUtils
.
isNotEmpty
(
payOrder
.
getPayOrderId
()))
wrapper
.
eq
(
PayOrder:
:
getPayOrderId
,
payOrder
.
getPayOrderId
());
if
(
StringUtils
.
isNotEmpty
(
payOrder
.
getPayOrderId
()))
{
if
(
StringUtils
.
isNotEmpty
(
payOrder
.
getMchOrderNo
()))
wrapper
.
eq
(
PayOrder:
:
getMchOrderNo
,
payOrder
.
getMchOrderNo
());
wrapper
.
eq
(
PayOrder:
:
getPayOrderId
,
payOrder
.
getPayOrderId
());
if
(
StringUtils
.
isNotEmpty
(
payOrder
.
getWayCode
()))
wrapper
.
eq
(
PayOrder:
:
getWayCode
,
payOrder
.
getWayCode
());
}
if
(
payOrder
.
getState
()
!=
null
)
wrapper
.
eq
(
PayOrder:
:
getState
,
payOrder
.
getState
());
if
(
StringUtils
.
isNotEmpty
(
payOrder
.
getMchOrderNo
()))
{
if
(
payOrder
.
getNotifyState
()
!=
null
)
wrapper
.
eq
(
PayOrder:
:
getNotifyState
,
payOrder
.
getNotifyState
());
wrapper
.
eq
(
PayOrder:
:
getMchOrderNo
,
payOrder
.
getMchOrderNo
());
if
(
StringUtils
.
isNotEmpty
(
payOrder
.
getAppId
()))
wrapper
.
eq
(
PayOrder:
:
getAppId
,
payOrder
.
getAppId
());
}
if
(
StringUtils
.
isNotEmpty
(
payOrder
.
getWayCode
()))
{
wrapper
.
eq
(
PayOrder:
:
getWayCode
,
payOrder
.
getWayCode
());
}
if
(
payOrder
.
getState
()
!=
null
)
{
wrapper
.
eq
(
PayOrder:
:
getState
,
payOrder
.
getState
());
}
if
(
payOrder
.
getNotifyState
()
!=
null
)
{
wrapper
.
eq
(
PayOrder:
:
getNotifyState
,
payOrder
.
getNotifyState
());
}
if
(
StringUtils
.
isNotEmpty
(
payOrder
.
getAppId
()))
{
wrapper
.
eq
(
PayOrder:
:
getAppId
,
payOrder
.
getAppId
());
}
if
(
paramJSON
!=
null
)
{
if
(
paramJSON
!=
null
)
{
if
(
StringUtils
.
isNotEmpty
(
paramJSON
.
getString
(
"createdStart"
)))
wrapper
.
ge
(
PayOrder:
:
getCreatedAt
,
paramJSON
.
getString
(
"createdStart"
));
if
(
StringUtils
.
isNotEmpty
(
paramJSON
.
getString
(
"createdStart"
)))
{
if
(
StringUtils
.
isNotEmpty
(
paramJSON
.
getString
(
"createdEnd"
)))
wrapper
.
le
(
PayOrder:
:
getCreatedAt
,
paramJSON
.
getString
(
"createdEnd"
));
wrapper
.
ge
(
PayOrder:
:
getCreatedAt
,
paramJSON
.
getString
(
"createdStart"
));
}
if
(
StringUtils
.
isNotEmpty
(
paramJSON
.
getString
(
"createdEnd"
)))
{
wrapper
.
le
(
PayOrder:
:
getCreatedAt
,
paramJSON
.
getString
(
"createdEnd"
));
}
}
}
wrapper
.
orderByDesc
(
PayOrder:
:
getCreatedAt
);
wrapper
.
orderByDesc
(
PayOrder:
:
getCreatedAt
);
...
@@ -110,7 +126,9 @@ public class PayOrderController extends CommonCtrl {
...
@@ -110,7 +126,9 @@ public class PayOrderController extends CommonCtrl {
@GetMapping
(
"/{payOrderId}"
)
@GetMapping
(
"/{payOrderId}"
)
public
ApiRes
detail
(
@PathVariable
(
"payOrderId"
)
String
payOrderId
)
{
public
ApiRes
detail
(
@PathVariable
(
"payOrderId"
)
String
payOrderId
)
{
PayOrder
payOrder
=
payOrderService
.
getById
(
payOrderId
);
PayOrder
payOrder
=
payOrderService
.
getById
(
payOrderId
);
if
(
payOrder
==
null
)
return
ApiRes
.
fail
(
ApiCodeEnum
.
SYS_OPERATION_FAIL_SELETE
);
if
(
payOrder
==
null
)
{
return
ApiRes
.
fail
(
ApiCodeEnum
.
SYS_OPERATION_FAIL_SELETE
);
}
if
(!
payOrder
.
getMchNo
().
equals
(
getCurrentMchNo
()))
{
if
(!
payOrder
.
getMchNo
().
equals
(
getCurrentMchNo
()))
{
return
ApiRes
.
fail
(
ApiCodeEnum
.
SYS_PERMISSION_ERROR
);
return
ApiRes
.
fail
(
ApiCodeEnum
.
SYS_PERMISSION_ERROR
);
}
}
...
...
jeepay-merchant/src/main/java/com/jeequan/jeepay/mch/ctrl/order/RefundOrderController.java
View file @
91b1c1c5
...
@@ -57,15 +57,31 @@ public class RefundOrderController extends CommonCtrl {
...
@@ -57,15 +57,31 @@ public class RefundOrderController extends CommonCtrl {
JSONObject
paramJSON
=
getReqParamJSON
();
JSONObject
paramJSON
=
getReqParamJSON
();
LambdaQueryWrapper
<
RefundOrder
>
wrapper
=
RefundOrder
.
gw
();
LambdaQueryWrapper
<
RefundOrder
>
wrapper
=
RefundOrder
.
gw
();
wrapper
.
eq
(
RefundOrder:
:
getMchNo
,
getCurrentMchNo
());
wrapper
.
eq
(
RefundOrder:
:
getMchNo
,
getCurrentMchNo
());
if
(
StringUtils
.
isNotEmpty
(
refundOrder
.
getRefundOrderId
()))
wrapper
.
eq
(
RefundOrder:
:
getRefundOrderId
,
refundOrder
.
getRefundOrderId
());
if
(
StringUtils
.
isNotEmpty
(
refundOrder
.
getRefundOrderId
()))
{
if
(
StringUtils
.
isNotEmpty
(
refundOrder
.
getPayOrderId
()))
wrapper
.
eq
(
RefundOrder:
:
getPayOrderId
,
refundOrder
.
getPayOrderId
());
wrapper
.
eq
(
RefundOrder:
:
getRefundOrderId
,
refundOrder
.
getRefundOrderId
());
if
(
StringUtils
.
isNotEmpty
(
refundOrder
.
getMchRefundNo
()))
wrapper
.
eq
(
RefundOrder:
:
getMchRefundNo
,
refundOrder
.
getMchRefundNo
());
}
if
(
refundOrder
.
getState
()
!=
null
)
wrapper
.
eq
(
RefundOrder:
:
getState
,
refundOrder
.
getState
());
if
(
StringUtils
.
isNotEmpty
(
refundOrder
.
getPayOrderId
()))
{
if
(
StringUtils
.
isNotEmpty
(
refundOrder
.
getChannelPayOrderNo
()))
wrapper
.
eq
(
RefundOrder:
:
getChannelPayOrderNo
,
refundOrder
.
getChannelPayOrderNo
());
wrapper
.
eq
(
RefundOrder:
:
getPayOrderId
,
refundOrder
.
getPayOrderId
());
if
(
StringUtils
.
isNotEmpty
(
refundOrder
.
getAppId
()))
wrapper
.
eq
(
RefundOrder:
:
getAppId
,
refundOrder
.
getAppId
());
}
if
(
StringUtils
.
isNotEmpty
(
refundOrder
.
getMchRefundNo
()))
{
wrapper
.
eq
(
RefundOrder:
:
getMchRefundNo
,
refundOrder
.
getMchRefundNo
());
}
if
(
refundOrder
.
getState
()
!=
null
)
{
wrapper
.
eq
(
RefundOrder:
:
getState
,
refundOrder
.
getState
());
}
if
(
StringUtils
.
isNotEmpty
(
refundOrder
.
getChannelPayOrderNo
()))
{
wrapper
.
eq
(
RefundOrder:
:
getChannelPayOrderNo
,
refundOrder
.
getChannelPayOrderNo
());
}
if
(
StringUtils
.
isNotEmpty
(
refundOrder
.
getAppId
()))
{
wrapper
.
eq
(
RefundOrder:
:
getAppId
,
refundOrder
.
getAppId
());
}
if
(
paramJSON
!=
null
)
{
if
(
paramJSON
!=
null
)
{
if
(
StringUtils
.
isNotEmpty
(
paramJSON
.
getString
(
"createdStart"
)))
wrapper
.
ge
(
RefundOrder:
:
getCreatedAt
,
paramJSON
.
getString
(
"createdStart"
));
if
(
StringUtils
.
isNotEmpty
(
paramJSON
.
getString
(
"createdStart"
)))
{
if
(
StringUtils
.
isNotEmpty
(
paramJSON
.
getString
(
"createdEnd"
)))
wrapper
.
le
(
RefundOrder:
:
getCreatedAt
,
paramJSON
.
getString
(
"createdEnd"
));
wrapper
.
ge
(
RefundOrder:
:
getCreatedAt
,
paramJSON
.
getString
(
"createdStart"
));
}
if
(
StringUtils
.
isNotEmpty
(
paramJSON
.
getString
(
"createdEnd"
)))
{
wrapper
.
le
(
RefundOrder:
:
getCreatedAt
,
paramJSON
.
getString
(
"createdEnd"
));
}
}
}
wrapper
.
orderByDesc
(
RefundOrder:
:
getCreatedAt
);
wrapper
.
orderByDesc
(
RefundOrder:
:
getCreatedAt
);
IPage
<
RefundOrder
>
pages
=
refundOrderService
.
page
(
getIPage
(),
wrapper
);
IPage
<
RefundOrder
>
pages
=
refundOrderService
.
page
(
getIPage
(),
wrapper
);
...
@@ -82,7 +98,9 @@ public class RefundOrderController extends CommonCtrl {
...
@@ -82,7 +98,9 @@ public class RefundOrderController extends CommonCtrl {
@GetMapping
(
"/{refundOrderId}"
)
@GetMapping
(
"/{refundOrderId}"
)
public
ApiRes
detail
(
@PathVariable
(
"refundOrderId"
)
String
refundOrderId
)
{
public
ApiRes
detail
(
@PathVariable
(
"refundOrderId"
)
String
refundOrderId
)
{
RefundOrder
refundOrder
=
refundOrderService
.
getById
(
refundOrderId
);
RefundOrder
refundOrder
=
refundOrderService
.
getById
(
refundOrderId
);
if
(
refundOrder
==
null
)
return
ApiRes
.
fail
(
ApiCodeEnum
.
SYS_OPERATION_FAIL_SELETE
);
if
(
refundOrder
==
null
)
{
return
ApiRes
.
fail
(
ApiCodeEnum
.
SYS_OPERATION_FAIL_SELETE
);
}
if
(!
refundOrder
.
getMchNo
().
equals
(
getCurrentUser
().
getSysUser
().
getBelongInfoId
()))
{
if
(!
refundOrder
.
getMchNo
().
equals
(
getCurrentUser
().
getSysUser
().
getBelongInfoId
()))
{
return
ApiRes
.
fail
(
ApiCodeEnum
.
SYS_PERMISSION_ERROR
);
return
ApiRes
.
fail
(
ApiCodeEnum
.
SYS_PERMISSION_ERROR
);
}
}
...
...
jeepay-merchant/src/main/java/com/jeequan/jeepay/mch/ctrl/paytest/PaytestController.java
View file @
91b1c1c5
...
@@ -108,8 +108,12 @@ public class PaytestController extends CommonCtrl {
...
@@ -108,8 +108,12 @@ public class PaytestController extends CommonCtrl {
//设置扩展参数
//设置扩展参数
JSONObject
extParams
=
new
JSONObject
();
JSONObject
extParams
=
new
JSONObject
();
if
(
StringUtils
.
isNotEmpty
(
payDataType
))
extParams
.
put
(
"payDataType"
,
payDataType
.
trim
());
if
(
StringUtils
.
isNotEmpty
(
payDataType
))
{
if
(
StringUtils
.
isNotEmpty
(
authCode
))
extParams
.
put
(
"authCode"
,
authCode
.
trim
());
extParams
.
put
(
"payDataType"
,
payDataType
.
trim
());
}
if
(
StringUtils
.
isNotEmpty
(
authCode
))
{
extParams
.
put
(
"authCode"
,
authCode
.
trim
());
}
model
.
setChannelExtra
(
extParams
.
toString
());
model
.
setChannelExtra
(
extParams
.
toString
());
JeepayClient
jeepayClient
=
new
JeepayClient
(
sysConfigService
.
getDBApplicationConfig
().
getPaySiteUrl
(),
mchApp
.
getAppSecret
());
JeepayClient
jeepayClient
=
new
JeepayClient
(
sysConfigService
.
getDBApplicationConfig
().
getPaySiteUrl
(),
mchApp
.
getAppSecret
());
...
...
jeepay-merchant/src/main/java/com/jeequan/jeepay/mch/ctrl/sysuser/SysRoleController.java
View file @
91b1c1c5
...
@@ -92,7 +92,9 @@ public class SysRoleController extends CommonCtrl {
...
@@ -92,7 +92,9 @@ public class SysRoleController extends CommonCtrl {
@RequestMapping
(
value
=
"/{recordId}"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/{recordId}"
,
method
=
RequestMethod
.
GET
)
public
ApiRes
detail
(
@PathVariable
(
"recordId"
)
String
recordId
)
{
public
ApiRes
detail
(
@PathVariable
(
"recordId"
)
String
recordId
)
{
SysRole
sysRole
=
sysRoleService
.
getOne
(
SysRole
.
gw
().
eq
(
SysRole:
:
getRoleId
,
recordId
).
eq
(
SysRole:
:
getBelongInfoId
,
getCurrentMchNo
()));
SysRole
sysRole
=
sysRoleService
.
getOne
(
SysRole
.
gw
().
eq
(
SysRole:
:
getRoleId
,
recordId
).
eq
(
SysRole:
:
getBelongInfoId
,
getCurrentMchNo
()));
if
(
sysRole
==
null
)
throw
new
BizException
(
ApiCodeEnum
.
SYS_OPERATION_FAIL_SELETE
);
if
(
sysRole
==
null
)
{
throw
new
BizException
(
ApiCodeEnum
.
SYS_OPERATION_FAIL_SELETE
);
}
return
ApiRes
.
ok
(
sysRole
);
return
ApiRes
.
ok
(
sysRole
);
}
}
...
@@ -158,7 +160,9 @@ public class SysRoleController extends CommonCtrl {
...
@@ -158,7 +160,9 @@ public class SysRoleController extends CommonCtrl {
@RequestMapping
(
value
=
"/{recordId}"
,
method
=
RequestMethod
.
DELETE
)
@RequestMapping
(
value
=
"/{recordId}"
,
method
=
RequestMethod
.
DELETE
)
public
ApiRes
del
(
@PathVariable
(
"recordId"
)
String
recordId
)
{
public
ApiRes
del
(
@PathVariable
(
"recordId"
)
String
recordId
)
{
SysRole
sysRole
=
sysRoleService
.
getOne
(
SysRole
.
gw
().
eq
(
SysRole:
:
getRoleId
,
recordId
).
eq
(
SysRole:
:
getBelongInfoId
,
getCurrentMchNo
()));
SysRole
sysRole
=
sysRoleService
.
getOne
(
SysRole
.
gw
().
eq
(
SysRole:
:
getRoleId
,
recordId
).
eq
(
SysRole:
:
getBelongInfoId
,
getCurrentMchNo
()));
if
(
sysRole
==
null
)
throw
new
BizException
(
ApiCodeEnum
.
SYS_OPERATION_FAIL_SELETE
);
if
(
sysRole
==
null
)
{
throw
new
BizException
(
ApiCodeEnum
.
SYS_OPERATION_FAIL_SELETE
);
}
if
(
sysUserRoleRelaService
.
count
(
SysUserRoleRela
.
gw
().
eq
(
SysUserRoleRela:
:
getRoleId
,
recordId
))
>
0
){
if
(
sysUserRoleRelaService
.
count
(
SysUserRoleRela
.
gw
().
eq
(
SysUserRoleRela:
:
getRoleId
,
recordId
))
>
0
){
throw
new
BizException
(
"当前角色已分配到用户, 不可删除!"
);
throw
new
BizException
(
"当前角色已分配到用户, 不可删除!"
);
...
...
jeepay-merchant/src/main/java/com/jeequan/jeepay/mch/ctrl/sysuser/SysRoleEntRelaController.java
View file @
91b1c1c5
...
@@ -80,7 +80,9 @@ public class SysRoleEntRelaController extends CommonCtrl {
...
@@ -80,7 +80,9 @@ public class SysRoleEntRelaController extends CommonCtrl {
public
ApiRes
relas
(
@PathVariable
(
"roleId"
)
String
roleId
)
{
public
ApiRes
relas
(
@PathVariable
(
"roleId"
)
String
roleId
)
{
SysRole
sysRole
=
sysRoleService
.
getOne
(
SysRole
.
gw
().
eq
(
SysRole:
:
getRoleId
,
roleId
).
eq
(
SysRole:
:
getBelongInfoId
,
getCurrentMchNo
()));
SysRole
sysRole
=
sysRoleService
.
getOne
(
SysRole
.
gw
().
eq
(
SysRole:
:
getRoleId
,
roleId
).
eq
(
SysRole:
:
getBelongInfoId
,
getCurrentMchNo
()));
if
(
sysRole
==
null
)
throw
new
BizException
(
ApiCodeEnum
.
SYS_OPERATION_FAIL_SELETE
);
if
(
sysRole
==
null
)
{
throw
new
BizException
(
ApiCodeEnum
.
SYS_OPERATION_FAIL_SELETE
);
}
List
<
String
>
entIdList
=
JSONArray
.
parseArray
(
getValStringRequired
(
"entIdListStr"
),
String
.
class
);
List
<
String
>
entIdList
=
JSONArray
.
parseArray
(
getValStringRequired
(
"entIdListStr"
),
String
.
class
);
...
...
jeepay-merchant/src/main/java/com/jeequan/jeepay/mch/ctrl/sysuser/SysUserController.java
View file @
91b1c1c5
...
@@ -87,7 +87,9 @@ public class SysUserController extends CommonCtrl {
...
@@ -87,7 +87,9 @@ public class SysUserController extends CommonCtrl {
public
ApiRes
detail
(
@PathVariable
(
"recordId"
)
Integer
recordId
)
{
public
ApiRes
detail
(
@PathVariable
(
"recordId"
)
Integer
recordId
)
{
SysUser
sysUser
=
sysUserService
.
getById
(
recordId
);
SysUser
sysUser
=
sysUserService
.
getById
(
recordId
);
if
(
sysUser
==
null
)
throw
new
BizException
(
ApiCodeEnum
.
SYS_OPERATION_FAIL_SELETE
);
if
(
sysUser
==
null
)
{
throw
new
BizException
(
ApiCodeEnum
.
SYS_OPERATION_FAIL_SELETE
);
}
if
(!
sysUser
.
getBelongInfoId
().
equals
(
getCurrentUser
().
getSysUser
().
getBelongInfoId
()))
{
if
(!
sysUser
.
getBelongInfoId
().
equals
(
getCurrentUser
().
getSysUser
().
getBelongInfoId
()))
{
throw
new
BizException
(
ApiCodeEnum
.
SYS_PERMISSION_ERROR
);
throw
new
BizException
(
ApiCodeEnum
.
SYS_PERMISSION_ERROR
);
}
}
...
@@ -140,9 +142,13 @@ public class SysUserController extends CommonCtrl {
...
@@ -140,9 +142,13 @@ public class SysUserController extends CommonCtrl {
SysUser
sysUser
=
getObject
(
SysUser
.
class
);
SysUser
sysUser
=
getObject
(
SysUser
.
class
);
sysUser
.
setSysUserId
(
recordId
);
sysUser
.
setSysUserId
(
recordId
);
// 如果当前用户为非超管则用户状态为普通用户
// 如果当前用户为非超管则用户状态为普通用户
if
(
getCurrentUser
().
getSysUser
().
getIsAdmin
()
!=
CS
.
YES
)
sysUser
.
setIsAdmin
(
CS
.
NO
);
if
(
getCurrentUser
().
getSysUser
().
getIsAdmin
()
!=
CS
.
YES
)
{
sysUser
.
setIsAdmin
(
CS
.
NO
);
}
SysUser
dbRecord
=
sysUserService
.
getOne
(
SysUser
.
gw
().
eq
(
SysUser:
:
getSysUserId
,
recordId
).
eq
(
SysUser:
:
getBelongInfoId
,
getCurrentMchNo
()));
SysUser
dbRecord
=
sysUserService
.
getOne
(
SysUser
.
gw
().
eq
(
SysUser:
:
getSysUserId
,
recordId
).
eq
(
SysUser:
:
getBelongInfoId
,
getCurrentMchNo
()));
if
(
dbRecord
==
null
)
throw
new
BizException
(
ApiCodeEnum
.
SYS_OPERATION_FAIL_SELETE
);
if
(
dbRecord
==
null
)
{
throw
new
BizException
(
ApiCodeEnum
.
SYS_OPERATION_FAIL_SELETE
);
}
//判断是否自己禁用自己
//判断是否自己禁用自己
if
(
recordId
.
equals
(
getCurrentUser
().
getSysUser
().
getSysUserId
())
&&
sysUser
.
getState
()
!=
null
&&
sysUser
.
getState
()
==
CS
.
PUB_DISABLE
){
if
(
recordId
.
equals
(
getCurrentUser
().
getSysUser
().
getSysUserId
())
&&
sysUser
.
getState
()
!=
null
&&
sysUser
.
getState
()
==
CS
.
PUB_DISABLE
){
...
...
jeepay-merchant/src/main/java/com/jeequan/jeepay/mch/ctrl/sysuser/SysUserRoleRelaController.java
View file @
91b1c1c5
...
@@ -76,7 +76,9 @@ public class SysUserRoleRelaController extends CommonCtrl {
...
@@ -76,7 +76,9 @@ public class SysUserRoleRelaController extends CommonCtrl {
@RequestMapping
(
value
=
"relas/{sysUserId}"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"relas/{sysUserId}"
,
method
=
RequestMethod
.
POST
)
public
ApiRes
relas
(
@PathVariable
(
"sysUserId"
)
Long
sysUserId
)
{
public
ApiRes
relas
(
@PathVariable
(
"sysUserId"
)
Long
sysUserId
)
{
SysUser
dbRecord
=
sysUserService
.
getOne
(
SysUser
.
gw
().
eq
(
SysUser:
:
getSysUserId
,
sysUserId
).
eq
(
SysUser:
:
getBelongInfoId
,
getCurrentMchNo
()));
SysUser
dbRecord
=
sysUserService
.
getOne
(
SysUser
.
gw
().
eq
(
SysUser:
:
getSysUserId
,
sysUserId
).
eq
(
SysUser:
:
getBelongInfoId
,
getCurrentMchNo
()));
if
(
dbRecord
==
null
)
throw
new
BizException
(
ApiCodeEnum
.
SYS_OPERATION_FAIL_SELETE
);
if
(
dbRecord
==
null
)
{
throw
new
BizException
(
ApiCodeEnum
.
SYS_OPERATION_FAIL_SELETE
);
}
List
<
String
>
roleIdList
=
JSONArray
.
parseArray
(
getValStringRequired
(
"roleIdListStr"
),
String
.
class
);
List
<
String
>
roleIdList
=
JSONArray
.
parseArray
(
getValStringRequired
(
"roleIdListStr"
),
String
.
class
);
...
...
jeepay-merchant/src/main/java/com/jeequan/jeepay/mch/websocket/server/WsPayOrderServer.java
View file @
91b1c1c5
...
@@ -74,7 +74,9 @@ public class WsPayOrderServer {
...
@@ -74,7 +74,9 @@ public class WsPayOrderServer {
this
.
session
=
session
;
this
.
session
=
session
;
Set
<
WsPayOrderServer
>
wsServerSet
=
wsOrderIdMap
.
get
(
payOrderId
);
Set
<
WsPayOrderServer
>
wsServerSet
=
wsOrderIdMap
.
get
(
payOrderId
);
if
(
wsServerSet
==
null
)
wsServerSet
=
new
CopyOnWriteArraySet
<>();
if
(
wsServerSet
==
null
)
{
wsServerSet
=
new
CopyOnWriteArraySet
<>();
}
wsServerSet
.
add
(
this
);
wsServerSet
.
add
(
this
);
wsOrderIdMap
.
put
(
payOrderId
,
wsServerSet
);
wsOrderIdMap
.
put
(
payOrderId
,
wsServerSet
);
...
@@ -94,7 +96,9 @@ public class WsPayOrderServer {
...
@@ -94,7 +96,9 @@ public class WsPayOrderServer {
Set
wsSet
=
wsOrderIdMap
.
get
(
this
.
payOrderId
);
Set
wsSet
=
wsOrderIdMap
.
get
(
this
.
payOrderId
);
wsSet
.
remove
(
this
);
wsSet
.
remove
(
this
);
if
(
wsSet
.
isEmpty
())
wsOrderIdMap
.
remove
(
this
.
payOrderId
);
if
(
wsSet
.
isEmpty
())
{
wsOrderIdMap
.
remove
(
this
.
payOrderId
);
}
subOnlineCount
();
//在线数减1
subOnlineCount
();
//在线数减1
logger
.
info
(
"cid[{}],payOrderId[{}]连接关闭!当前在线人数为{}"
,
cid
,
payOrderId
,
onlineClientSize
);
logger
.
info
(
"cid[{}],payOrderId[{}]连接关闭!当前在线人数为{}"
,
cid
,
payOrderId
,
onlineClientSize
);
...
...
jeepay-payment/src/main/java/com/jeequan/jeepay/pay/channel/alipay/AlipayKit.java
View file @
91b1c1c5
...
@@ -49,26 +49,43 @@ public class AlipayKit {
...
@@ -49,26 +49,43 @@ public class AlipayKit {
AlipayIsvsubMchParams
isvsubMchParams
=
mchAppConfigContext
.
getIsvsubMchParamsByIfCode
(
CS
.
IF_CODE
.
ALIPAY
,
AlipayIsvsubMchParams
.
class
);
AlipayIsvsubMchParams
isvsubMchParams
=
mchAppConfigContext
.
getIsvsubMchParamsByIfCode
(
CS
.
IF_CODE
.
ALIPAY
,
AlipayIsvsubMchParams
.
class
);
// 子商户信息
// 子商户信息
if
(
req
instanceof
AlipayTradePayRequest
)
((
AlipayTradePayRequest
)
req
).
putOtherTextParam
(
"app_auth_token"
,
isvsubMchParams
.
getAppAuthToken
());
if
(
req
instanceof
AlipayTradePayRequest
)
{
else
if
(
req
instanceof
AlipayTradeAppPayRequest
)
((
AlipayTradeAppPayRequest
)
req
).
putOtherTextParam
(
"app_auth_token"
,
isvsubMchParams
.
getAppAuthToken
());
((
AlipayTradePayRequest
)
req
).
putOtherTextParam
(
"app_auth_token"
,
isvsubMchParams
.
getAppAuthToken
());
else
if
(
req
instanceof
AlipayTradeCreateRequest
)
((
AlipayTradeCreateRequest
)
req
).
putOtherTextParam
(
"app_auth_token"
,
isvsubMchParams
.
getAppAuthToken
());
}
else
if
(
req
instanceof
AlipayTradeAppPayRequest
)
{
else
if
(
req
instanceof
AlipayTradePagePayRequest
)
((
AlipayTradePagePayRequest
)
req
).
putOtherTextParam
(
"app_auth_token"
,
isvsubMchParams
.
getAppAuthToken
());
((
AlipayTradeAppPayRequest
)
req
).
putOtherTextParam
(
"app_auth_token"
,
isvsubMchParams
.
getAppAuthToken
());
else
if
(
req
instanceof
AlipayTradePrecreateRequest
)
((
AlipayTradePrecreateRequest
)
req
).
putOtherTextParam
(
"app_auth_token"
,
isvsubMchParams
.
getAppAuthToken
());
}
else
if
(
req
instanceof
AlipayTradeCreateRequest
)
{
else
if
(
req
instanceof
AlipayTradeWapPayRequest
)
((
AlipayTradeWapPayRequest
)
req
).
putOtherTextParam
(
"app_auth_token"
,
isvsubMchParams
.
getAppAuthToken
());
((
AlipayTradeCreateRequest
)
req
).
putOtherTextParam
(
"app_auth_token"
,
isvsubMchParams
.
getAppAuthToken
());
else
if
(
req
instanceof
AlipayTradeQueryRequest
)
((
AlipayTradeQueryRequest
)
req
).
putOtherTextParam
(
"app_auth_token"
,
isvsubMchParams
.
getAppAuthToken
());
}
else
if
(
req
instanceof
AlipayTradePagePayRequest
)
{
else
if
(
req
instanceof
AlipayTradeRefundRequest
)
((
AlipayTradeRefundRequest
)
req
).
putOtherTextParam
(
"app_auth_token"
,
isvsubMchParams
.
getAppAuthToken
());
((
AlipayTradePagePayRequest
)
req
).
putOtherTextParam
(
"app_auth_token"
,
isvsubMchParams
.
getAppAuthToken
());
else
if
(
req
instanceof
AlipayTradeFastpayRefundQueryRequest
)
((
AlipayTradeFastpayRefundQueryRequest
)
req
).
putOtherTextParam
(
"app_auth_token"
,
isvsubMchParams
.
getAppAuthToken
());
}
else
if
(
req
instanceof
AlipayTradePrecreateRequest
)
{
((
AlipayTradePrecreateRequest
)
req
).
putOtherTextParam
(
"app_auth_token"
,
isvsubMchParams
.
getAppAuthToken
());
}
else
if
(
req
instanceof
AlipayTradeWapPayRequest
)
{
((
AlipayTradeWapPayRequest
)
req
).
putOtherTextParam
(
"app_auth_token"
,
isvsubMchParams
.
getAppAuthToken
());
}
else
if
(
req
instanceof
AlipayTradeQueryRequest
)
{
((
AlipayTradeQueryRequest
)
req
).
putOtherTextParam
(
"app_auth_token"
,
isvsubMchParams
.
getAppAuthToken
());
}
else
if
(
req
instanceof
AlipayTradeRefundRequest
)
{
((
AlipayTradeRefundRequest
)
req
).
putOtherTextParam
(
"app_auth_token"
,
isvsubMchParams
.
getAppAuthToken
());
}
else
if
(
req
instanceof
AlipayTradeFastpayRefundQueryRequest
)
{
((
AlipayTradeFastpayRefundQueryRequest
)
req
).
putOtherTextParam
(
"app_auth_token"
,
isvsubMchParams
.
getAppAuthToken
());
}
// 服务商信息
// 服务商信息
ExtendParams
extendParams
=
new
ExtendParams
();
ExtendParams
extendParams
=
new
ExtendParams
();
extendParams
.
setSysServiceProviderId
(
isvParams
.
getPid
());
extendParams
.
setSysServiceProviderId
(
isvParams
.
getPid
());
if
(
model
instanceof
AlipayTradePayModel
)
((
AlipayTradePayModel
)
model
).
setExtendParams
(
extendParams
);
if
(
model
instanceof
AlipayTradePayModel
)
{
else
if
(
model
instanceof
AlipayTradeAppPayModel
)
((
AlipayTradeAppPayModel
)
model
).
setExtendParams
(
extendParams
);
((
AlipayTradePayModel
)
model
).
setExtendParams
(
extendParams
);
else
if
(
model
instanceof
AlipayTradeCreateModel
)
((
AlipayTradeCreateModel
)
model
).
setExtendParams
(
extendParams
);
}
else
if
(
model
instanceof
AlipayTradeAppPayModel
)
{
else
if
(
model
instanceof
AlipayTradePagePayModel
)
((
AlipayTradePagePayModel
)
model
).
setExtendParams
(
extendParams
);
((
AlipayTradeAppPayModel
)
model
).
setExtendParams
(
extendParams
);
else
if
(
model
instanceof
AlipayTradePrecreateModel
)
((
AlipayTradePrecreateModel
)
model
).
setExtendParams
(
extendParams
);
}
else
if
(
model
instanceof
AlipayTradeCreateModel
)
{
else
if
(
model
instanceof
AlipayTradeWapPayModel
)
((
AlipayTradeWapPayModel
)
model
).
setExtendParams
(
extendParams
);
((
AlipayTradeCreateModel
)
model
).
setExtendParams
(
extendParams
);
}
else
if
(
model
instanceof
AlipayTradePagePayModel
)
{
((
AlipayTradePagePayModel
)
model
).
setExtendParams
(
extendParams
);
}
else
if
(
model
instanceof
AlipayTradePrecreateModel
)
{
((
AlipayTradePrecreateModel
)
model
).
setExtendParams
(
extendParams
);
}
else
if
(
model
instanceof
AlipayTradeWapPayModel
)
{
((
AlipayTradeWapPayModel
)
model
).
setExtendParams
(
extendParams
);
}
}
}
...
...
jeepay-payment/src/main/java/com/jeequan/jeepay/pay/channel/ysfpay/payway/AliJsapi.java
View file @
91b1c1c5
...
@@ -49,6 +49,7 @@ public class AliJsapi extends YsfpayPaymentService {
...
@@ -49,6 +49,7 @@ public class AliJsapi extends YsfpayPaymentService {
return
null
;
return
null
;
}
}
@Override
public
AbstractRS
pay
(
UnifiedOrderRQ
rq
,
PayOrder
payOrder
,
MchAppConfigContext
mchAppConfigContext
)
throws
Exception
{
public
AbstractRS
pay
(
UnifiedOrderRQ
rq
,
PayOrder
payOrder
,
MchAppConfigContext
mchAppConfigContext
)
throws
Exception
{
String
logPrefix
=
"【云闪付(alipayJs)jsapi支付】"
;
String
logPrefix
=
"【云闪付(alipayJs)jsapi支付】"
;
JSONObject
reqParams
=
new
JSONObject
();
JSONObject
reqParams
=
new
JSONObject
();
...
...
jeepay-payment/src/main/java/com/jeequan/jeepay/pay/channel/ysfpay/payway/WxBar.java
View file @
91b1c1c5
...
@@ -49,6 +49,7 @@ public class WxBar extends YsfpayPaymentService {
...
@@ -49,6 +49,7 @@ public class WxBar extends YsfpayPaymentService {
return
null
;
return
null
;
}
}
@Override
public
AbstractRS
pay
(
UnifiedOrderRQ
rq
,
PayOrder
payOrder
,
MchAppConfigContext
mchAppConfigContext
)
throws
Exception
{
public
AbstractRS
pay
(
UnifiedOrderRQ
rq
,
PayOrder
payOrder
,
MchAppConfigContext
mchAppConfigContext
)
throws
Exception
{
String
logPrefix
=
"【云闪付条码(wechat)支付】"
;
String
logPrefix
=
"【云闪付条码(wechat)支付】"
;
...
...
jeepay-payment/src/main/java/com/jeequan/jeepay/pay/channel/ysfpay/payway/YsfBar.java
View file @
91b1c1c5
...
@@ -50,6 +50,7 @@ public class YsfBar extends YsfpayPaymentService {
...
@@ -50,6 +50,7 @@ public class YsfBar extends YsfpayPaymentService {
return
null
;
return
null
;
}
}
@Override
public
AbstractRS
pay
(
UnifiedOrderRQ
rq
,
PayOrder
payOrder
,
MchAppConfigContext
mchAppConfigContext
)
throws
Exception
{
public
AbstractRS
pay
(
UnifiedOrderRQ
rq
,
PayOrder
payOrder
,
MchAppConfigContext
mchAppConfigContext
)
throws
Exception
{
String
logPrefix
=
"【云闪付条码(unionpay)支付】"
;
String
logPrefix
=
"【云闪付条码(unionpay)支付】"
;
...
...
jeepay-payment/src/main/java/com/jeequan/jeepay/pay/ctrl/qr/ChannelUserIdController.java
View file @
91b1c1c5
...
@@ -121,7 +121,9 @@ public class ChannelUserIdController extends AbstractPayOrderController {
...
@@ -121,7 +121,9 @@ public class ChannelUserIdController extends AbstractPayOrderController {
String
ua
=
request
.
getHeader
(
"User-Agent"
);
String
ua
=
request
.
getHeader
(
"User-Agent"
);
// 无法识别扫码客户端
// 无法识别扫码客户端
if
(
StringUtils
.
isBlank
(
ua
))
return
null
;
if
(
StringUtils
.
isBlank
(
ua
))
{
return
null
;
}
if
(
ua
.
contains
(
"Alipay"
))
{
if
(
ua
.
contains
(
"Alipay"
))
{
return
CS
.
IF_CODE
.
ALIPAY
;
//支付宝服务窗支付
return
CS
.
IF_CODE
.
ALIPAY
;
//支付宝服务窗支付
...
...
jeepay-payment/src/main/java/com/jeequan/jeepay/pay/mq/PayOrderReissueMQReceiver.java
View file @
91b1c1c5
...
@@ -63,7 +63,9 @@ public class PayOrderReissueMQReceiver implements PayOrderReissueMQ.IMQReceiver
...
@@ -63,7 +63,9 @@ public class PayOrderReissueMQReceiver implements PayOrderReissueMQ.IMQReceiver
return
;
return
;
}
}
if
(
payOrder
==
null
)
return
;
if
(
payOrder
==
null
)
{
return
;
}
ChannelRetMsg
channelRetMsg
=
channelOrderReissueService
.
processPayOrder
(
payOrder
);
ChannelRetMsg
channelRetMsg
=
channelOrderReissueService
.
processPayOrder
(
payOrder
);
//返回null 可能为接口报错等, 需要再次轮询
//返回null 可能为接口报错等, 需要再次轮询
...
...
jeepay-payment/src/main/java/com/jeequan/jeepay/pay/util/CodeImgUtil.java
View file @
91b1c1c5
...
@@ -44,18 +44,18 @@ import java.util.Map;
...
@@ -44,18 +44,18 @@ import java.util.Map;
/*
/*
* 二维码生成器
* 二维码生成器
*
*
* @author terrfly
* @author terrfly
* @site https://www.jeepay.vip
* @site https://www.jeepay.vip
* @date 2021/6/8 17:54
* @date 2021/6/8 17:54
*/
*/
public
class
CodeImgUtil
{
public
class
CodeImgUtil
{
private
static
final
Logger
_log
=
LoggerFactory
.
getLogger
(
CodeImgUtil
.
class
);
private
static
final
Logger
_log
=
LoggerFactory
.
getLogger
(
CodeImgUtil
.
class
);
// 二维码尺寸List
// 二维码尺寸List
private
static
List
<
Integer
>
sizeList
=
new
ArrayList
<
Integer
>();
private
static
List
<
Integer
>
sizeList
=
new
ArrayList
<
Integer
>();
static
{
static
{
sizeList
.
add
(
258
);
sizeList
.
add
(
258
);
sizeList
.
add
(
344
);
sizeList
.
add
(
344
);
...
@@ -63,13 +63,13 @@ public class CodeImgUtil {
...
@@ -63,13 +63,13 @@ public class CodeImgUtil {
sizeList
.
add
(
860
);
sizeList
.
add
(
860
);
sizeList
.
add
(
1280
);
sizeList
.
add
(
1280
);
}
}
public
static
List
<
Integer
>
getEwmSizeList
()
{
public
static
List
<
Integer
>
getEwmSizeList
()
{
return
sizeList
;
return
sizeList
;
}
}
//TODO
//TODO
// 图片宽度的一般
// 图片宽度的一般
private
static
final
int
IMAGE_WIDTH
=
25
;
private
static
final
int
IMAGE_WIDTH
=
25
;
private
static
final
int
IMAGE_HEIGHT
=
25
;
private
static
final
int
IMAGE_HEIGHT
=
25
;
...
@@ -80,7 +80,7 @@ public class CodeImgUtil {
...
@@ -80,7 +80,7 @@ public class CodeImgUtil {
private
static
MultiFormatWriter
mutiWriter
=
new
MultiFormatWriter
();
private
static
MultiFormatWriter
mutiWriter
=
new
MultiFormatWriter
();
/**
/**
*
*
* @param content
* @param content
* 二维码显示的文本
* 二维码显示的文本
* @param width
* @param width
...
@@ -114,7 +114,7 @@ public class CodeImgUtil {
...
@@ -114,7 +114,7 @@ public class CodeImgUtil {
/**
/**
* 得到BufferedImage
* 得到BufferedImage
*
*
* @param content
* @param content
* 二维码显示的文本
* 二维码显示的文本
* @param width
* @param width
...
@@ -134,7 +134,7 @@ public class CodeImgUtil {
...
@@ -134,7 +134,7 @@ public class CodeImgUtil {
// 读取源图像
// 读取源图像
BufferedImage
scaleImage
=
scale
(
srcImagePath
,
IMAGE_WIDTH
,
BufferedImage
scaleImage
=
scale
(
srcImagePath
,
IMAGE_WIDTH
,
IMAGE_HEIGHT
,
false
);
IMAGE_HEIGHT
,
false
);
int
[][]
srcPixels
=
new
int
[
IMAGE_WIDTH
][
IMAGE_HEIGHT
];
int
[][]
srcPixels
=
new
int
[
IMAGE_WIDTH
][
IMAGE_HEIGHT
];
for
(
int
i
=
0
;
i
<
scaleImage
.
getWidth
();
i
++)
{
for
(
int
i
=
0
;
i
<
scaleImage
.
getWidth
();
i
++)
{
for
(
int
j
=
0
;
j
<
scaleImage
.
getHeight
();
j
++)
{
for
(
int
j
=
0
;
j
<
scaleImage
.
getHeight
();
j
++)
{
...
@@ -200,7 +200,7 @@ public class CodeImgUtil {
...
@@ -200,7 +200,7 @@ public class CodeImgUtil {
/**
/**
* 把传入的原始图像按高度和宽度进行缩放,生成符合要求的图标
* 把传入的原始图像按高度和宽度进行缩放,生成符合要求的图标
*
*
* @param srcImageFile
* @param srcImageFile
* 源文件地址
* 源文件地址
* @param height
* @param height
...
@@ -214,9 +214,9 @@ public class CodeImgUtil {
...
@@ -214,9 +214,9 @@ public class CodeImgUtil {
private
static
BufferedImage
scale
(
String
srcImageFile
,
int
height
,
private
static
BufferedImage
scale
(
String
srcImageFile
,
int
height
,
int
width
,
boolean
hasFiller
)
throws
IOException
{
int
width
,
boolean
hasFiller
)
throws
IOException
{
double
ratio
=
0.0
;
// 缩放比例
double
ratio
=
0.0
;
// 缩放比例
URL
url
=
new
URL
(
srcImageFile
);
URL
url
=
new
URL
(
srcImageFile
);
BufferedImage
srcImage
=
ImageIO
.
read
(
url
);
BufferedImage
srcImage
=
ImageIO
.
read
(
url
);
Image
destImage
=
srcImage
.
getScaledInstance
(
width
,
height
,
Image
destImage
=
srcImage
.
getScaledInstance
(
width
,
height
,
BufferedImage
.
SCALE_SMOOTH
);
BufferedImage
.
SCALE_SMOOTH
);
...
@@ -239,38 +239,39 @@ public class CodeImgUtil {
...
@@ -239,38 +239,39 @@ public class CodeImgUtil {
Graphics2D
graphic
=
image
.
createGraphics
();
Graphics2D
graphic
=
image
.
createGraphics
();
graphic
.
setColor
(
Color
.
white
);
graphic
.
setColor
(
Color
.
white
);
graphic
.
fillRect
(
0
,
0
,
width
,
height
);
graphic
.
fillRect
(
0
,
0
,
width
,
height
);
if
(
width
==
destImage
.
getWidth
(
null
))
if
(
width
==
destImage
.
getWidth
(
null
))
{
graphic
.
drawImage
(
destImage
,
0
,
(
height
-
destImage
graphic
.
drawImage
(
destImage
,
0
,
(
height
-
destImage
.
getHeight
(
null
))
/
2
,
destImage
.
getWidth
(
null
),
.
getHeight
(
null
))
/
2
,
destImage
.
getWidth
(
null
),
destImage
.
getHeight
(
null
),
Color
.
white
,
null
);
destImage
.
getHeight
(
null
),
Color
.
white
,
null
);
else
}
else
{
graphic
.
drawImage
(
destImage
,
graphic
.
drawImage
(
destImage
,
(
width
-
destImage
.
getWidth
(
null
))
/
2
,
0
,
destImage
(
width
-
destImage
.
getWidth
(
null
))
/
2
,
0
,
destImage
.
getWidth
(
null
),
destImage
.
getHeight
(
null
),
.
getWidth
(
null
),
destImage
.
getHeight
(
null
),
Color
.
white
,
null
);
Color
.
white
,
null
);
}
graphic
.
dispose
();
graphic
.
dispose
();
destImage
=
image
;
destImage
=
image
;
}
}
return
(
BufferedImage
)
destImage
;
return
(
BufferedImage
)
destImage
;
}
}
/**
/**
* 生成图像
* 生成图像
* filePath 存放图片的路径
* filePath 存放图片的路径
* fileName 图片的名称
* fileName 图片的名称
* info 生成图片的链接地址(例如:weixin://wxpay/s/Anp43md)
* info 生成图片的链接地址(例如:weixin://wxpay/s/Anp43md)
* width 图片的宽度
* width 图片的宽度
* height 图片的高度
* height 图片的高度
* @throws WriterException
* @throws WriterException
* @throws IOException
* @throws IOException
*/
*/
public
static
String
codeImgEncode
(
String
filePath
,
String
fileName
,
String
info
,
int
width
,
int
height
)
throws
WriterException
,
IOException
{
public
static
String
codeImgEncode
(
String
filePath
,
String
fileName
,
String
info
,
int
width
,
int
height
)
throws
WriterException
,
IOException
{
String
format
=
"png"
;
String
format
=
"png"
;
Map
<
EncodeHintType
,
Object
>
hints
=
new
HashMap
<
EncodeHintType
,
Object
>();
Map
<
EncodeHintType
,
Object
>
hints
=
new
HashMap
<
EncodeHintType
,
Object
>();
hints
.
put
(
EncodeHintType
.
CHARACTER_SET
,
"UTF-8"
);
hints
.
put
(
EncodeHintType
.
CHARACTER_SET
,
"UTF-8"
);
BitMatrix
bitMatrix
=
new
MultiFormatWriter
().
encode
(
info
,
BitMatrix
bitMatrix
=
new
MultiFormatWriter
().
encode
(
info
,
BarcodeFormat
.
QR_CODE
,
width
,
height
,
hints
);
// 生成矩阵
BarcodeFormat
.
QR_CODE
,
width
,
height
,
hints
);
// 生成矩阵
Path
path
=
FileSystems
.
getDefault
().
getPath
(
filePath
,
fileName
);
Path
path
=
FileSystems
.
getDefault
().
getPath
(
filePath
,
fileName
);
File
dir
=
new
File
(
filePath
);
File
dir
=
new
File
(
filePath
);
_log
.
error
(
"=================="
+
filePath
);
_log
.
error
(
"=================="
+
filePath
);
if
(!
dir
.
exists
())
{
if
(!
dir
.
exists
())
{
...
@@ -299,30 +300,30 @@ public class CodeImgUtil {
...
@@ -299,30 +300,30 @@ public class CodeImgUtil {
/**
/**
* 解析图像
* 解析图像
*/
*/
public
static
void
codeImgDecode
()
{
public
static
void
codeImgDecode
()
{
String
filePath
=
"D://zxing.png"
;
String
filePath
=
"D://zxing.png"
;
BufferedImage
image
;
BufferedImage
image
;
try
{
try
{
image
=
ImageIO
.
read
(
new
File
(
filePath
));
image
=
ImageIO
.
read
(
new
File
(
filePath
));
LuminanceSource
source
=
new
BufferedImageLuminanceSource
(
image
);
LuminanceSource
source
=
new
BufferedImageLuminanceSource
(
image
);
Binarizer
binarizer
=
new
HybridBinarizer
(
source
);
Binarizer
binarizer
=
new
HybridBinarizer
(
source
);
BinaryBitmap
binaryBitmap
=
new
BinaryBitmap
(
binarizer
);
BinaryBitmap
binaryBitmap
=
new
BinaryBitmap
(
binarizer
);
Map
<
DecodeHintType
,
Object
>
hints
=
new
HashMap
<
DecodeHintType
,
Object
>();
Map
<
DecodeHintType
,
Object
>
hints
=
new
HashMap
<
DecodeHintType
,
Object
>();
hints
.
put
(
DecodeHintType
.
CHARACTER_SET
,
"UTF-8"
);
hints
.
put
(
DecodeHintType
.
CHARACTER_SET
,
"UTF-8"
);
Result
result
=
new
MultiFormatReader
().
decode
(
binaryBitmap
,
hints
);
// 对图像进行解码
Result
result
=
new
MultiFormatReader
().
decode
(
binaryBitmap
,
hints
);
// 对图像进行解码
JSONObject
content
=
JSON
.
parseObject
(
result
.
getText
());
JSONObject
content
=
JSON
.
parseObject
(
result
.
getText
());
System
.
out
.
println
(
"图片中内容: "
);
System
.
out
.
println
(
"图片中内容: "
);
System
.
out
.
println
(
"author: "
+
content
.
getString
(
"author"
));
System
.
out
.
println
(
"author: "
+
content
.
getString
(
"author"
));
System
.
out
.
println
(
"zxing: "
+
content
.
getString
(
"zxing"
));
System
.
out
.
println
(
"zxing: "
+
content
.
getString
(
"zxing"
));
System
.
out
.
println
(
"图片中格式: "
);
System
.
out
.
println
(
"图片中格式: "
);
System
.
out
.
println
(
"encode: "
+
result
.
getBarcodeFormat
());
System
.
out
.
println
(
"encode: "
+
result
.
getBarcodeFormat
());
}
catch
(
IOException
e
)
{
}
catch
(
IOException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
catch
(
NotFoundException
e
)
{
}
catch
(
NotFoundException
e
)
{
e
.
printStackTrace
();
e
.
printStackTrace
();
}
}
}
}
/**
/**
...
@@ -337,8 +338,9 @@ public class CodeImgUtil {
...
@@ -337,8 +338,9 @@ public class CodeImgUtil {
resMatrix
.
clear
();
resMatrix
.
clear
();
for
(
int
i
=
0
;
i
<
resWidth
;
i
++)
{
for
(
int
i
=
0
;
i
<
resWidth
;
i
++)
{
for
(
int
j
=
0
;
j
<
resHeight
;
j
++)
{
for
(
int
j
=
0
;
j
<
resHeight
;
j
++)
{
if
(
matrix
.
get
(
i
+
rec
[
0
],
j
+
rec
[
1
]))
if
(
matrix
.
get
(
i
+
rec
[
0
],
j
+
rec
[
1
]))
{
resMatrix
.
set
(
i
,
j
);
resMatrix
.
set
(
i
,
j
);
}
}
}
}
}
return
resMatrix
;
return
resMatrix
;
...
...
jeepay-service/src/main/java/com/jeequan/jeepay/service/impl/IsvInfoService.java
View file @
91b1c1c5
...
@@ -47,11 +47,15 @@ public class IsvInfoService extends ServiceImpl<IsvInfoMapper, IsvInfo> {
...
@@ -47,11 +47,15 @@ public class IsvInfoService extends ServiceImpl<IsvInfoMapper, IsvInfo> {
public
void
removeByIsvNo
(
String
isvNo
)
{
public
void
removeByIsvNo
(
String
isvNo
)
{
// 0.当前服务商是否存在
// 0.当前服务商是否存在
IsvInfo
isvInfo
=
isvInfoService
.
getById
(
isvNo
);
IsvInfo
isvInfo
=
isvInfoService
.
getById
(
isvNo
);
if
(
isvInfo
==
null
)
throw
new
BizException
(
"该服务商不存在"
);
if
(
isvInfo
==
null
)
{
throw
new
BizException
(
"该服务商不存在"
);
}
// 1.查询当前服务商下是否存在商户
// 1.查询当前服务商下是否存在商户
int
mchCount
=
mchInfoService
.
count
(
MchInfo
.
gw
().
eq
(
MchInfo:
:
getIsvNo
,
isvNo
).
eq
(
MchInfo:
:
getType
,
CS
.
INFO_TYPE_ISV
));
int
mchCount
=
mchInfoService
.
count
(
MchInfo
.
gw
().
eq
(
MchInfo:
:
getIsvNo
,
isvNo
).
eq
(
MchInfo:
:
getType
,
CS
.
INFO_TYPE_ISV
));
if
(
mchCount
>
0
)
throw
new
BizException
(
"该服务商下存在商户,不可删除"
);
if
(
mchCount
>
0
)
{
throw
new
BizException
(
"该服务商下存在商户,不可删除"
);
}
// 2.删除当前服务商支付接口配置参数
// 2.删除当前服务商支付接口配置参数
payInterfaceConfigService
.
remove
(
PayInterfaceConfig
.
gw
()
payInterfaceConfigService
.
remove
(
PayInterfaceConfig
.
gw
()
...
@@ -61,6 +65,8 @@ public class IsvInfoService extends ServiceImpl<IsvInfoMapper, IsvInfo> {
...
@@ -61,6 +65,8 @@ public class IsvInfoService extends ServiceImpl<IsvInfoMapper, IsvInfo> {
// 3.删除该服务商
// 3.删除该服务商
boolean
remove
=
isvInfoService
.
removeById
(
isvNo
);
boolean
remove
=
isvInfoService
.
removeById
(
isvNo
);
if
(!
remove
)
throw
new
BizException
(
"删除服务商失败"
);
if
(!
remove
)
{
throw
new
BizException
(
"删除服务商失败"
);
}
}
}
}
}
jeepay-service/src/main/java/com/jeequan/jeepay/service/impl/MchAppService.java
View file @
91b1c1c5
...
@@ -37,7 +37,9 @@ public class MchAppService extends ServiceImpl<MchAppMapper, MchApp> {
...
@@ -37,7 +37,9 @@ public class MchAppService extends ServiceImpl<MchAppMapper, MchApp> {
// 1.查看当前应用是否存在交易数据
// 1.查看当前应用是否存在交易数据
int
payCount
=
payOrderService
.
count
(
PayOrder
.
gw
().
eq
(
PayOrder:
:
getAppId
,
appId
));
int
payCount
=
payOrderService
.
count
(
PayOrder
.
gw
().
eq
(
PayOrder:
:
getAppId
,
appId
));
if
(
payCount
>
0
)
throw
new
BizException
(
"该应用已存在交易数据,不可删除"
);
if
(
payCount
>
0
)
{
throw
new
BizException
(
"该应用已存在交易数据,不可删除"
);
}
// 2.删除应用关联的支付通道
// 2.删除应用关联的支付通道
mchPayPassageService
.
remove
(
MchPayPassage
.
gw
().
eq
(
MchPayPassage:
:
getAppId
,
appId
));
mchPayPassageService
.
remove
(
MchPayPassage
.
gw
().
eq
(
MchPayPassage:
:
getAppId
,
appId
));
...
@@ -67,10 +69,18 @@ public class MchAppService extends ServiceImpl<MchAppMapper, MchApp> {
...
@@ -67,10 +69,18 @@ public class MchAppService extends ServiceImpl<MchAppMapper, MchApp> {
public
IPage
<
MchApp
>
selectPage
(
IPage
iPage
,
MchApp
mchApp
)
{
public
IPage
<
MchApp
>
selectPage
(
IPage
iPage
,
MchApp
mchApp
)
{
LambdaQueryWrapper
<
MchApp
>
wrapper
=
MchApp
.
gw
();
LambdaQueryWrapper
<
MchApp
>
wrapper
=
MchApp
.
gw
();
if
(
StringUtils
.
isNotBlank
(
mchApp
.
getMchNo
()))
wrapper
.
eq
(
MchApp:
:
getMchNo
,
mchApp
.
getMchNo
());
if
(
StringUtils
.
isNotBlank
(
mchApp
.
getMchNo
()))
{
if
(
StringUtils
.
isNotEmpty
(
mchApp
.
getAppId
()))
wrapper
.
eq
(
MchApp:
:
getAppId
,
mchApp
.
getAppId
());
wrapper
.
eq
(
MchApp:
:
getMchNo
,
mchApp
.
getMchNo
());
if
(
StringUtils
.
isNotEmpty
(
mchApp
.
getAppName
()))
wrapper
.
eq
(
MchApp:
:
getAppName
,
mchApp
.
getAppName
());
}
if
(
mchApp
.
getState
()
!=
null
)
wrapper
.
eq
(
MchApp:
:
getState
,
mchApp
.
getState
());
if
(
StringUtils
.
isNotEmpty
(
mchApp
.
getAppId
()))
{
wrapper
.
eq
(
MchApp:
:
getAppId
,
mchApp
.
getAppId
());
}
if
(
StringUtils
.
isNotEmpty
(
mchApp
.
getAppName
()))
{
wrapper
.
eq
(
MchApp:
:
getAppName
,
mchApp
.
getAppName
());
}
if
(
mchApp
.
getState
()
!=
null
)
{
wrapper
.
eq
(
MchApp:
:
getState
,
mchApp
.
getState
());
}
wrapper
.
orderByDesc
(
MchApp:
:
getCreatedAt
);
wrapper
.
orderByDesc
(
MchApp:
:
getCreatedAt
);
IPage
<
MchApp
>
pages
=
this
.
page
(
iPage
,
wrapper
);
IPage
<
MchApp
>
pages
=
this
.
page
(
iPage
,
wrapper
);
...
...
Prev
1
2
3
4
Next
Write
Preview
Supports
Markdown
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