Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
S
soss
Overview
Overview
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
hooloo
ms
soss
Commits
f6385ca0
Commit
f6385ca0
authored
May 23, 2022
by
张新旗
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
代码重新提交
parent
34dbac7f
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
69 additions
and
73 deletions
+69
-73
soss-admin/src/main/resources/application.yml
+1
-54
soss-admin/src/main/resources/logback.xml
+1
-1
soss-system/src/main/java/com/soss/system/domain/Order.java
+10
-10
soss-system/src/main/java/com/soss/system/service/impl/MachineApiServiceImpl.java
+29
-2
soss-system/src/main/java/com/soss/system/service/impl/OrderServiceImpl.java
+4
-4
soss-system/src/main/resources/mapper/system/GoodsMapper.xml
+24
-2
No files found.
soss-admin/src/main/resources/application.yml
View file @
f6385ca0
# 项目相关配置
ruoyi
:
# 名称
name
:
coffee
# 版本
version
:
3.8.1
# 版权年份
copyrightYear
:
2022
# 实例演示开关
demoEnabled
:
true
# 文件路径 示例( Windows配置D:/ruoyi/uploadPath,Linux配置 /home/ruoyi/uploadPath)
profile
:
D:/ruoyi/uploadPath
# 获取ip地址开关
addressEnabled
:
false
# 验证码类型 math 数组计算 char 字符验证
captchaType
:
math
# 开发环境配置
server
:
# 服务器的HTTP端口,默认为8080
port
:
8080
port
:
8090
servlet
:
# 应用的访问路径
context-path
:
/
tomcat
:
# tomcat的URI编码
uri-encoding
:
UTF-8
# 连接数满后的排队数,默认为100
accept-count
:
1000
threads
:
# tomcat最大线程数,默认为200
max
:
800
# Tomcat启动初始化的线程数,默认值10
min-spare
:
100
# 日志配置
logging
:
level
:
com.soss
:
debug
org.springframework
:
warn
# Spring配置
spring
:
# 资源信息
messages
:
# 国际化资源文件路径
basename
:
i18n/messages
profiles
:
active
:
druid
# 文件上传
servlet
:
multipart
:
# 单个文件大小
max-file-size
:
10MB
# 设置总上传的文件大小
max-request-size
:
20MB
# 服务模块
devtools
:
restart
:
# 热部署开关
enabled
:
true
# redis 配置
redis
:
# 地址
host
:
140.143.224.240
# 端口,默认为6379
port
:
6399
# 数据库索引
database
:
0
# 密码
password
:
Qwer_1234
# 连接超时时间
timeout
:
10s
lettuce
:
pool
:
# 连接池中的最小空闲连接
min-idle
:
0
# 连接池中的最大空闲连接
max-idle
:
8
# 连接池的最大数据库连接数
max-active
:
8
# #连接池最大阻塞等待时间(使用负值表示没有限制)
max-wait
:
-1ms
# token配置
token
:
# 令牌自定义标识
header
:
Authorization
# 令牌密钥
secret
:
abcdefghijklmnopqrstuvwxyz
# 令牌有效期(默认30分钟)
expireTime
:
30
# MyBatis配置
mybatis
:
# 搜索指定包别名
typeAliasesPackage
:
com.soss.**.domain
# 配置mapper的扫描,找到所有的mapper.xml映射文件
mapperLocations
:
classpath*:mapper/**/*Mapper.xml
# 加载全局的配置文件
configLocation
:
classpath:mybatis/mybatis-config.xml
# PageHelper分页插件
pagehelper
:
helperDialect
:
mysql
supportMethodsArguments
:
true
params
:
count=countSql
# Swagger配置
swagger
:
# 是否开启swagger
enabled
:
true
# 请求前缀
pathMapping
:
/dev-api
# 防止XSS攻击
xss
:
# 过滤开关
enabled
:
true
# 排除链接(多个用逗号分隔)
excludes
:
/system/notice
# 匹配链接
urlPatterns
:
/system/*,/monitor/*,/tool/*
oss
:
dir
:
hooloo
...
...
@@ -131,11 +81,8 @@ weixin:
appid
:
wx71aa3662dfd3227d
secret
:
da8a0b08436dd3ce560be429f14e768a
mchid
:
1625511257
#商户支付密钥
key
:
WcCsQZXavaPXQEKuTGJlGOkzzTPxTPsr
#微信回调地址
notify-url
:
http://114.115.234.81:8080/weixin/native/notify
#交易类型
trade-type
:
JSAPI
url
:
https://api.mch.weixin.qq.com/pay/unifiedorder
query-url
:
https://api.mch.weixin.qq.com/pay/orderquery
...
...
soss-admin/src/main/resources/logback.xml
View file @
f6385ca0
<?xml version="1.0" encoding="UTF-8"?>
<configuration>
<!-- 日志存放路径 -->
<property
name=
"log.path"
value=
"
/home/ruoyi
/logs"
/>
<property
name=
"log.path"
value=
"
.
/logs"
/>
<!-- 日志输出格式 -->
<property
name=
"log.pattern"
value=
"%d{HH:mm:ss.SSS} [%thread] %-5level %logger{20} - [%method,%line] - %msg%n"
/>
...
...
soss-system/src/main/java/com/soss/system/domain/Order.java
View file @
f6385ca0
...
...
@@ -21,7 +21,7 @@ public class Order implements Serializable
private
static
final
long
serialVersionUID
=
1L
;
/** 主键 */
private
l
ong
id
;
private
L
ong
id
;
/** 订单号 */
@Excel
(
name
=
"订单号"
)
...
...
@@ -44,12 +44,12 @@ public class Order implements Serializable
private
String
userPhone
;
/** 支付时间 */
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd
HH:mm:ss
"
)
@Excel
(
name
=
"支付时间"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd"
)
private
Date
payTime
;
/** 完成时间 */
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd
HH:mm:ss
"
)
@Excel
(
name
=
"完成时间"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd"
)
private
Date
finishTime
;
...
...
@@ -75,18 +75,18 @@ public class Order implements Serializable
/** 点单屏序号 */
@Excel
(
name
=
"点单屏序号"
)
private
String
source
;
private
Integer
source
;
@Excel
(
name
=
"订单状态 0 未支付取消 1 未支付 2 已支付 3 待制作 4 支付制作中 5 制作完成未取 6 取餐中 7 取餐完成 8 支付后制作前取消 9 制作中取消 10 制作完成取消 11 已退款 12 部分退款 50 其他人工干预状态"
)
private
String
state
;
/** 创建时间 */
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd
HH:mm:ss
"
)
@Excel
(
name
=
"创建时间"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd"
)
private
Date
createdAt
;
/** 更新时间 */
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
@JsonFormat
(
pattern
=
"yyyy-MM-dd
HH:mm:ss
"
)
@Excel
(
name
=
"更新时间"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd"
)
private
Date
updatedAt
;
...
...
@@ -110,11 +110,11 @@ public class Order implements Serializable
this
.
orderDetails
=
orderDetails
;
}
public
l
ong
getId
()
{
public
L
ong
getId
()
{
return
id
;
}
public
void
setId
(
l
ong
id
)
{
public
void
setId
(
L
ong
id
)
{
this
.
id
=
id
;
}
...
...
@@ -226,12 +226,12 @@ public class Order implements Serializable
{
return
machineId
;
}
public
void
setSource
(
String
source
)
public
void
setSource
(
Integer
source
)
{
this
.
source
=
source
;
}
public
String
getSource
()
public
Integer
getSource
()
{
return
source
;
}
...
...
soss-system/src/main/java/com/soss/system/service/impl/MachineApiServiceImpl.java
View file @
f6385ca0
...
...
@@ -18,6 +18,7 @@ import org.springframework.http.ResponseEntity;
import
org.springframework.stereotype.Service
;
import
org.springframework.web.client.RestTemplate
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.List
;
...
...
@@ -40,6 +41,9 @@ public class MachineApiServiceImpl {
private
MachineMapper
machineMapper
;
@Autowired
private
StringRedisTemplate
stringRedisTemplate
;
@Autowired
private
GoodsMapper
goodsMapper
;
public
String
shopGoodsUpdate
(
JSONObject
jsonObject
)
{
String
shopID
=
jsonObject
.
getString
(
"shopId"
);
String
skuIDs
=
jsonObject
.
getString
(
"skuId"
);
...
...
@@ -89,10 +93,33 @@ public class MachineApiServiceImpl {
OrderDetail
orderDetail
=
new
OrderDetail
();
orderDetail
.
setOrderId
(
order
.
getId
());
List
<
OrderDetail
>
orderDetails
=
orderDetailMapper
.
selectOrderDetailList
(
orderDetail
);
order
.
setOrderDetails
(
orderDetails
);
for
(
OrderDetail
detail
:
orderDetails
)
{
Goods
goods
=
goodsMapper
.
selectGoodsById
(
detail
.
getGoodsId
());
detail
.
setGoods
(
goods
);
}
ObjectMapper
objectMapper
=
new
ObjectMapper
();
String
orderInfo
=
objectMapper
.
writeValueAsString
(
order
);
ResultVo
resultVo
=
sendRequest
(
orderInfo
,
"/v1/order"
);
JSONObject
orderJson
=
JSONObject
.
parseObject
(
orderInfo
);
// orderJson.put("goodsNum",1);
orderJson
.
put
(
"machineId"
,
orderJson
.
getLong
(
"machineId"
));
orderJson
.
put
(
"shopId"
,
orderJson
.
getLong
(
"shopId"
));
orderJson
.
put
(
"state"
,
orderJson
.
getLong
(
"state"
));
List
<
JSONObject
>
goodsList
=
new
ArrayList
<>();
orderJson
.
put
(
"goodsList"
,
goodsList
);
for
(
OrderDetail
detail
:
orderDetails
)
{
JSONObject
jsonObject
=
new
JSONObject
();
goodsList
.
add
(
jsonObject
);
jsonObject
.
put
(
"goodsId"
,
Long
.
valueOf
(
detail
.
getGoodsId
()));
jsonObject
.
put
(
"goodsName"
,
detail
.
getGoodsName
());
jsonObject
.
put
(
"num"
,
Integer
.
parseInt
(
detail
.
getNum
()));
jsonObject
.
put
(
"amount"
,
detail
.
getAmount
());
jsonObject
.
put
(
"specRuleDetail"
,
detail
.
getSpecRuleDetail
());
jsonObject
.
put
(
"specRuleIds"
,
detail
.
getSpecRuleIds
());
jsonObject
.
put
(
"skuId"
,
Long
.
parseLong
(
detail
.
getSkuId
()));
jsonObject
.
put
(
"goodsCategory"
,
detail
.
getGoods
().
getCategoryName
());
}
ResultVo
resultVo
=
sendRequest
(
orderJson
.
toJSONString
(),
"/v1/order"
);
String
code
=
resultVo
.
getCode
();
if
(
"2001"
.
equals
(
code
)){
...
...
soss-system/src/main/java/com/soss/system/service/impl/OrderServiceImpl.java
View file @
f6385ca0
...
...
@@ -242,12 +242,12 @@ public class OrderServiceImpl implements IOrderService
return
key
+
String
.
format
(
"%03d"
,
andIncrement
);
}
//获取订单号
private
String
getOrderNo
(
String
source
){
private
String
getOrderNo
(
Integer
source
){
String
channel
=
"M"
;
if
(
StringUtils
.
isNotEmpty
(
source
)
){
if
(
"1"
.
equals
(
source
)
){
if
(
source
!=
null
){
if
(
source
==
1
){
channel
=
"A"
;
}
else
if
(
"2"
.
equals
(
source
)
){
}
else
if
(
source
==
2
){
channel
=
"B"
;
}
}
...
...
soss-system/src/main/resources/mapper/system/GoodsMapper.xml
View file @
f6385ca0
...
...
@@ -21,6 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result
property=
"updatedAt"
column=
"updated_at"
/>
<result
property=
"code"
column=
"code"
/>
<result
property=
"shelfAt"
column=
"shelf_at"
/>
<result
property=
"categoryName"
column=
"categoryName"
/>
</resultMap>
<sql
id=
"selectGoodsVo"
>
...
...
@@ -44,12 +45,33 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"createdAt != null "
>
and created_at = #{createdAt}
</if>
<if
test=
"updatedAt != null "
>
and updated_at = #{updatedAt}
</if>
<if
test=
"code != null and code != ''"
>
and code = #{code}
</if>
</where>
</select>
<select
id=
"selectGoodsById"
parameterType=
"String"
resultMap=
"GoodsResult"
>
<include
refid=
"selectGoodsVo"
/>
where id = #{id}
select
g.id,
g.name,
g.category,
gc.name as categoryName,
g.price,
g.discount,
g.take_time,
g.spec,
g.pics,
g.`desc`,
g.remarks,
g.state,
g.is_deleted,
g.created_at,
g.updated_at,
g.code,
g.shelf_at
from
goods g,goods_category gc
where g.id = #{id}
and g.category =gc.id
</select>
<insert
id=
"insertGoods"
parameterType=
"Goods"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
...
...
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