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
ff5a1f6a
Commit
ff5a1f6a
authored
May 14, 2022
by
张新旗
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
小程序,订单代码提交
parent
a34c00d8
Hide whitespace changes
Inline
Side-by-side
Showing
30 changed files
with
439 additions
and
62 deletions
+439
-62
ruoyi-admin/src/main/java/com/ruoyi/web/controller/coffee/AppController.java
+12
-4
ruoyi-admin/src/main/java/com/ruoyi/web/controller/coffee/ApplicationController.java
+73
-0
ruoyi-admin/src/main/java/com/ruoyi/web/controller/coffee/OrderTakingController.java
+3
-1
ruoyi-admin/src/main/java/com/ruoyi/web/controller/coffee/WeixinController.java
+32
-3
ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java
+8
-2
ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
+1
-1
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/WeixinServiceImpl.java
+15
-2
ruoyi-system/src/main/java/com/ruoyi/system/domain/Machine.java
+10
-0
ruoyi-system/src/main/java/com/ruoyi/system/domain/Order.java
+1
-1
ruoyi-system/src/main/java/com/ruoyi/system/domain/OrderDetail.java
+10
-0
ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/OrderQuery.java
+3
-1
ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/orderTaking/GoodsVo.java
+14
-13
ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/orderTaking/SkuRuleVo.java
+1
-1
ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/orderTaking/SkuVo.java
+15
-3
ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/orderTaking/SpecRuleVo.java
+20
-0
ruoyi-system/src/main/java/com/ruoyi/system/jiguang/impl/JiGuangPushServiceImpl.java
+16
-0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/MachineMapper.java
+1
-0
ruoyi-system/src/main/java/com/ruoyi/system/mapper/OrderMapper.java
+7
-0
ruoyi-system/src/main/java/com/ruoyi/system/service/IOrderService.java
+2
-0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/AppServiceImpl.java
+9
-0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/GoodsServiceImpl.java
+1
-0
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/OrderServiceImpl.java
+55
-2
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/OrderTakingServiceImpl.java
+76
-12
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ShopRecommendServiceImpl.java
+2
-0
ruoyi-system/src/main/resources/mapper/system/CustomerMapper.xml
+3
-1
ruoyi-system/src/main/resources/mapper/system/GoodsCategoryMapper.xml
+1
-1
ruoyi-system/src/main/resources/mapper/system/MachineMapper.xml
+7
-0
ruoyi-system/src/main/resources/mapper/system/OrderMapper.xml
+27
-1
ruoyi-system/src/main/resources/mapper/system/ShopGoodsSkuMapper.xml
+6
-5
ruoyi-system/src/main/resources/mapper/system/ShopRecommendMapper.xml
+8
-8
No files found.
ruoyi-admin/src/main/java/com/ruoyi/web/controller/coffee/AppController.java
View file @
ff5a1f6a
...
...
@@ -4,6 +4,7 @@ import com.ruoyi.common.core.domain.AjaxResult;
import
com.ruoyi.common.core.domain.model.LoginUser
;
import
com.ruoyi.framework.web.service.TokenService
;
import
com.ruoyi.system.service.impl.AppServiceImpl
;
import
com.ruoyi.system.service.impl.OrderServiceImpl
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
...
...
@@ -17,12 +18,19 @@ public class AppController {
private
TokenService
tokenService
;
@Autowired
private
AppServiceImpl
appService
;
@RequestMapping
(
"/getShop"
)
public
AjaxResult
getShop
(
String
lng
,
String
lat
){
return
AjaxResult
.
success
(
appService
.
getShop
(
lng
,
lat
));
@Autowired
private
OrderServiceImpl
orderService
;
@RequestMapping
(
"/getMyOrder"
)
public
AjaxResult
getMyOrder
(
HttpServletRequest
request
){
LoginUser
loginUser
=
tokenService
.
getLoginUser
(
request
);
if
(
loginUser
==
null
){
return
AjaxResult
.
error
(
"请先登录"
);
}
String
openId
=
loginUser
.
getOpenId
();
return
AjaxResult
.
success
(
orderService
.
getMyOrder
(
openId
));
}
}
ruoyi-admin/src/main/java/com/ruoyi/web/controller/coffee/ApplicationController.java
0 → 100644
View file @
ff5a1f6a
package
com
.
ruoyi
.
web
.
controller
.
coffee
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.common.utils.uuid.UUID
;
import
com.ruoyi.system.domain.Machine
;
import
com.ruoyi.system.domain.vo.PushBean
;
import
com.ruoyi.system.jiguang.impl.JiGuangPushServiceImpl
;
import
com.ruoyi.system.service.impl.MachineServiceImpl
;
import
com.ruoyi.system.service.impl.OrderServiceImpl
;
import
com.ruoyi.system.service.impl.OrderTakingServiceImpl
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.security.core.parameters.P
;
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
java.util.HashMap
;
import
java.util.Map
;
import
java.util.concurrent.TimeUnit
;
@RestController
@RequestMapping
(
"/application"
)
public
class
ApplicationController
{
@Autowired
private
StringRedisTemplate
stringRedisTemplate
;
@Autowired
private
MachineServiceImpl
machineService
;
@Autowired
JiGuangPushServiceImpl
jiGuangPushService
;
@Autowired
private
OrderTakingServiceImpl
orderTakingService
;
@Autowired
private
OrderServiceImpl
orderService
;
@RequestMapping
(
"/saveData"
)
public
AjaxResult
saveApplicationData
(
@RequestParam
(
"machineCode"
)
String
machineCode
,
@RequestBody
String
body
){
String
id
=
UUID
.
randomUUID
().
toString
();
String
key
=
machineCode
+
"_"
+
id
;
stringRedisTemplate
.
opsForValue
().
set
(
key
,
body
);
stringRedisTemplate
.
expire
(
id
,
1
,
TimeUnit
.
HOURS
);
return
AjaxResult
.
success
(
id
);
}
@RequestMapping
(
"/getData"
)
public
AjaxResult
getApplicationData
(
String
key
){
String
s
=
stringRedisTemplate
.
opsForValue
().
get
(
key
);
stringRedisTemplate
.
delete
(
key
);
String
[]
keys
=
key
.
split
(
"_"
);
//推送数据给安卓
PushBean
pushBean
=
new
PushBean
();
Map
<
String
,
String
>
map
=
new
HashMap
();
map
.
put
(
"type"
,
"1"
);
map
.
put
(
"code"
,
"200"
);
jiGuangPushService
.
push
(
keys
[
0
],
map
);
return
AjaxResult
.
success
(
s
);
}
@RequestMapping
(
"/jgRegister"
)
public
AjaxResult
jgRegister
(
String
machineCode
,
String
registerId
){
Machine
machine
=
new
Machine
();
machine
.
setId
(
machineCode
);
machine
.
setRegister
(
registerId
);
return
AjaxResult
.
success
(
machineService
.
updateMachine
(
machine
));
}
@RequestMapping
(
"/getOrderTaking"
)
public
AjaxResult
getOrderTaking
(
String
machineCode
){
return
AjaxResult
.
success
(
orderTakingService
.
getMachineInfo
(
machineCode
));
}
@RequestMapping
(
"/getOrderInfo"
)
public
AjaxResult
getOrderInfo
(
String
machineCode
){
return
AjaxResult
.
success
(
orderService
.
getOrderInfo
(
machineCode
));
}
}
ruoyi-admin/src/main/java/com/ruoyi/web/controller/coffee/OrderTakingController.java
View file @
ff5a1f6a
...
...
@@ -4,12 +4,14 @@ import com.ruoyi.common.core.domain.AjaxResult;
import
com.ruoyi.system.service.impl.OrderTakingServiceImpl
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* 点单信息
*/
@RestController
(
"/orderTaking"
)
@RestController
@RequestMapping
((
"/orderTaking"
))
public
class
OrderTakingController
{
@Autowired
private
OrderTakingServiceImpl
orderTakingService
;
...
...
ruoyi-admin/src/main/java/com/ruoyi/web/controller/coffee/WeixinController.java
View file @
ff5a1f6a
package
com
.
ruoyi
.
web
.
controller
.
coffee
;
import
com.alibaba.fastjson.JSONObject
;
import
com.ruoyi.common.constant.Constants
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.common.exception.ServiceException
;
import
com.ruoyi.common.utils.QRCodeUtil
;
import
com.ruoyi.framework.web.service.WeixinServiceImpl
;
import
com.ruoyi.system.service.impl.AppServiceImpl
;
import
com.ruoyi.system.service.impl.OrderTakingServiceImpl
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
...
...
@@ -18,14 +21,24 @@ public class WeixinController {
@Autowired
WeixinServiceImpl
weixinService
;
@Autowired
private
AppServiceImpl
appService
;
@Autowired
private
OrderTakingServiceImpl
orderTakingService
;
//这个就是那个使用传code进来的接口
@GetMapping
(
"/login"
)
public
AjaxResult
login
(
@RequestParam
(
"code"
)
String
code
,
@RequestParam
(
"encryptedData"
)
String
encryptedData
,
@RequestParam
(
"iv"
)
String
iv
,
@RequestParam
(
required
=
false
)
String
source
){
@PostMapping
(
"/login"
)
public
AjaxResult
login
(
@RequestBody
String
body
){
JSONObject
param
=
JSONObject
.
parseObject
(
body
);
String
code
=
param
.
getString
(
"code"
);
String
encryptedData
=
param
.
getString
(
"encryptedData"
);
String
iv
=
param
.
getString
(
"iv"
);
String
source
=
param
.
getString
(
"source"
);
AjaxResult
ajax
=
AjaxResult
.
success
();
String
token
=
weixinService
.
login
(
code
,
encryptedData
,
iv
,
source
);
ajax
.
put
(
Constants
.
TOKEN
,
token
);
return
null
;
return
ajax
;
}
@RequestMapping
(
"/wxNotify"
)
...
...
@@ -36,6 +49,22 @@ public class WeixinController {
throw
new
ServiceException
(
"微信回调发生异常"
);
}
}
@RequestMapping
(
"/test"
)
public
String
test
(){
return
weixinService
.
test
();
}
@RequestMapping
(
"/getShop"
)
public
AjaxResult
getShop
(
@RequestParam
(
required
=
false
)
String
lng
,
@RequestParam
(
required
=
false
)
String
lat
){
return
AjaxResult
.
success
(
appService
.
getShop
(
lng
,
lat
));
}
@GetMapping
(
value
=
"/infoByShop"
)
public
AjaxResult
infoByShop
(
String
shopId
)
{
return
AjaxResult
.
success
(
orderTakingService
.
getInfoByShop
(
shopId
));
}
}
ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/LogAspect.java
View file @
ff5a1f6a
...
...
@@ -4,6 +4,8 @@ import java.util.Collection;
import
java.util.Map
;
import
javax.servlet.http.HttpServletRequest
;
import
javax.servlet.http.HttpServletResponse
;
import
com.ruoyi.common.exception.ServiceException
;
import
org.aspectj.lang.JoinPoint
;
import
org.aspectj.lang.annotation.AfterReturning
;
import
org.aspectj.lang.annotation.AfterThrowing
;
...
...
@@ -67,8 +69,12 @@ public class LogAspect
{
// 获取当前的用户
LoginUser
loginUser
=
SecurityUtils
.
getLoginUser
();
LoginUser
loginUser
=
null
;
try
{
loginUser
=
SecurityUtils
.
getLoginUser
();
}
catch
(
ServiceException
serviceException
){
log
.
error
(
"获取用户数据为空"
);
}
// *========数据库日志=========*//
SysOperLog
operLog
=
new
SysOperLog
();
operLog
.
setStatus
(
BusinessStatus
.
SUCCESS
.
ordinal
());
...
...
ruoyi-framework/src/main/java/com/ruoyi/framework/config/SecurityConfig.java
View file @
ff5a1f6a
...
...
@@ -97,7 +97,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter
// 过滤请求
.
authorizeRequests
()
// 对于登录login 注册register 验证码captchaImage 允许匿名访问
.
antMatchers
(
"/login"
,
"/register"
,
"/captchaImage"
,
"/weixin/**"
,
"/
tool/ge
n/**"
).
anonymous
()
.
antMatchers
(
"/login"
,
"/register"
,
"/captchaImage"
,
"/weixin/**"
,
"/
applicatio
n/**"
).
anonymous
()
.
antMatchers
(
HttpMethod
.
GET
,
"/"
,
...
...
ruoyi-framework/src/main/java/com/ruoyi/framework/web/service/WeixinServiceImpl.java
View file @
ff5a1f6a
...
...
@@ -2,6 +2,7 @@ package com.ruoyi.framework.web.service;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.ruoyi.common.core.domain.entity.SysUser
;
import
com.ruoyi.common.core.domain.model.LoginUser
;
import
com.ruoyi.common.exception.ServiceException
;
import
com.ruoyi.common.utils.QRCodeUtil
;
...
...
@@ -84,7 +85,7 @@ public class WeixinServiceImpl {
public
String
getSessionKeyOrOpenId
(
String
code
)
{
String
url
=
"https://api.weixin.qq.com/sns/jscode2session?appid={0}&secret={1}&js_code={2}&grant_type=authorization_code"
;
String
replaceUrl
=
url
.
replace
(
"{0}"
,
appid
).
replace
(
"{1}"
,
secret
).
replace
(
"{2}"
,
code
);
String
res
=
restTemplate
.
getForObject
(
u
rl
,
String
.
class
);
String
res
=
restTemplate
.
getForObject
(
replaceU
rl
,
String
.
class
);
return
res
;
}
...
...
@@ -94,6 +95,7 @@ public class WeixinServiceImpl {
JSONObject
openInfo
=
JSONObject
.
parseObject
(
sessionKeyOrOpenId
);
String
cutomerId
=
openInfo
.
getString
(
"openid"
);
String
encData
=
this
.
wxDecrypt
(
encryptedData
,
sessionKeyOrOpenId
,
iv
);
log
.
info
(
"当前用户的信息为:【{}】"
,
encData
);
Customer
customer
=
customerMapper
.
selectCustomerById
(
cutomerId
);
JSONObject
encDataInf
=
JSONObject
.
parseObject
(
encData
);
if
(
customer
==
null
){
...
...
@@ -117,10 +119,14 @@ public class WeixinServiceImpl {
}
private
LoginUser
transLoginUser
(
Customer
customer
,
String
encData
){
LoginUser
loginUser
=
new
LoginUser
();
SysUser
user
=
new
SysUser
();
user
.
setUserName
(
customer
.
getUserName
());
LoginUser
loginUser
=
new
LoginUser
(
user
,
null
);
loginUser
.
setLoginTime
(
System
.
currentTimeMillis
());
loginUser
.
setOpenId
(
customer
.
getId
());
loginUser
.
setExt
(
encData
);
return
loginUser
;
}
...
...
@@ -287,4 +293,11 @@ public class WeixinServiceImpl {
}
return
null
;
}
public
String
test
()
{
Customer
customer
=
new
Customer
();
customer
.
setUserName
(
"zxq"
);
customer
.
setId
(
"111"
);
return
tokenService
.
createToken
(
transLoginUser
(
customer
,
null
));
}
}
ruoyi-system/src/main/java/com/ruoyi/system/domain/Machine.java
View file @
ff5a1f6a
...
...
@@ -51,6 +51,16 @@ public class Machine extends BaseEntity
@Excel
(
name
=
"更新时间"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd"
)
private
Date
updatedAt
;
public
String
getRegister
()
{
return
register
;
}
public
void
setRegister
(
String
register
)
{
this
.
register
=
register
;
}
private
String
register
;
public
void
setId
(
String
id
)
{
this
.
id
=
id
;
...
...
ruoyi-system/src/main/java/com/ruoyi/system/domain/Order.java
View file @
ff5a1f6a
...
...
@@ -78,7 +78,7 @@ public class Order extends BaseEntity
private
String
source
;
/** 订单状态 0 创建未校验 1 未支付 2 已支付 3 支付制作中 4 制作完成未取 5 待取超时 6 正常完成 7 未支付取消 8 支付后制作前取消 9 制作中取消 10 制作完成取消 11 已退款 12 部分退款 50 其他人工干预状态 */
@Excel
(
name
=
"订单状态 0
创建未校验 1 未支付 2 已支付 3 支付制作中 4 制作完成未取 5 待取超时 6 正常完成 7 未支付取消
8 支付后制作前取消 9 制作中取消 10 制作完成取消 11 已退款 12 部分退款 50 其他人工干预状态"
)
@Excel
(
name
=
"订单状态 0
未支付取消 1 未支付 2 已支付 3 待制作 4 支付制作中 5 制作完成未取 6 取餐中 7 取餐完成
8 支付后制作前取消 9 制作中取消 10 制作完成取消 11 已退款 12 部分退款 50 其他人工干预状态"
)
private
String
state
;
/** 创建时间 */
...
...
ruoyi-system/src/main/java/com/ruoyi/system/domain/OrderDetail.java
View file @
ff5a1f6a
...
...
@@ -65,6 +65,16 @@ public class OrderDetail extends BaseEntity
@Excel
(
name
=
"商品分类"
)
private
String
goodsCategory
;
public
Goods
getGoods
()
{
return
goods
;
}
public
void
setGoods
(
Goods
goods
)
{
this
.
goods
=
goods
;
}
private
Goods
goods
;
/** 创建时间 */
@JsonFormat
(
pattern
=
"yyyy-MM-dd"
)
@Excel
(
name
=
"创建时间"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd"
)
...
...
ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/OrderQuery.java
View file @
ff5a1f6a
package
com
.
ruoyi
.
system
.
domain
.
vo
;
import
com.ruoyi.common.core.domain.BaseEntity
;
import
java.util.Date
;
public
class
OrderQuery
{
public
class
OrderQuery
extends
BaseEntity
{
//d订单号
private
String
orderNo
;
...
...
ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/orderTaking/GoodsVo.java
View file @
ff5a1f6a
...
...
@@ -3,7 +3,7 @@ package com.ruoyi.system.domain.vo.orderTaking;
import
java.util.List
;
public
class
GoodsVo
{
private
String
goodId
;
private
String
good
s
Id
;
private
String
name
;
private
String
price
;
...
...
@@ -17,12 +17,12 @@ public class GoodsVo {
private
List
<
SkuVo
>
skus
;
public
String
getGoodId
()
{
return
goodId
;
public
String
getGood
s
Id
()
{
return
good
s
Id
;
}
public
void
setGood
Id
(
String
good
Id
)
{
this
.
good
Id
=
good
Id
;
public
void
setGood
sId
(
String
goods
Id
)
{
this
.
good
sId
=
goods
Id
;
}
public
String
getName
()
{
...
...
@@ -65,12 +65,12 @@ public class GoodsVo {
this
.
desc
=
desc
;
}
public
String
getRemark
()
{
return
remark
;
public
String
getRemark
s
()
{
return
remark
s
;
}
public
void
setRemark
(
String
remark
)
{
this
.
remark
=
remark
;
public
void
setRemark
s
(
String
remarks
)
{
this
.
remark
s
=
remarks
;
}
public
String
getTags
()
{
...
...
@@ -81,19 +81,20 @@ public class GoodsVo {
this
.
tags
=
tags
;
}
public
List
<
SpecVo
>
getSpecs
()
{
public
String
getSpecs
()
{
return
specs
;
}
public
void
setSpecs
(
List
<
SpecVo
>
specs
)
{
public
void
setSpecs
(
String
specs
)
{
this
.
specs
=
specs
;
}
private
String
discount
;
private
String
pics
;
private
String
desc
;
private
String
remark
;
private
String
remark
s
;
private
String
tags
;
private
List
<
SpecVo
>
specs
;
private
String
specs
;
}
ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/orderTaking/SkuRule.java
→
ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/orderTaking/SkuRule
Vo
.java
View file @
ff5a1f6a
...
...
@@ -2,7 +2,7 @@ package com.ruoyi.system.domain.vo.orderTaking;
import
java.io.Serializable
;
public
class
SkuRule
implements
Serializable
{
public
class
SkuRule
Vo
implements
Serializable
{
private
String
specId
;
private
String
specName
;
...
...
ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/orderTaking/SkuVo.java
View file @
ff5a1f6a
...
...
@@ -32,15 +32,27 @@ public class SkuVo implements Serializable {
this
.
price
=
price
;
}
public
List
<
SpecRuleVo
>
getRules
()
{
public
String
getRules
()
{
return
rules
;
}
public
void
setRules
(
List
<
SpecRuleVo
>
rules
)
{
public
String
getIsDefault
()
{
return
isDefault
;
}
public
void
setIsDefault
(
String
isDefault
)
{
this
.
isDefault
=
isDefault
;
}
public
void
setRules
(
String
rules
)
{
this
.
rules
=
rules
;
}
private
String
price
;
private
List
<
SpecRuleVo
>
rules
;
private
String
rules
;
/**
* 0 默认
*/
private
String
isDefault
;
}
ruoyi-system/src/main/java/com/ruoyi/system/domain/vo/orderTaking/SpecRuleVo.java
View file @
ff5a1f6a
...
...
@@ -32,4 +32,24 @@ public class SpecRuleVo implements Serializable {
}
private
String
price
;
public
String
getIsDefault
()
{
return
isDefault
;
}
public
void
setIsDefault
(
String
isDefault
)
{
this
.
isDefault
=
isDefault
;
}
public
String
getIsRecommend
()
{
return
isRecommend
;
}
public
void
setIsRecommend
(
String
isRecommend
)
{
this
.
isRecommend
=
isRecommend
;
}
private
String
isDefault
;
private
String
isRecommend
;
}
ruoyi-system/src/main/java/com/ruoyi/system/jiguang/impl/JiGuangPushServiceImpl.java
View file @
ff5a1f6a
package
com
.
ruoyi
.
system
.
jiguang
.
impl
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.system.domain.vo.PushBean
;
import
com.ruoyi.system.jiguang.JiGuangPushService
;
import
com.ruoyi.system.jiguang.MyJiGuangPushService
;
import
com.ruoyi.system.mapper.MachineMapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.core.parameters.P
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.Map
;
/**
* 推送服务
...
...
@@ -20,6 +24,8 @@ public class JiGuangPushServiceImpl implements JiGuangPushService {
private
static
final
int
max_size
=
800
;
@Autowired
private
MyJiGuangPushService
jPushService
;
@Autowired
private
MachineMapper
machineMapper
;
/**
* 推送全部, 不支持附加信息
* @return
...
...
@@ -85,4 +91,14 @@ public class JiGuangPushServiceImpl implements JiGuangPushService {
}
return
regList
.
toArray
(
new
String
[
0
]);
}
public
void
push
(
String
key
,
Map
<
String
,
String
>
map
)
{
String
s
=
machineMapper
.
selectRegister
(
key
);
if
(
StringUtils
.
isNotEmpty
(
s
)){
PushBean
pushBean
=
new
PushBean
();
pushBean
.
setExtras
(
map
);
pushAndroid
(
pushBean
,
key
);
}
}
}
ruoyi-system/src/main/java/com/ruoyi/system/mapper/MachineMapper.java
View file @
ff5a1f6a
...
...
@@ -60,4 +60,5 @@ public interface MachineMapper
public
int
deleteMachineByIds
(
String
[]
ids
);
int
unbound
(
String
id
);
String
selectRegister
(
String
id
);
}
ruoyi-system/src/main/java/com/ruoyi/system/mapper/OrderMapper.java
View file @
ff5a1f6a
...
...
@@ -3,6 +3,7 @@ package com.ruoyi.system.mapper;
import
java.math.BigDecimal
;
import
java.util.List
;
import
com.ruoyi.system.domain.Order
;
import
com.ruoyi.system.domain.vo.OrderQuery
;
import
org.apache.ibatis.annotations.Param
;
/**
...
...
@@ -64,4 +65,10 @@ public interface OrderMapper
int
selectSalesVolume
(
@Param
(
"shopId"
)
Long
shopId
,
@Param
(
"goodsId"
)
Long
goodsId
);
BigDecimal
selectSalesAmount
(
@Param
(
"shopId"
)
long
id
);
List
<
Order
>
selectByUserId
(
String
userId
);
List
<
Order
>
selectOrderByQuery
(
OrderQuery
order
);
List
<
Order
>
selectOrder
(
@Param
(
"status"
)
List
<
String
>
status
,
@Param
(
"machineId"
)
String
machineCode
);
}
ruoyi-system/src/main/java/com/ruoyi/system/service/IOrderService.java
View file @
ff5a1f6a
...
...
@@ -66,4 +66,6 @@ public interface IOrderService
public
int
deleteOrderById
(
String
id
);
AjaxResult
check
(
Order
order
);
List
<
Order
>
getMyOrder
(
String
openId
);
}
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/AppServiceImpl.java
View file @
ff5a1f6a
...
...
@@ -2,6 +2,7 @@ package com.ruoyi.system.service.impl;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.system.domain.Shop
;
import
com.ruoyi.system.mapper.ShopMapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -17,7 +18,15 @@ public class AppServiceImpl {
@Autowired
private
ShopMapper
shopMapper
;
public
List
<
Shop
>
getShop
(
String
lng
,
String
lat
)
{
if
(
StringUtils
.
isNotEmpty
(
lng
)||
StringUtils
.
isNotEmpty
(
lat
)){
Shop
shop
=
new
Shop
();
shop
.
setState
(
"1"
);
shop
.
setIsDefault
(
0L
);
shop
.
setIsDefault
(
1
);
List
<
Shop
>
shops
=
shopMapper
.
selectShopList
(
shop
);
return
shops
;
}
Shop
shop
=
new
Shop
();
shop
.
setState
(
"1"
);
shop
.
setIsDefault
(
0L
);
...
...
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/GoodsServiceImpl.java
View file @
ff5a1f6a
...
...
@@ -115,6 +115,7 @@ public class GoodsServiceImpl implements IGoodsService
ruleNodeList
.
add
(
ruleNode
);
}
}
else
{
ruleNodeList
.
clear
();
for
(
RuleNode
<
SpecRule
>
ruleNode
:
ruleNodes
)
{
putRuleNodeChild
(
ruleNode
,
specRules
,
ruleNodeList
);
}
...
...
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/OrderServiceImpl.java
View file @
ff5a1f6a
...
...
@@ -3,7 +3,9 @@ package com.ruoyi.system.service.impl;
import
java.text.SimpleDateFormat
;
import
java.util.*
;
import
java.util.concurrent.TimeUnit
;
import
java.util.stream.Collectors
;
import
com.alibaba.fastjson.JSONObject
;
import
com.ruoyi.common.constant.HttpStatus
;
import
com.ruoyi.common.core.domain.AjaxResult
;
import
com.ruoyi.common.core.domain.model.LoginUser
;
...
...
@@ -12,6 +14,8 @@ import com.ruoyi.common.utils.spring.SpringUtils;
import
com.ruoyi.system.domain.OrderDetail
;
import
com.ruoyi.system.domain.ShopGoodsSku
;
import
com.ruoyi.system.domain.vo.OrderQuery
;
import
com.ruoyi.system.mapper.GoodsMapper
;
import
com.ruoyi.system.mapper.OrderDetailMapper
;
import
com.ruoyi.system.mapper.ShopGoodsSkuMapper
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
...
...
@@ -35,6 +39,10 @@ public class OrderServiceImpl implements IOrderService
private
OrderMapper
orderMapper
;
@Autowired
private
ShopGoodsSkuMapper
shopGoodsSkuMapper
;
@Autowired
private
OrderDetailMapper
orderDetailMapper
;
@Autowired
private
GoodsMapper
goodsMapper
;
...
...
@@ -47,7 +55,14 @@ public class OrderServiceImpl implements IOrderService
@Override
public
Order
selectOrderById
(
String
id
)
{
return
orderMapper
.
selectOrderById
(
id
);
Order
order
=
orderMapper
.
selectOrderById
(
id
);
OrderDetail
orderDetail
=
new
OrderDetail
();
orderDetail
.
setOrderId
(
order
.
getId
());
List
<
OrderDetail
>
orderDetails
=
orderDetailMapper
.
selectOrderDetailList
(
orderDetail
);
for
(
OrderDetail
detail
:
orderDetails
)
{
detail
.
setGoods
(
goodsMapper
.
selectGoodsById
(
detail
.
getGoodsId
()));
}
return
order
;
}
/**
...
...
@@ -59,7 +74,7 @@ public class OrderServiceImpl implements IOrderService
@Override
public
List
<
Order
>
selectOrderList
(
OrderQuery
order
)
{
return
null
;
return
orderMapper
.
selectOrderByQuery
(
order
)
;
}
/**
...
...
@@ -156,6 +171,20 @@ public class OrderServiceImpl implements IOrderService
return
AjaxResult
.
success
();
}
@Override
public
List
<
Order
>
getMyOrder
(
String
openId
)
{
List
<
Order
>
orders
=
orderMapper
.
selectByUserId
(
openId
);
for
(
Order
order
:
orders
)
{
OrderDetail
orderDetail
=
new
OrderDetail
();
orderDetail
.
setOrderId
(
order
.
getId
());
List
<
OrderDetail
>
orderDetails
=
orderDetailMapper
.
selectOrderDetailList
(
orderDetail
);
for
(
OrderDetail
detail
:
orderDetails
)
{
detail
.
setGoods
(
goodsMapper
.
selectGoodsById
(
detail
.
getGoodsId
()));
}
}
return
orders
;
}
/**
* 获取机器顺序号
* @param shopId
...
...
@@ -196,4 +225,28 @@ public class OrderServiceImpl implements IOrderService
int
randomNumber
=
new
Random
().
nextInt
(
99
);
return
"N"
+
format
+
channel
+
format1
+
randomNumber
;
}
public
List
<
JSONObject
>
getOrderInfo
(
String
machineCode
)
{
List
<
String
>
status
=
Arrays
.
asList
(
"3"
,
"4"
,
"5"
);
List
<
Order
>
orders
=
orderMapper
.
selectOrder
(
status
,
machineCode
);
Map
<
String
,
List
<
Order
>>
collect
=
orders
.
stream
().
collect
(
Collectors
.
groupingBy
(
Order:
:
getState
));
List
<
JSONObject
>
objects
=
new
ArrayList
<>();
for
(
String
key:
collect
.
keySet
()){
JSONObject
jsonObject
=
new
JSONObject
();
objects
.
add
(
jsonObject
);
jsonObject
.
put
(
"state"
,
key
);
List
<
Order
>
orders1
=
collect
.
get
(
key
);
List
<
JSONObject
>
jsonObjects
=
new
ArrayList
<>();
jsonObject
.
put
(
"orders"
,
jsonObjects
);
for
(
Order
order
:
orders1
)
{
JSONObject
jsonObject1
=
new
JSONObject
();
jsonObjects
.
add
(
jsonObject1
);
jsonObject1
.
put
(
"orderId"
,
order
.
getId
());
jsonObject1
.
put
(
"orderNum"
,
order
.
getOrderNum
());
jsonObject1
.
put
(
"orderNo"
,
order
.
getOrderNo
());
}
}
return
objects
;
}
}
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/OrderTakingServiceImpl.java
View file @
ff5a1f6a
package
com
.
ruoyi
.
system
.
service
.
impl
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.ruoyi.common.exception.ServiceException
;
import
com.ruoyi.common.utils.PageUtils
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.system.domain.*
;
import
com.ruoyi.system.domain.vo.orderTaking.*
;
import
com.ruoyi.system.mapper.*
;
...
...
@@ -67,6 +69,7 @@ public class OrderTakingServiceImpl {
orderTakingVo
.
setTips
(
sysConfigService
.
selectConfigByKey
(
"tips.address"
));
List
<
CategoryVo
>
categoryVos
=
new
ArrayList
<>();
CategoryVo
preferentialCategoryVo
=
new
CategoryVo
();
categoryVos
.
add
(
preferentialCategoryVo
);
preferentialCategoryVo
.
setId
(
0L
);
preferentialCategoryVo
.
setName
(
"今日特惠"
);
//查询出该店铺今日特惠的商品
...
...
@@ -75,12 +78,14 @@ public class OrderTakingServiceImpl {
for
(
GoodsVo
goodsVo
:
goodsVos
)
{
GoodsTag
goodsTag
=
new
GoodsTag
();
goodsTag
.
setState
(
"1"
);
goodsTag
.
setGoodsId
(
Long
.
parseLong
(
goodsVo
.
getGoodId
()));
goodsVo
.
setSpecs
(
buildGoodsSpec
(
goodsVo
.
getSpecs
()));
goodsTag
.
setGoodsId
(
Long
.
parseLong
(
goodsVo
.
getGoodsId
()));
List
<
GoodsTag
>
goodsTags
=
goodsTagMapper
.
selectGoodsTagList
(
goodsTag
);
String
tags
=
JSONArray
.
toJSONString
(
goodsTags
.
stream
().
map
(
GoodsTag:
:
getTag
).
collect
(
Collectors
.
toList
()));
goodsVo
.
setTags
(
tags
);
//获取产品信息
List
<
SkuVo
>
skuVos
=
shopGoodsSkuMapper
.
selectSkuByGoodAndShop
(
shopId
,
goodsVo
.
getGoodId
());
List
<
SkuVo
>
skuVos
=
shopGoodsSkuMapper
.
selectSkuByGoodAndShop
(
shopId
,
goodsVo
.
getGoodsId
());
buildSkuRules
(
skuVos
);
goodsVo
.
setSkus
(
skuVos
);
}
//普通分类的产品
...
...
@@ -91,25 +96,30 @@ public class OrderTakingServiceImpl {
categoryVo
.
setId
(
Long
.
parseLong
(
category
.
getId
()));
categoryVo
.
setName
(
category
.
getName
());
List
<
Goods
>
goodsList
=
shopGoodsMapper
.
selectShopCategoryGoodsByCategoryId
(
shopId
,
category
.
getId
());
List
<
GoodsVo
>
goodsVoList
=
new
ArrayList
<>();
categoryVo
.
setGoods
(
goodsVoList
);
for
(
Goods
good
:
goodsList
)
{
GoodsVo
goodsVo
=
new
GoodsVo
();
goodsVo
.
setGoodId
(
String
.
valueOf
(
good
.
getId
()));
goodsVo
.
setGood
s
Id
(
String
.
valueOf
(
good
.
getId
()));
goodsVo
.
setName
(
good
.
getName
());
goodsVo
.
setDesc
(
good
.
getDesc
());
goodsVo
.
setDiscount
(
good
.
getDiscount
().
stripTrailingZeros
().
toString
());
goodsVo
.
setPrice
(
good
.
getPrice
().
stripTrailingZeros
().
toString
());
goodsVo
.
setDiscount
(
good
.
getDiscount
().
stripTrailingZeros
().
to
Plain
String
());
goodsVo
.
setPrice
(
good
.
getPrice
().
stripTrailingZeros
().
to
Plain
String
());
goodsVo
.
setPics
(
good
.
getPics
());
goodsVo
.
setRemark
(
good
.
getRemark
());
goodsVo
.
setSpecs
(
JSONArray
.
parseArray
(
good
.
getSpec
(),
SpecVo
.
class
));
goodsVo
.
setRemarks
(
good
.
getRemarks
());
goodsVo
.
setSpecs
(
good
.
getSpec
());
goodsVo
.
setSpecs
(
buildGoodsSpec
(
goodsVo
.
getSpecs
()));
GoodsTag
goodsTag
=
new
GoodsTag
();
goodsTag
.
setState
(
"1"
);
goodsTag
.
setGoodsId
(
Long
.
parseLong
(
goodsVo
.
getGoodId
()));
goodsTag
.
setGoodsId
(
Long
.
parseLong
(
goodsVo
.
getGood
s
Id
()));
List
<
GoodsTag
>
goodsTags
=
goodsTagMapper
.
selectGoodsTagList
(
goodsTag
);
String
tags
=
JSONArray
.
toJSONString
(
goodsTags
.
stream
().
map
(
GoodsTag:
:
getTag
).
collect
(
Collectors
.
toList
()));
goodsVo
.
setTags
(
tags
);
//获取产品信息
List
<
SkuVo
>
skuVos
=
shopGoodsSkuMapper
.
selectSkuByGoodAndShop
(
shopId
,
goodsVo
.
getGoodId
());
List
<
SkuVo
>
skuVos
=
shopGoodsSkuMapper
.
selectSkuByGoodAndShop
(
shopId
,
goodsVo
.
getGoodsId
());
buildSkuRules
(
skuVos
);
goodsVo
.
setSkus
(
skuVos
);
goodsVoList
.
add
(
goodsVo
);
}
categoryVos
.
add
(
categoryVo
);
}
...
...
@@ -120,28 +130,82 @@ public class OrderTakingServiceImpl {
recommendVos
.
add
(
recommendVo
);
ShopRecommend
shopRecommend
=
new
ShopRecommend
();
shopRecommend
.
setShopId
(
String
.
valueOf
(
shopId
));
shopRecommend
.
setGoodsId
(
goodsVo
.
getGoodId
());
shopRecommend
.
setGoodsId
(
goodsVo
.
getGood
s
Id
());
shopRecommend
.
setType
(
"1"
);
ShopRecommend
shopRecommend1
=
shopRecommendMapper
.
selectShopRecommendList
(
shopRecommend
).
get
(
0
);
recommendVo
.
setDesc
(
shopRecommend1
.
getDesc
());
recommendVo
.
setGoodsName
(
shopRecommend1
.
getGoodsName
());
recommendVo
.
setPic
(
shopRecommend1
.
getPic
());
recommendVo
.
setGoods
(
recommendGoods
);
goodsVo
.
setSpecs
(
buildGoodsSpec
(
goodsVo
.
getSpecs
()));
GoodsTag
goodsTag
=
new
GoodsTag
();
goodsTag
.
setState
(
"1"
);
goodsTag
.
setGoodsId
(
Long
.
parseLong
(
goodsVo
.
getGoodId
()));
goodsTag
.
setGoodsId
(
Long
.
parseLong
(
goodsVo
.
getGood
s
Id
()));
List
<
GoodsTag
>
goodsTags
=
goodsTagMapper
.
selectGoodsTagList
(
goodsTag
);
String
tags
=
JSONArray
.
toJSONString
(
goodsTags
.
stream
().
map
(
GoodsTag:
:
getTag
).
collect
(
Collectors
.
toList
()));
goodsVo
.
setTags
(
tags
);
//获取产品信息
List
<
SkuVo
>
skuVos
=
shopGoodsSkuMapper
.
selectSkuByGoodAndShop
(
shopId
,
goodsVo
.
getGoodId
());
List
<
SkuVo
>
skuVos
=
shopGoodsSkuMapper
.
selectSkuByGoodAndShop
(
shopId
,
goodsVo
.
getGoodsId
());
buildSkuRules
(
skuVos
);
goodsVo
.
setSkus
(
skuVos
);
}
orderTakingVo
.
setRecommends
(
recommendVos
);
orderTakingVo
.
setCategorys
(
categoryVos
);
return
orderTakingVo
;
}
private
void
buildSkuRules
(
List
<
SkuVo
>
skuVos
)
{
for
(
SkuVo
skuVo
:
skuVos
)
{
String
rules
=
skuVo
.
getRules
();
List
<
SpecRule
>
specRuleList
=
JSONObject
.
parseArray
(
rules
,
SpecRule
.
class
);
boolean
boo
=
true
;
List
<
SkuRuleVo
>
skuRuleVos
=
new
ArrayList
<>();
for
(
SpecRule
specRule
:
specRuleList
)
{
SkuRuleVo
skuRuleVo
=
new
SkuRuleVo
();
skuRuleVos
.
add
(
skuRuleVo
);
skuRuleVo
.
setPrice
(
specRule
.
getAmount
().
stripTrailingZeros
().
toPlainString
());
skuRuleVo
.
setRuleId
(
String
.
valueOf
(
specRule
.
getId
()));
skuRuleVo
.
setSpecId
(
String
.
valueOf
(
specRule
.
getSpecId
()));
if
(
0L
==
specRule
.
getIsDefault
()){
boo
=
false
;
}
}
skuVo
.
setIsDefault
(
"0"
);
if
(
boo
){
skuVo
.
setIsDefault
(
"1"
);
}
skuVo
.
setRules
(
JSONObject
.
toJSONString
(
skuRuleVos
));
}
}
private
String
buildGoodsSpec
(
String
specs
)
{
List
<
Spec
>
specList
=
JSONObject
.
parseArray
(
specs
,
Spec
.
class
);
List
<
SpecVo
>
specVos
=
new
ArrayList
<>();
for
(
Spec
spec
:
specList
)
{
SpecVo
specVo
=
new
SpecVo
();
specVos
.
add
(
specVo
);
specVo
.
setSpecId
(
String
.
valueOf
(
spec
.
getId
()));
specVo
.
setSpecName
(
spec
.
getName
());
List
<
SpecRuleVo
>
specRuleVos
=
new
ArrayList
<>();
specVo
.
setRules
(
specRuleVos
);
for
(
SpecRule
specRule
:
spec
.
getSpecRules
())
{
SpecRuleVo
specRuleVo
=
new
SpecRuleVo
();
specRuleVos
.
add
(
specRuleVo
);
specRuleVo
.
setRuleId
(
String
.
valueOf
(
specRule
.
getId
()));
specRuleVo
.
setPrice
(
specRule
.
getAmount
().
stripTrailingZeros
().
toPlainString
());
specRuleVo
.
setRuleName
(
specRule
.
getName
());
specRuleVo
.
setIsDefault
(
String
.
valueOf
(
specRule
.
getIsDefault
()));
specRuleVo
.
setIsRecommend
(
specRule
.
getIsRecommend
());
}
}
return
JSONObject
.
toJSONString
(
specVos
);
}
/**
* 机器点单屏信息
* {
...
...
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/ShopRecommendServiceImpl.java
View file @
ff5a1f6a
...
...
@@ -2,6 +2,7 @@ package com.ruoyi.system.service.impl;
import
java.util.Date
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
com.ruoyi.common.exception.ServiceException
;
import
com.ruoyi.system.domain.Goods
;
...
...
@@ -52,6 +53,7 @@ public class ShopRecommendServiceImpl implements IShopRecommendService
public
List
<
Goods
>
selectShopRecommendList
(
ShopRecommend
shopRecommend
)
{
List
<
Goods
>
goodsList
=
shopRecommendMapper
.
selectShopRecommendGoods
(
shopRecommend
.
getShopId
(),
shopRecommend
.
getType
());
goodsList
=
goodsList
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
for
(
Goods
goods
:
goodsList
)
{
goods
.
setSalesVolume
(
orderMapper
.
selectSalesVolume
(
Long
.
parseLong
(
shopRecommend
.
getShopId
()),
goods
.
getId
()));
}
...
...
ruoyi-system/src/main/resources/mapper/system/CustomerMapper.xml
View file @
ff5a1f6a
...
...
@@ -27,7 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</where>
</select>
<select
id=
"selectCustomerById"
parameterType=
"Long"
resultMap=
"CustomerResult"
>
<select
id=
"selectCustomerById"
resultMap=
"CustomerResult"
>
<include
refid=
"selectCustomerVo"
/>
where id = #{id}
</select>
...
...
@@ -35,6 +35,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert
id=
"insertCustomer"
parameterType=
"Customer"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into customer
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
id,
</if>
<if
test=
"userName != null"
>
user_name,
</if>
<if
test=
"phone != null"
>
phone,
</if>
<if
test=
"createTime != null"
>
create_time,
</if>
...
...
@@ -42,6 +43,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"soucre != null"
>
soucre,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
#{id},
</if>
<if
test=
"userName != null"
>
#{userName},
</if>
<if
test=
"phone != null"
>
#{phone},
</if>
<if
test=
"createTime != null"
>
#{createTime},
</if>
...
...
ruoyi-system/src/main/resources/mapper/system/GoodsCategoryMapper.xml
View file @
ff5a1f6a
...
...
@@ -92,7 +92,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<select
id=
"selectByShopId"
resultMap=
"GoodsCategoryResult"
>
select DISTINCT gc.* from goods_category gc ,goods g ,
shop_goods sg where g
c.id =g.id and g.id =sg.goods_
id
shop_goods sg where g
.id =sg.goods_id and g.category =gc.
id
and sg.shop_id =#{shopId}
order by gc.turn
</select>
...
...
ruoyi-system/src/main/resources/mapper/system/MachineMapper.xml
View file @
ff5a1f6a
...
...
@@ -40,6 +40,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<insert
id=
"insertMachine"
parameterType=
"Machine"
useGeneratedKeys=
"true"
keyProperty=
"id"
>
insert into machine
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null and id != ''"
>
id,
</if>
<if
test=
"shopId != null and shopId != ''"
>
shop_id,
</if>
<if
test=
"code != null and code != ''"
>
code,
</if>
<if
test=
"type != null and type != ''"
>
type,
</if>
...
...
@@ -49,6 +50,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"updatedAt != null"
>
updated_at,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null and id != ''"
>
#{id},
</if>
<if
test=
"shopId != null and shopId != ''"
>
#{shopId},
</if>
<if
test=
"code != null and code != ''"
>
#{code},
</if>
<if
test=
"type != null and type != ''"
>
#{type},
</if>
...
...
@@ -69,6 +71,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"bindTime != null"
>
bind_time = #{bindTime},
</if>
<if
test=
"createdAt != null"
>
created_at = #{createdAt},
</if>
<if
test=
"updatedAt != null"
>
updated_at = #{updatedAt},
</if>
<if
test=
"register != null"
>
register = #{register},
</if>
</trim>
where id = #{id}
</update>
...
...
@@ -86,4 +89,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<update
id=
"unbound"
>
update machine set shopId =null where id =#{id}
</update>
<select
id=
"selectRegister"
resultType=
"string"
>
select register from machine where id =#{id}
</select>
</mapper>
\ No newline at end of file
ruoyi-system/src/main/resources/mapper/system/OrderMapper.xml
View file @
ff5a1f6a
...
...
@@ -26,7 +26,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql
id=
"selectOrderVo"
>
select id, order_no, order_num, user_id, user_name, user_phone, pay_time, finish_time, amount, goods_num, pick_code, shop_id, machine_id, source, state, created_at, updated_at,shelf_at from
order
select id, order_no, order_num, user_id, user_name, user_phone, pay_time, finish_time, amount, goods_num, pick_code, shop_id, machine_id, source, state, created_at, updated_at,shelf_at from
`order`
</sql>
<select
id=
"selectOrderList"
parameterType=
"Order"
resultMap=
"OrderResult"
>
...
...
@@ -161,4 +161,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and or2.state !='2'
and shop_id =#{shopId}
</select>
<select
id=
"selectByUserId"
resultMap=
"OrderResult"
>
<include
refid=
"selectOrderVo"
/>
where
user_id =#{user_id} order by created_at desc
</select>
<select
id=
"selectOrderByQuery"
resultMap=
"OrderResult"
>
<include
refid=
"selectOrderVo"
/>
<where>
<if
test=
"orderNo!=null "
>
and order_no =#{orderNo}
</if>
</where>
</select>
<select
id=
"selectOrder"
resultMap=
"OrderResult"
>
<include
refid=
"selectOrderVo"
/>
<where>
state in
<foreach
item=
"item"
index=
"index"
collection=
"status"
open=
"("
separator=
","
close=
")"
>
#{item}
</foreach>
and machine_id = #{machineId}
</where>
</select>
</mapper>
\ No newline at end of file
ruoyi-system/src/main/resources/mapper/system/ShopGoodsSkuMapper.xml
View file @
ff5a1f6a
...
...
@@ -102,13 +102,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
gs.price as price,
gs.rule_list as rules
from
shop_goods_sku s
gs ,
goods_sku
gs
goods_sku
gs ,
shop_goods_sku s
gs
where
sgs.shop_id = #{shopId}
and sgs.goods_id = #{goodsId}
and sgs.goods_id = gs.goods_id
gs.id = sgs.sku_id
and gs.is_deleted = '0'
and sgs.goods_id =#{goodsId}
and sgs.shop_id =#{shopId}
</select>
<update
id=
"updateSkuStatus"
>
update shop_goods_sku set state =#{status}
...
...
ruoyi-system/src/main/resources/mapper/system/ShopRecommendMapper.xml
View file @
ff5a1f6a
...
...
@@ -21,7 +21,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</resultMap>
<sql
id=
"selectShopRecommendVo"
>
select id, shop_id, machine_id, goods_id, goods_name, pic, turn,
desc
, type, state, rec_date, created_at, updated_at from shop_recommend
select id, shop_id, machine_id, goods_id, goods_name, pic, turn,
`desc`
, type, state, rec_date, created_at, updated_at from shop_recommend
</sql>
<select
id=
"selectShopRecommendList"
parameterType=
"ShopRecommend"
resultMap=
"ShopRecommendResult"
>
...
...
@@ -33,7 +33,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"goodsName != null and goodsName != ''"
>
and goods_name like concat('%', #{goodsName}, '%')
</if>
<if
test=
"pic != null and pic != ''"
>
and pic = #{pic}
</if>
<if
test=
"turn != null and turn != ''"
>
and turn = #{turn}
</if>
<if
test=
"desc != null and desc != ''"
>
and
desc
= #{desc}
</if>
<if
test=
"desc != null and desc != ''"
>
and
`desc`
= #{desc}
</if>
<if
test=
"type != null and type != ''"
>
and type = #{type}
</if>
<if
test=
"state != null and state != ''"
>
and state = #{state}
</if>
<if
test=
"recDate != null "
>
and rec_date = #{recDate}
</if>
...
...
@@ -56,7 +56,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"goodsName != null and goodsName != ''"
>
goods_name,
</if>
<if
test=
"pic != null and pic != ''"
>
pic,
</if>
<if
test=
"turn != null and turn != ''"
>
turn,
</if>
<if
test=
"desc != null and desc != ''"
>
desc
,
</if>
<if
test=
"desc != null and desc != ''"
>
`desc`
,
</if>
<if
test=
"type != null and type != ''"
>
type,
</if>
<if
test=
"state != null and state != ''"
>
state,
</if>
<if
test=
"recDate != null"
>
rec_date,
</if>
...
...
@@ -88,7 +88,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"goodsName != null and goodsName != ''"
>
goods_name = #{goodsName},
</if>
<if
test=
"pic != null and pic != ''"
>
pic = #{pic},
</if>
<if
test=
"turn != null and turn != ''"
>
turn = #{turn},
</if>
<if
test=
"desc != null and desc != ''"
>
desc
= #{desc},
</if>
<if
test=
"desc != null and desc != ''"
>
`desc`
= #{desc},
</if>
<if
test=
"type != null and type != ''"
>
type = #{type},
</if>
<if
test=
"state != null and state != ''"
>
state = #{state},
</if>
<if
test=
"recDate != null"
>
rec_date = #{recDate},
</if>
...
...
@@ -110,12 +110,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
</delete>
<select
id=
"selectShopGoodsByTyepe"
resultType=
"com.ruoyi.system.domain.vo.orderTaking.GoodsVo"
>
select
g.id as goodId ,
g.id as good
s
Id ,
g.name as name,
g.price as price,
g.discount as discount,
g.pics ,
g.spec,
g.spec
as specs
,
g.`desc`,
g.remarks
from
...
...
@@ -124,7 +124,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
where
sr.goods_id = g.id
and sr.`type` = #{type}
and sr.shop_id =#{shop
_i
d}
and sr.shop_id =#{shop
I
d}
and sr.state ='1' and g.is_deleted ='0'
order by
sr.turn
...
...
@@ -153,7 +153,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
and g.is_deleted = 0
and sr.shop_id =sg.shop_id
and sr.`type` =#{type}
and sr.shop_id =#{shop
_i
d}
and sr.shop_id =#{shop
I
d}
order by
sr.turn
</select>
...
...
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