Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
G
gxpt_ht
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
pseer
gxpt_ht
Commits
b8c40ad0
Commit
b8c40ad0
authored
Feb 22, 2024
by
吕明尚
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
调试团购劵适用门店接口
parent
2804e028
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
44 additions
and
53 deletions
+44
-53
SStoreController.java
...in/java/share/web/controller/system/SStoreController.java
+10
-24
application-dev.yml
share-admin/src/main/resources/application-dev.yml
+8
-0
TiktokController.java
...in/java/share/web/controller/system/TiktokController.java
+2
-5
TiktokService.java
...tem/src/main/java/share/system/service/TiktokService.java
+2
-0
SCouponServiceImpl.java
...in/java/share/system/service/impl/SCouponServiceImpl.java
+6
-23
TiktokServiceImpl.java
...ain/java/share/system/service/impl/TiktokServiceImpl.java
+16
-1
No files found.
share-admin/src/main/java/share/web/controller/system/SStoreController.java
View file @
b8c40ad0
package
share
.
web
.
controller
.
system
;
import
java.util.List
;
import
java.util.Map
;
import
javax.servlet.http.HttpServletResponse
;
import
com.dianping.openapi.sdk.api.customerauth.session.entity.CustomerKeyShopScopeResponseEntity
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.PutMapping
;
import
org.springframework.web.bind.annotation.DeleteMapping
;
import
org.springframework.web.bind.annotation.PathVariable
;
import
org.springframework.web.bind.annotation.RequestBody
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.web.bind.annotation.*
;
import
share.common.annotation.Log
;
import
share.common.core.controller.BaseController
;
import
share.common.core.domain.AjaxResult
;
import
share.common.core.
domain.entity.SysUser
;
import
share.common.core.
page.TableDataInfo
;
import
share.common.enums.BusinessType
;
import
share.common.utils.poi.ExcelUtil
;
import
share.system.domain.SConsumer
;
import
share.system.domain.SStore
;
import
share.system.domain.SStoreConsumer
;
import
share.system.domain.SysUserRole
;
import
share.system.domain.tiktok.TiktokCouponDto
;
import
share.system.domain.tiktok.TiktokPoi
;
import
share.system.domain.vo.SConsumerVo
;
import
share.system.domain.vo.SStoreConsumerVo
;
import
share.system.service.ISStoreService
;
import
share.common.utils.poi.ExcelUtil
;
import
share.common.core.page.TableDataInfo
;
import
share.system.service.QPService
;
import
share.system.service.SConsumerService
;
import
share.system.service.TiktokService
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.List
;
/**
* 门店Controller
*
...
...
@@ -205,9 +191,9 @@ public class SStoreController extends BaseController
}
@GetMapping
(
"/poi
/q
uery"
)
public
AjaxResult
poiQuery
(
TiktokCouponDto
tiktokCouponDto
)
{
return
success
(
tiktokService
.
poi
Query
(
tiktokCouponDto
));
@GetMapping
(
"/poi
Q
uery"
)
public
AjaxResult
poiQuery
()
{
return
success
(
tiktokService
.
poi
List
(
));
}
...
...
share-admin/src/main/resources/application-dev.yml
View file @
b8c40ad0
...
...
@@ -22,6 +22,7 @@ wechat:
signKey
:
ZEKu56XCezuESfNEdM4zVZEN3cz2PuHz
certPath
:
/var/gxpt/wechat_ssl/apiclient_cert.p12
token
:
coujio
miniprogram_state
:
trial
wx
:
miniapp
:
configs
:
...
...
@@ -30,6 +31,10 @@ wx:
token
:
coujio
aesKey
:
zf8vTHbI0ZDPTkkCXHEuwh9EbtVtOn6n4vQjMb9OFrS
msgDataFormat
:
XML
tiktok
:
appId
:
awt50u5zommqxkl9
appSecret
:
c567551e0c4ce1db4f985d0233025d8d
accountId
:
7325762036464355343
#扫呗支付配置
saobei
:
key
:
15490267
...
...
@@ -219,3 +224,5 @@ order:
mqtt
:
device-op-last-time
:
-5
device-gateway-last-report-time
:
-10
api
:
domain
:
https://www.coujio.com
\ No newline at end of file
share-front/src/main/java/share/web/controller/system/TiktokController.java
View file @
b8c40ad0
...
...
@@ -5,12 +5,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.web.bind.annotation.*
;
import
share.common.core.domain.AjaxResult
;
import
share.system.domain.tiktok.TiktokCouponDto
;
import
share.system.domain.tiktok.TiktokPoi
;
import
share.system.domain.vo.OnlineQueryDto
;
import
share.system.service.TiktokService
;
import
java.util.List
;
import
static
share
.
common
.
core
.
domain
.
AjaxResult
.
success
;
@RestController
...
...
@@ -50,8 +47,8 @@ public class TiktokController {
}
@GetMapping
(
"/poi/query"
)
public
List
<
TiktokPoi
>
poiQuery
(
TiktokCouponDto
tiktokCouponDto
)
{
return
tiktokService
.
poiQuery
(
tiktokCouponDto
);
public
AjaxResult
poiQuery
(
TiktokCouponDto
tiktokCouponDto
)
{
return
success
(
tiktokService
.
poiQuery
(
tiktokCouponDto
)
);
}
//查询所有线上商品数据列表
...
...
share-system/src/main/java/share/system/service/TiktokService.java
View file @
b8c40ad0
...
...
@@ -25,4 +25,6 @@ public interface TiktokService {
JSONObject
onlineGet
(
String
productIds
,
String
accountId
);
String
consumeByUser
(
String
code
,
String
poiId
);
List
<
TiktokPoi
>
poiList
();
}
share-system/src/main/java/share/system/service/impl/SCouponServiceImpl.java
View file @
b8c40ad0
...
...
@@ -283,21 +283,18 @@ public class SCouponServiceImpl extends ServiceImpl<SCouponMapper, SCoupon> impl
List
<
SStore
>
sStores
=
storeService
.
list
();
//过滤掉没有poiId的门店
sStores
=
sStores
.
stream
().
filter
(
store
->
StringUtils
.
isNotBlank
(
store
.
getPoiId
())).
collect
(
Collectors
.
toList
());
Map
<
String
,
SCoupon
>
sCouponList
=
new
LinkedHashMap
<>();
List
<
SCoupon
>
sCouponList
=
new
ArrayList
<>();
OnlineQueryDto
onlineQueryDto
=
new
OnlineQueryDto
();
onlineQueryDto
.
setAccountId
(
ACCOUNT_Id
);
JSONObject
entries
=
tiktokService
.
onlineQuery
(
onlineQueryDto
);
JSONArray
products
=
entries
.
getJSONArray
(
"products"
);
List
<
SStore
>
finalSStores
=
sStores
;
List
<
SStore
>
finalSStores1
=
sStores
;
products
.
stream
().
forEach
(
item
->
{
JSONObject
jsonObject
=
(
JSONObject
)
item
;
if
(
jsonObject
.
getInt
(
"online_status"
).
equals
(
YesNoEnum
.
yes
.
getIndex
()))
{
JSONObject
sku
=
jsonObject
.
getJSONObject
(
"sku"
);
JSONObject
product
=
jsonObject
.
getJSONObject
(
"product"
);
JSONArray
pois
=
product
.
getJSONArray
(
"pois"
);
SCoupon
sCoupon1
=
sCouponList
.
get
(
sku
.
getStr
(
"sku_id"
));
if
(
ObjectUtils
.
isEmpty
(
sCoupon1
))
{
SCoupon
sCoupon
=
new
SCoupon
();
sCoupon
.
setSkuId
(
sku
.
getStr
(
"sku_id"
));
sCoupon
.
setName
(
sku
.
getStr
(
"sku_name"
));
...
...
@@ -313,28 +310,14 @@ public class SCouponServiceImpl extends ServiceImpl<SCouponMapper, SCoupon> impl
sCoupon
.
setMinPrice
(
new
BigDecimal
(
"0.00"
));
sCoupon
.
setCouponType
(
CouponTypeEnum
.
CASH
.
getCode
());
if
(
finalSStores
.
size
()
==
0
)
{
sCouponList
.
put
(
sku
.
getStr
(
"sku_id"
),
sCoupon
);
sCouponList
.
add
(
sCoupon
);
return
;
}
pois
.
stream
().
forEach
(
poi
->
{
JSONObject
jsonObject1
=
(
JSONObject
)
poi
;
if
(
StringUtils
.
isEmpty
(
sCoupon
.
getStoreIds
()))
{
//判断
sCoupon
.
setStoreIds
(
String
.
valueOf
(
finalSStores
.
stream
().
filter
(
store
->
jsonObject1
.
getStr
(
"poi_id"
).
equals
(
store
.
getPoiId
())).
findFirst
().
get
().
getId
()));
}
else
{
sCoupon
.
setStoreIds
(
sCoupon
.
getStoreIds
()
+
","
+
finalSStores
.
stream
().
filter
(
store
->
jsonObject1
.
getStr
(
"poi_id"
).
equals
(
store
.
getPoiId
())).
findFirst
().
get
().
getId
());
Set
<
String
>
poiIds
=
pois
.
stream
().
map
(
poi
->
((
JSONObject
)
poi
).
getStr
(
"poi_id"
)).
collect
(
Collectors
.
toSet
());
sCoupon
.
setStoreIds
(
String
.
valueOf
(
finalSStores
.
stream
().
filter
(
store
->
poiIds
.
contains
(
store
.
getPoiId
())).
map
(
SStore:
:
getId
).
collect
(
Collectors
.
toList
())).
replace
(
"["
,
""
).
replace
(
"]"
,
""
).
replace
(
" "
,
""
).
trim
());
sCouponList
.
add
(
sCoupon
);
}
});
sCouponList
.
put
(
sku
.
getStr
(
"sku_id"
),
sCoupon
);
}
else
{
pois
.
stream
().
forEach
(
poi
->
{
JSONObject
jsonObject1
=
(
JSONObject
)
poi
;
sCoupon1
.
setStoreIds
(
sCoupon1
.
getStoreIds
()
+
","
+
finalSStores1
.
stream
().
filter
(
store
->
store
.
getPoiId
().
equals
(
jsonObject1
.
getStr
(
"poi_id"
))).
findFirst
().
get
().
getId
());
});
}
}
});
return
new
ArrayList
<>(
sCouponList
.
values
());
return
sCouponList
;
}
}
share-system/src/main/java/share/system/service/impl/TiktokServiceImpl.java
View file @
b8c40ad0
...
...
@@ -132,7 +132,7 @@ public class TiktokServiceImpl implements TiktokService {
String
expiresTime
=
DateUtil
.
format
(
date
,
DatePattern
.
NORM_DATETIME_PATTERN
);
map
.
put
(
"expiresTime"
,
expiresTime
);
JSONObject
jsonObject
=
new
JSONObject
(
map
);
redisUtil
.
set
(
ReceiptRdeisEnum
.
TIKTOK_CLIENT_TOKEN
.
getValue
(),
jsonObject
.
toString
(),
6
4
00L
,
TimeUnit
.
SECONDS
);
redisUtil
.
set
(
ReceiptRdeisEnum
.
TIKTOK_CLIENT_TOKEN
.
getValue
(),
jsonObject
.
toString
(),
6
6
00L
,
TimeUnit
.
SECONDS
);
redisUtil
.
set
(
ReceiptRdeisEnum
.
TIKTOK_CLIENT_TOKEN_KEY
.
getValue
(),
jsonObject
.
toString
());
}
...
...
@@ -406,6 +406,21 @@ public class TiktokServiceImpl implements TiktokService {
return
"验卷成功"
;
}
@Override
public
List
<
TiktokPoi
>
poiList
()
{
List
<
TiktokPoi
>
tiktokPois
=
poiQuery
(
new
TiktokCouponDto
());
List
<
SStore
>
list
=
storeService
.
list
();
//过滤以增加的门店 根据poiId
List
<
TiktokPoi
>
collect
=
tiktokPois
.
stream
().
filter
(
o1
->
{
Optional
<
SStore
>
first
=
list
.
stream
().
filter
(
o2
->
o1
.
getPoiId
().
equals
(
o2
.
getPoiId
())).
findFirst
();
if
(
first
.
isPresent
())
{
return
false
;
}
return
true
;
}).
collect
(
java
.
util
.
stream
.
Collectors
.
toList
());
return
collect
;
}
public
String
obtain
()
{
String
o
;
o
=
redisUtil
.
get
(
ReceiptRdeisEnum
.
TIKTOK_CLIENT_TOKEN
.
getValue
());
...
...
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