Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
C
card-pay
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
qinhu
card-pay
Commits
88493bc8
Commit
88493bc8
authored
Apr 26, 2021
by
mengbali153
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
小程序点单完成
parent
72a11d83
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
85 additions
and
66 deletions
+85
-66
pom.xml
card-common/common-core/pom.xml
+6
-0
JdbcConfig.java
...va/cn/wise/sc/pay/common/security2/config/JdbcConfig.java
+2
-0
UserController.java
.../pay/laas/userbac/business/controller/UserController.java
+3
-1
UserControler.java
.../pay/pass/business/cashiers/controller/UserControler.java
+13
-10
OrderController.java
...e/sc/pay/business/cashier/controller/OrderController.java
+1
-0
IDeviceService.java
...a/cn/wise/sc/pay/api/merchant/service/IDeviceService.java
+2
-2
IDeviceUserService.java
.../wise/sc/pay/api/merchant/service/IDeviceUserService.java
+3
-0
DeviceServiceImpl.java
...c/pay/api/merchant/service/hystrix/DeviceServiceImpl.java
+4
-4
DeviceUserImpl.java
...e/sc/pay/api/merchant/service/hystrix/DeviceUserImpl.java
+6
-0
DeviceController.java
...sc/pay/business/merchant/controller/DeviceController.java
+16
-12
DeviceUserController.java
...ay/business/merchant/controller/DeviceUserController.java
+11
-0
OrderApplication.java
.../java/cn/wise/sc/pay/business/order/OrderApplication.java
+1
-1
WXController.java
...n/wise/sc/pay/business/order/controller/WXController.java
+15
-30
bootstrap.yml
...aas-order/order-business/src/main/resources/bootstrap.yml
+2
-6
No files found.
card-common/common-core/pom.xml
View file @
88493bc8
...
...
@@ -38,6 +38,12 @@
<groupId>
com.fasterxml.jackson.datatype
</groupId>
<artifactId>
jackson-datatype-jsr310
</artifactId>
</dependency>
<dependency>
<groupId>
com.fasterxml.jackson.core
</groupId>
<artifactId>
jackson-core
</artifactId>
<version>
2.8.5
</version>
</dependency>
<dependency>
<groupId>
com.fasterxml.jackson.core
</groupId>
<artifactId>
jackson-databind
</artifactId>
...
...
card-common/common-security2/src/main/java/cn/wise/sc/pay/common/security2/config/JdbcConfig.java
View file @
88493bc8
...
...
@@ -34,6 +34,8 @@ public class JdbcConfig {
DruidDataSource
dataSource
=
new
DruidDataSource
();
dataSource
.
setDriverClassName
(
"com.mysql.cj.jdbc.Driver"
);
dataSource
.
setUrl
(
"jdbc:mysql://127.0.0.1:3306/oxo_main_data?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT%2B8"
);
// dataSource.setUrl("jdbc:mysql://81.68.92.175:3306/oxo_main_data?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT%2B8");
// dataSource.setUrl("jdbc:mysql://120.133.238.195:8022/oxo_main_data?useUnicode=true&characterEncoding=UTF-8&useSSL=false&serverTimezone=GMT%2B8");
dataSource
.
setUsername
(
"root"
);
dataSource
.
setPassword
(
"admin!@#123"
);
return
dataSource
;
...
...
card-laas/laas-userbac/userbac-business/src/main/java/cn/wise/sc/pay/laas/userbac/business/controller/UserController.java
View file @
88493bc8
...
...
@@ -79,9 +79,11 @@ public class UserController {
* @param id ID
* @return 用户信息
*/
@GetMapping
(
"/{id}"
)
// @GetMapping("/{id}")
@PostMapping
(
"/{id}"
)
// @PreAuthorize("@pms.hasPermission('sys_user_get')")
public
R
user
(
@PathVariable
Integer
id
)
{
System
.
out
.
println
(
"-------------通过id查询用户信息------------"
);
return
R
.
ok
(
userService
.
getUserVoById
(
id
));
}
...
...
card-paas/paas-cashier/cashiers-business/src/main/java/cn/wise/sc/pay/pass/business/cashiers/controller/UserControler.java
View file @
88493bc8
...
...
@@ -14,6 +14,7 @@ import cn.wise.sc.pay.laas.userbac.domain.entity.SysUser;
import
cn.wise.sc.pay.pass.business.cashiers.config.CommonUrlProperties
;
import
cn.wise.sc.pay.pass.business.cashiers.model.CheckPasswordQuery
;
import
cn.wise.sc.pay.pass.business.cashiers.model.Employee
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.extension.api.R
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiImplicitParam
;
...
...
@@ -25,12 +26,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.boot.context.properties.EnableConfigurationProperties
;
import
org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
;
import
org.springframework.security.crypto.password.PasswordEncoder
;
import
org.springframework.web.bind.annotation.CrossOrigin
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RequestParam
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.ArrayList
;
import
java.util.HashMap
;
...
...
@@ -66,6 +62,12 @@ public class UserControler extends UserController {
@Autowired
IMerchantService
iMerchantService
;
@PostMapping
(
"/{id}"
)
// @PreAuthorize("@pms.hasPermission('sys_user_get')")
public
R
user
(
@PathVariable
Integer
id
)
{
return
R
.
failed
(
"无权访问"
);
}
@ApiOperation
(
"收银端注册账号"
)
@PostMapping
(
"/register"
)
@ApiResponses
({
@ApiResponse
(
code
=
200
,
message
=
"成功"
,
response
=
String
.
class
)})
...
...
@@ -128,14 +130,14 @@ public class UserControler extends UserController {
BaseResponse
<
Merchant
>
merchantInfo
=
merchantService
.
getMerchantInfo
(
merchId
);
if
(
merchantInfo
.
getCode
()
==
200
)
{
Merchant
data
=
merchantInfo
.
getData
();
System
.
out
.
println
(
JSON
.
toJSONString
(
data
));
if
(
data
.
getManageStatus
()
==
1
)
{
// return R.failed("当前商户已关闭");
data
.
setManageStatus
((
byte
)
0
);
BaseResponse
updatemerchant
=
merchantService
.
updatemerchant
(
data
);
return
R
.
ok
(
updatemerchant
);
}
else
{
return
R
.
ok
(
"当前商户已开启"
);
}
// else{
// return R.ok("当前商户已开启");
// }
}
if
(
"ADMIN"
.
equals
(
user
.
getSysUser
().
getLevel
()))
{
List
<
LinkedHashMap
>
results
=
deviceUserService
.
getMerchDevices
(
merchId
).
getList
();
...
...
@@ -165,6 +167,7 @@ public class UserControler extends UserController {
return
R
.
failed
(
"当前设备未绑定商户,无法登录"
);
}
}
}
@ApiOperation
(
"收银端退出"
)
...
...
card-saas/saas-cashier/cashier-business/src/main/java/cn/wise/sc/pay/business/cashier/controller/OrderController.java
View file @
88493bc8
...
...
@@ -207,6 +207,7 @@ public class OrderController {
BaseResponse
baseResponse
=
iOrderService
.
orderByNoV2
(
orderNo
);
return
baseResponse
;
}
/**
* 统计 根据支付类型 统计金额
*/
...
...
card-saas/saas-merchant/merchant-api/src/main/java/cn/wise/sc/pay/api/merchant/service/IDeviceService.java
View file @
88493bc8
...
...
@@ -27,6 +27,6 @@ public interface IDeviceService {
public
BaseResponse
devicePage
(
@RequestParam
(
"merchId"
)
Long
merchId
,
@RequestParam
(
"typeId"
)
Integer
typeId
,
@SpringQueryMap
PageQuery
pageQuery
);
@Ge
tMapping
(
"/getDeviceBySeller"
)
public
Device
getDeviceBySeller
(
Long
merchId
);
// @Pos
tMapping("/getDeviceBySeller")
// public String getDeviceBySeller(@RequestParam("merchId")
Long merchId);
}
card-saas/saas-merchant/merchant-api/src/main/java/cn/wise/sc/pay/api/merchant/service/IDeviceUserService.java
View file @
88493bc8
...
...
@@ -27,4 +27,7 @@ public interface IDeviceUserService {
@GetMapping
(
"getMerchDevices"
)
BaseResponse
getMerchDevices
(
@RequestParam
(
"merchId"
)
Long
merchId
);
@GetMapping
(
"/getDeviceBySeller"
)
public
String
getDeviceBySeller
(
@RequestParam
(
"merchId"
)
Long
merchId
);
}
card-saas/saas-merchant/merchant-api/src/main/java/cn/wise/sc/pay/api/merchant/service/hystrix/DeviceServiceImpl.java
View file @
88493bc8
...
...
@@ -34,8 +34,8 @@ public class DeviceServiceImpl implements IDeviceService {
return
null
;
}
@Override
public
Device
getDeviceBySeller
(
Long
merchId
)
{
return
null
;
}
//
@Override
// public String
getDeviceBySeller(Long merchId) {
//
return null;
//
}
}
card-saas/saas-merchant/merchant-api/src/main/java/cn/wise/sc/pay/api/merchant/service/hystrix/DeviceUserImpl.java
View file @
88493bc8
...
...
@@ -30,6 +30,12 @@ public class DeviceUserImpl implements IDeviceUserService {
return
null
;
}
@Override
public
String
getDeviceBySeller
(
Long
merchId
)
{
error
();
return
null
;
}
/**
* 服务异常
*
...
...
card-saas/saas-merchant/merchant-business/src/main/java/cn/wise/sc/pay/business/merchant/controller/DeviceController.java
View file @
88493bc8
...
...
@@ -68,13 +68,6 @@ public class DeviceController {
return
BaseResponse
.
ok
(
result
);
}
public
List
<
Device
>
getMerchDevicesV2
(
@PathVariable
(
"merchId"
)
Long
merchId
)
{
QueryWrapper
wrapper
=
new
QueryWrapper
();
wrapper
.
eq
(
"merch_id"
,
merchId
);
List
<
Device
>
result
=
deviceService
.
list
(
wrapper
);
return
result
;
}
@DeleteMapping
(
"delete/{id}"
)
public
BaseResponse
deleteDevice
(
@PathVariable
(
"id"
)
Long
id
)
{
if
(
id
==
null
)
{
...
...
@@ -105,13 +98,24 @@ public class DeviceController {
}
@GetMapping
(
"/getDeviceBySeller"
)
public
Device
getDeviceBySeller
(
Long
merchId
)
{
public
List
<
Device
>
getMerchDevicesV2
(
Long
merchId
)
{
QueryWrapper
wrapper
=
new
QueryWrapper
();
wrapper
.
eq
(
"merch_id"
,
merchId
);
List
<
Device
>
result
=
deviceService
.
list
(
wrapper
);
return
result
;
}
@PostMapping
(
"/getDeviceBySeller"
)
public
String
getDeviceBySeller
(
Long
merchId
)
{
System
.
out
.
println
(
"/getDeviceBySeller="
+
merchId
);
// QueryWrapper wrapper = new QueryWrapper();
// wrapper.eq("merch_id", merchId);
// Device
on
e = deviceService.getOne(wrapper);
// Device
devic
e = deviceService.getOne(wrapper);
List
<
Device
>
merchDevicesV2
=
getMerchDevicesV2
(
merchId
);
Device
device
=
merchDevicesV2
.
get
(
1
);
return
device
;
Device
device
=
merchDevicesV2
.
get
(
0
);
String
deviceCode
=
device
.
getDeviceCode
();
System
.
out
.
println
(
"/getDeviceBySeller.deviceCode=="
+
deviceCode
);
return
deviceCode
;
}
}
card-saas/saas-merchant/merchant-business/src/main/java/cn/wise/sc/pay/business/merchant/controller/DeviceUserController.java
View file @
88493bc8
...
...
@@ -80,4 +80,15 @@ public class DeviceUserController {
}
}
@GetMapping
(
"/getDeviceBySeller"
)
public
String
getDeviceBySeller
(
Long
merchId
)
{
System
.
out
.
println
(
"/getDeviceBySeller="
+
merchId
);
QueryWrapper
wrapper
=
new
QueryWrapper
();
wrapper
.
eq
(
"merch_id"
,
merchId
);
List
<
Device
>
result
=
deviceService
.
list
(
wrapper
);
Device
device
=
result
.
get
(
0
);
String
deviceCode
=
device
.
getDeviceCode
();
System
.
out
.
println
(
"/getDeviceBySeller.deviceCode=="
+
deviceCode
);
return
deviceCode
;
}
}
card-saas/saas-order/order-business/src/main/java/cn/wise/sc/pay/business/order/OrderApplication.java
View file @
88493bc8
...
...
@@ -15,7 +15,7 @@ import org.springframework.transaction.annotation.EnableTransactionManagement;
**/
@SpringBootApplication
@EnableDiscoveryClient
@EnableWiseSwagger2
//
@EnableWiseSwagger2
@EnableTransactionManagement
@MapperScan
(
basePackageClasses
=
XpenseTrackerMapper
.
class
)
public
class
OrderApplication
{
...
...
card-saas/saas-order/order-business/src/main/java/cn/wise/sc/pay/business/order/controller/WXController.java
View file @
88493bc8
...
...
@@ -6,6 +6,7 @@ import cn.hutool.core.lang.Snowflake;
import
cn.hutool.core.map.MapUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.wise.sc.pay.api.merchant.service.IDeviceService
;
import
cn.wise.sc.pay.api.merchant.service.IDeviceUserService
;
import
cn.wise.sc.pay.api.merchant.service.IMerchantProfitService
;
import
cn.wise.sc.pay.api.merchant.service.IMerchantService
;
import
cn.wise.sc.pay.business.goods.service.ISpcDetailService
;
...
...
@@ -95,6 +96,7 @@ public class WXController {
// IDeviceService iDeviceService;
final
IDeviceService
iDeviceService
;
final
IDeviceUserService
iDeviceUserService
;
@Value
(
"${wechat.suqiancredit.appId}"
)
String
WECHAT_APPID
;
@Value
(
"${wechat.suqiancredit.secret}"
)
...
...
@@ -108,7 +110,8 @@ public class WXController {
IMerchantProfitService
merchantProfitService
,
Producer
producer
,
ISafeguardService
iSafeguardService
,
IDeviceService
iDeviceService
)
{
IDeviceService
iDeviceService
,
IDeviceUserService
iDeviceUserService
)
{
this
.
wxPayService
=
wxPayService
;
this
.
iOrdersService
=
iOrdersService
;
this
.
iSpcDetailService
=
iSpcDetailService
;
...
...
@@ -116,6 +119,7 @@ public class WXController {
this
.
producer
=
producer
;
this
.
iSafeguardService
=
iSafeguardService
;
this
.
iDeviceService
=
iDeviceService
;
this
.
iDeviceUserService
=
iDeviceUserService
;
}
/**
...
...
@@ -913,12 +917,16 @@ public class WXController {
String
msg
=
strs
[
strs
.
length
-
2
];
String
sn
=
strs
[
strs
.
length
-
2
];
log
.
info
(
msg
+
"-------------------"
+
sn
);
if
(
msg
==
"oxo-pay"
){
String
deviceNo
=
"T208D94L40388"
;
if
(
msg
.
equals
(
"oxo-pay"
)){
Long
sellerId
=
orders
.
getSellerId
();
System
.
out
.
println
(
"sellerId---------------------"
+
sellerId
);
// String deviceCode = iDeviceService.getDeviceBySeller(sellerId);
String
deviceCode
=
iDeviceUserService
.
getDeviceBySeller
(
sellerId
);
log
.
info
(
"--------------------------deviceCode:"
+
deviceCode
+
"------------------------------------"
);
TransactionMessage
transactionMessage
=
new
TransactionMessage
();
transactionMessage
.
setMessage
(
device
No
+
"|"
+
orders
.
getOrderNo
());
transactionMessage
.
setQueue
(
device
No
);
transactionMessage
.
setRouteKey
(
device
No
);
transactionMessage
.
setMessage
(
device
Code
+
"|"
+
orders
.
getOrderNo
());
transactionMessage
.
setQueue
(
device
Code
+
"_mp"
);
transactionMessage
.
setRouteKey
(
device
Code
+
"_mp"
);
transactionMessage
.
setStatus
(
999
);
log
.
info
(
transactionMessage
.
toString
());
try
{
...
...
@@ -954,34 +962,11 @@ public class WXController {
// }
}
}
//收银系统 打印小票
if
(
"APP"
.
equals
(
orders
.
getPaas
()))
{
String
[]
strs
=
msgInfo
.
split
(
"\\|"
);
if
(
strs
.
length
>=
2
)
{
// String msg = strs[strs.length - 3];
String
msg
=
strs
[
strs
.
length
-
2
];
String
sn
=
strs
[
strs
.
length
-
2
];
TransactionMessage
transactionMessage
=
new
TransactionMessage
();
transactionMessage
.
setMessage
(
msg
+
"|"
+
orders
.
getOrderNo
());
transactionMessage
.
setQueue
(
sn
);
transactionMessage
.
setRouteKey
(
sn
);
transactionMessage
.
setStatus
(
999
);
try
{
log
.
info
(
"打印小票 msg :{}"
,
JSON
.
toJSONString
(
transactionMessage
));
mqpost
(
transactionMessage
);
}
catch
(
IOException
e
)
{
log
.
error
(
"app端打印小票,mq消息推送失败!"
);
e
.
printStackTrace
();
}
}
}
}
public
static
void
main
(
String
[]
args
)
{
TransactionMessage
transactionMessage
=
new
TransactionMessage
();
transactionMessage
.
setMessage
(
"
ashfdkjsgdhf
"
+
"|"
+
"1341276633818075136"
);
transactionMessage
.
setMessage
(
"
T208D94L40388
"
+
"|"
+
"1341276633818075136"
);
transactionMessage
.
setQueue
(
"T208D94L40388"
);
transactionMessage
.
setRouteKey
(
"T208D94L40388"
);
transactionMessage
.
setStatus
(
999
);
...
...
card-saas/saas-order/order-business/src/main/resources/bootstrap.yml
View file @
88493bc8
...
...
@@ -12,18 +12,14 @@ spring:
nacos
:
discovery
:
server-addr
:
${nacos.ip}:8848
# namespace: 34ec6c41-14f8-4f0f-a565-6039e5c49b22
config
:
server-addr
:
${nacos.ip}:8848
file-extension
:
yaml
# namespace: 34ec6c41-14f8-4f0f-a565-6039e5c49b22
#共享文件设置
shared-dataids
:
common.yaml
refreshable-dataids
:
common.yaml
# 设置swagger用户名密码
swagger
:
basic
:
enable
:
false
username
:
admin
password
:
admin
#变量名字
nacos
:
ip
:
81.68.92.175
#nacosd地址
...
...
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