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
90d99a2b
Commit
90d99a2b
authored
May 18, 2023
by
weijiguang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix coupon bug
parent
c356a5a0
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
25 additions
and
0 deletions
+25
-0
soss-admin/src/main/java/com/soss/web/controller/coffee/ApplicationController.java
+25
-0
No files found.
soss-admin/src/main/java/com/soss/web/controller/coffee/ApplicationController.java
View file @
90d99a2b
package
com
.
soss
.
web
.
controller
.
coffee
;
package
com
.
soss
.
web
.
controller
.
coffee
;
import
com.alibaba.fastjson.JSONArray
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.soss.common.core.domain.AjaxResult
;
import
com.soss.common.core.domain.AjaxResult
;
import
com.soss.common.exception.ServiceException
;
import
com.soss.common.exception.ServiceException
;
import
com.soss.common.utils.StringUtils
;
import
com.soss.common.utils.StringUtils
;
import
com.soss.system.domain.Machine
;
import
com.soss.system.domain.Machine
;
import
com.soss.system.domain.Shop
;
import
com.soss.system.domain.Shop
;
import
com.soss.system.domain.vo.orderTaking.SkuVo
;
import
com.soss.system.jiguang.impl.JiGuangPushServiceImpl
;
import
com.soss.system.jiguang.impl.JiGuangPushServiceImpl
;
import
com.soss.system.mapper.ShopGoodsSkuMapper
;
import
com.soss.system.service.ICustomerService
;
import
com.soss.system.service.ICustomerService
;
import
com.soss.system.service.impl.MachineServiceImpl
;
import
com.soss.system.service.impl.MachineServiceImpl
;
import
com.soss.system.service.impl.OrderServiceImpl
;
import
com.soss.system.service.impl.OrderServiceImpl
;
...
@@ -17,8 +20,10 @@ import io.jsonwebtoken.lang.Assert;
...
@@ -17,8 +20,10 @@ import io.jsonwebtoken.lang.Assert;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.data.redis.core.StringRedisTemplate
;
import
org.springframework.util.CollectionUtils
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
import
java.util.concurrent.TimeUnit
;
import
java.util.concurrent.TimeUnit
;
@RestController
@RestController
...
@@ -39,6 +44,8 @@ public class ApplicationController {
...
@@ -39,6 +44,8 @@ public class ApplicationController {
OrderServiceImpl
orderService
;
OrderServiceImpl
orderService
;
@Autowired
@Autowired
private
ICustomerService
customerService
;
private
ICustomerService
customerService
;
@Autowired
private
ShopGoodsSkuMapper
shopGoodsSkuMapper
;
@PostMapping
(
"/saveData"
)
@PostMapping
(
"/saveData"
)
public
AjaxResult
saveApplicationData
(
@RequestBody
String
body
)
{
public
AjaxResult
saveApplicationData
(
@RequestBody
String
body
)
{
...
@@ -82,6 +89,24 @@ public class ApplicationController {
...
@@ -82,6 +89,24 @@ public class ApplicationController {
shop
.
setDistance
(
"-1"
);
shop
.
setDistance
(
"-1"
);
}
}
redisJson
.
put
(
"shop"
,
shop
);
redisJson
.
put
(
"shop"
,
shop
);
JSONArray
goodsList
=
redisJson
.
getJSONArray
(
"goods"
);
if
(!
CollectionUtils
.
isEmpty
(
goodsList
))
{
for
(
int
i
=
0
;
i
<
goodsList
.
size
();
i
++)
{
JSONObject
goods
=
goodsList
.
getJSONObject
(
i
);
JSONObject
sku
=
goods
.
getJSONObject
(
"sku"
);
List
<
SkuVo
>
skuList
=
shopGoodsSkuMapper
.
selectSkuByGoodAndShop
(
shop
.
getId
(),
goods
.
getString
(
"goodsId"
));
if
(
CollectionUtils
.
isEmpty
(
skuList
))
{
continue
;
}
skuList
.
forEach
(
skuVo
->
{
if
(
skuVo
.
getSkuId
().
toString
().
equals
(
sku
.
getString
(
"skuId"
)))
{
sku
.
put
(
"origDiscount"
,
skuVo
.
getOrigDiscount
());
}
});
}
}
//推送数据给安卓
//推送数据给安卓
JSONObject
jgBody
=
new
JSONObject
();
JSONObject
jgBody
=
new
JSONObject
();
jgBody
.
put
(
"action"
,
"QRCODE_VISITED"
);
jgBody
.
put
(
"action"
,
"QRCODE_VISITED"
);
...
...
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