Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
C
cloud-platform
Project
Project
Details
Activity
Releases
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
youjj
cloud-platform
Commits
48af7a15
Commit
48af7a15
authored
Jul 08, 2019
by
hanfeng
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'base-modify' of
http://10.5.52.3/youjj/cloud-platform
into base-modify
parents
90d3fdf6
de5c5669
Changes
21
Show whitespace changes
Inline
Side-by-side
Showing
21 changed files
with
406 additions
and
170 deletions
+406
-170
systemconfig.properties
...mon/src/main/resources/properties/systemconfig.properties
+1
-2
BaseUserMemberExportDTO.java
...b/wxiaoqi/security/admin/dto/BaseUserMemberExportDTO.java
+34
-0
BaseUserMemberExport.java
...b/wxiaoqi/security/admin/entity/BaseUserMemberExport.java
+38
-0
AppUserLoginBiz.java
...om/github/wxiaoqi/security/admin/biz/AppUserLoginBiz.java
+30
-23
BaseUserMemberBiz.java
.../github/wxiaoqi/security/admin/biz/BaseUserMemberBiz.java
+2
-0
BaseUserMemberExportBiz.java
...b/wxiaoqi/security/admin/biz/BaseUserMemberExportBiz.java
+93
-0
UserMemberLevelBiz.java
...github/wxiaoqi/security/admin/biz/UserMemberLevelBiz.java
+13
-1
AppUserLoginMapper.java
...hub/wxiaoqi/security/admin/mapper/AppUserLoginMapper.java
+4
-0
BaseUserMemberExportMapper.java
...oqi/security/admin/mapper/BaseUserMemberExportMapper.java
+15
-0
BaseUserMemberLevelMapper.java
...aoqi/security/admin/mapper/BaseUserMemberLevelMapper.java
+6
-1
AppUserController.java
...github/wxiaoqi/security/admin/rest/AppUserController.java
+2
-0
BaseUserMemberExportController.java
...i/security/admin/rest/BaseUserMemberExportController.java
+10
-0
UserMemberController.java
...hub/wxiaoqi/security/admin/rest/UserMemberController.java
+32
-7
AppUserLoginMapper.xml
...ce-admin/src/main/resources/mapper/AppUserLoginMapper.xml
+11
-0
BaseUserMemberExportMapper.xml
.../src/main/resources/mapper/BaseUserMemberExportMapper.xml
+14
-0
BaseUserMemberLevelMapper.xml
...n/src/main/resources/mapper/BaseUserMemberLevelMapper.xml
+11
-0
CampsiteShopBiz.java
.../java/com/xxfc/platform/campsite/biz/CampsiteShopBiz.java
+74
-128
CampsiteShopAdminController.java
...form/campsite/rest/admin/CampsiteShopAdminController.java
+4
-3
WXPay.java
...in/java/com/xxfc/platform/universal/weixin/api/WXPay.java
+1
-1
WXPrepay.java
...java/com/xxfc/platform/universal/weixin/api/WXPrepay.java
+1
-1
OrderPayBiz.java
...ain/java/com/xxfc/platform/universal/biz/OrderPayBiz.java
+10
-3
No files found.
ace-common/src/main/resources/properties/systemconfig.properties
View file @
48af7a15
...
@@ -18,8 +18,7 @@ ACCESSKEYSECRET=OCKDEiwKGjePCZgPeWMEUFGwGbKYLA
...
@@ -18,8 +18,7 @@ ACCESSKEYSECRET=OCKDEiwKGjePCZgPeWMEUFGwGbKYLA
TEMPLATECODE
=
SMS_170070101
TEMPLATECODE
=
SMS_170070101
SIGNNAME
=
滴房车
SIGNNAME
=
滴房车
#微信支付配置
#微信支付配置
WINXIN_AppID
=
wxcc2c9b7c87439a6d
WINXIN_AppID
=
wx425608b69a34736f
WINXIN_AppSecret
=
279796e8c2963c8a5ddc8270ef642b29
WINXIN_PARTNER_KEY
=
xxfcXXDfangche74upyuns3AD4334533
WINXIN_PARTNER_KEY
=
xxfcXXDfangche74upyuns3AD4334533
WINXIN_PARTNER
=
1539689201
WINXIN_PARTNER
=
1539689201
#ios
#ios
...
...
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/dto/BaseUserMemberExportDTO.java
0 → 100644
View file @
48af7a15
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
dto
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.persistence.Column
;
import
javax.persistence.Table
;
import
java.io.Serializable
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/8 16:08
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table
(
name
=
"base_user_member_export"
)
public
class
BaseUserMemberExportDTO
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
Integer
id
;
private
String
username
;
private
Integer
memberLevel
;
private
Integer
totalNumber
;
private
Integer
rentFreeDays
;
private
Integer
discount
;
private
Integer
status
;
private
Integer
isDel
;
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/entity/BaseUserMemberExport.java
0 → 100644
View file @
48af7a15
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
entity
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.persistence.Column
;
import
javax.persistence.Table
;
import
java.io.Serializable
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/8 16:08
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
@Table
(
name
=
"base_user_member_export"
)
public
class
BaseUserMemberExport
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
private
Integer
id
;
private
String
username
;
@Column
(
name
=
"member_level"
)
private
Integer
memberLevel
;
@Column
(
name
=
"total_number"
)
private
Integer
totalNumber
;
@Column
(
name
=
"rent_free_days"
)
private
Integer
rentFreeDays
;
private
Integer
discount
;
private
Integer
status
;
@Column
(
name
=
"is_del"
)
private
Integer
isDel
;
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserLoginBiz.java
View file @
48af7a15
...
@@ -2,27 +2,22 @@ package com.github.wxiaoqi.security.admin.biz;
...
@@ -2,27 +2,22 @@ package com.github.wxiaoqi.security.admin.biz;
import
com.ace.cache.annotation.Cache
;
import
com.ace.cache.annotation.Cache
;
import
com.ace.cache.annotation.CacheClear
;
import
com.ace.cache.annotation.CacheClear
;
import
com.github.pagehelper.Page
;
import
com.github.pagehelper.PageHelper
;
import
com.github.wxiaoqi.security.admin.entity.AppUserLogin
;
import
com.github.wxiaoqi.security.admin.entity.AppUserLogin
;
import
com.github.wxiaoqi.security.admin.entity.User
;
import
com.github.wxiaoqi.security.admin.mapper.AppUserLoginMapper
;
import
com.github.wxiaoqi.security.admin.mapper.AppUserLoginMapper
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.constant.UserConstant
;
import
com.github.wxiaoqi.security.common.constant.UserConstant
;
import
com.github.wxiaoqi.security.common.msg.TableResultResponse
;
import
org.apache.commons.collections.CollectionUtils
;
import
com.github.wxiaoqi.security.common.util.Query
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
;
import
org.springframework.security.crypto.bcrypt.BCryptPasswordEncoder
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
tk.mybatis.mapper.entity.Example
;
import
tk.mybatis.mapper.entity.Example
;
import
java.time.Instant
;
import
java.time.Instant
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
import
java.util.Optional
;
import
static
com
.
github
.
wxiaoqi
.
security
.
auth
.
common
.
constatns
.
CommonConstants
.
DATA_ALL_TRUE
;
import
java.util.concurrent.atomic.AtomicReference
;
import
java.util.stream.Collectors
;
/**
/**
* ${DESCRIPTION}
* ${DESCRIPTION}
...
@@ -43,12 +38,12 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
...
@@ -43,12 +38,12 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
}
}
@Override
@Override
@CacheClear
(
pre
=
"user{1.username}"
)
@CacheClear
(
pre
=
"user{1.username}"
)
public
void
updateSelectiveById
(
AppUserLogin
entity
)
{
public
void
updateSelectiveById
(
AppUserLogin
entity
)
{
super
.
updateSelectiveById
(
entity
);
super
.
updateSelectiveById
(
entity
);
}
}
@CacheClear
(
pre
=
"user{1.username}"
)
@CacheClear
(
pre
=
"user{1.username}"
)
public
void
updatePasswordById
(
AppUserLogin
entity
)
{
public
void
updatePasswordById
(
AppUserLogin
entity
)
{
String
password
=
new
BCryptPasswordEncoder
(
UserConstant
.
PW_ENCORDER_SALT
).
encode
(
entity
.
getPassword
());
String
password
=
new
BCryptPasswordEncoder
(
UserConstant
.
PW_ENCORDER_SALT
).
encode
(
entity
.
getPassword
());
entity
.
setPassword
(
password
);
entity
.
setPassword
(
password
);
...
@@ -58,11 +53,12 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
...
@@ -58,11 +53,12 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
/**
/**
* 根据用户名获取用户信息
* 根据用户名获取用户信息
*
* @param username
* @param username
* @return
* @return
*/
*/
@Cache
(
key
=
"user{1}"
)
@Cache
(
key
=
"user{1}"
)
public
AppUserLogin
getUserByUsername
(
String
username
){
public
AppUserLogin
getUserByUsername
(
String
username
)
{
AppUserLogin
user
=
new
AppUserLogin
();
AppUserLogin
user
=
new
AppUserLogin
();
user
.
setUsername
(
username
);
user
.
setUsername
(
username
);
return
mapper
.
selectOne
(
user
);
return
mapper
.
selectOne
(
user
);
...
@@ -101,7 +97,7 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
...
@@ -101,7 +97,7 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
public
AppUserLogin
checkeUserLogin
(
String
username
)
{
public
AppUserLogin
checkeUserLogin
(
String
username
)
{
Example
example
=
new
Example
(
AppUserLogin
.
class
);
Example
example
=
new
Example
(
AppUserLogin
.
class
);
example
.
createCriteria
().
andEqualTo
(
"username"
,
username
).
andEqualTo
(
"isdel"
,
0
).
andEqualTo
(
"status"
,
0
);
example
.
createCriteria
().
andEqualTo
(
"username"
,
username
).
andEqualTo
(
"isdel"
,
0
).
andEqualTo
(
"status"
,
0
);
List
<
AppUserLogin
>
userLoginList
=
mapper
.
selectByExample
(
example
);
List
<
AppUserLogin
>
userLoginList
=
mapper
.
selectByExample
(
example
);
if
(
userLoginList
!=
null
&&
userLoginList
.
size
()
!=
0
)
{
if
(
userLoginList
!=
null
&&
userLoginList
.
size
()
!=
0
)
{
return
userLoginList
.
get
(
0
);
return
userLoginList
.
get
(
0
);
...
@@ -111,14 +107,15 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
...
@@ -111,14 +107,15 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
/**
/**
* 根据微信号判断是否存在用户
* 根据微信号判断是否存在用户
*
* @param openid
* @param openid
* @return
* @return
*/
*/
public
AppUserLogin
getUserByOpenid
(
String
openid
,
Integer
isQQ
)
{
public
AppUserLogin
getUserByOpenid
(
String
openid
,
Integer
isQQ
)
{
Example
example
=
new
Example
(
AppUserLogin
.
class
);
Example
example
=
new
Example
(
AppUserLogin
.
class
);
if
(
isQQ
==
1
)
{
if
(
isQQ
==
1
)
{
example
.
createCriteria
().
andEqualTo
(
"openid"
,
openid
).
andEqualTo
(
"isdel"
,
0
);
example
.
createCriteria
().
andEqualTo
(
"openid"
,
openid
).
andEqualTo
(
"isdel"
,
0
);
}
else
{
}
else
{
example
.
createCriteria
().
andEqualTo
(
"wxOpenid"
,
openid
).
andEqualTo
(
"isdel"
,
0
);
example
.
createCriteria
().
andEqualTo
(
"wxOpenid"
,
openid
).
andEqualTo
(
"isdel"
,
0
);
}
}
List
<
AppUserLogin
>
userLoginList
=
mapper
.
selectByExample
(
example
);
List
<
AppUserLogin
>
userLoginList
=
mapper
.
selectByExample
(
example
);
...
@@ -138,8 +135,8 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
...
@@ -138,8 +135,8 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
boolean
flag
=
true
;
boolean
flag
=
true
;
if
(
null
!=
userLogin
)
{
if
(
null
!=
userLogin
)
{
Integer
userid
=
userLogin
.
getId
();
Integer
userid
=
userLogin
.
getId
();
userLogin
=
mapper
.
selectByPrimaryKey
(
userid
);
userLogin
=
mapper
.
selectByPrimaryKey
(
userid
);
if
(
userLogin
==
null
)
{
if
(
userLogin
==
null
)
{
flag
=
false
;
flag
=
false
;
}
}
}
}
...
@@ -147,16 +144,26 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
...
@@ -147,16 +144,26 @@ public class AppUserLoginBiz extends BaseBiz<AppUserLoginMapper, AppUserLogin> {
}
}
//获取用户信息
//获取用户信息
public
AppUserLogin
getUserById
(
Integer
userId
){
public
AppUserLogin
getUserById
(
Integer
userId
)
{
return
mapper
.
selectByPrimaryKey
(
userId
);
return
mapper
.
selectByPrimaryKey
(
userId
);
}
}
/**
/**
* 登录信息更改
* 登录信息更改
*
* @param userId
* @param userId
* @param ip
* @param ip
*/
*/
public
void
updateLoginInfo
(
Integer
userId
,
String
ip
){
public
void
updateLoginInfo
(
Integer
userId
,
String
ip
)
{
mapper
.
updateLoginUserInfoById
(
userId
,
ip
,
Instant
.
now
().
toEpochMilli
());
mapper
.
updateLoginUserInfoById
(
userId
,
ip
,
Instant
.
now
().
toEpochMilli
());
}
public
Map
<
String
,
Integer
>
findPhoneAndUserIdMapByPhones
(
List
<
String
>
phones
)
{
List
<
AppUserLogin
>
appUserLogins
=
mapper
.
selectbyPhones
(
phones
);
Map
<
String
,
Integer
>
phoneAndUserIdMap
=
null
;
if
(
CollectionUtils
.
isNotEmpty
(
appUserLogins
))
{
phoneAndUserIdMap
=
appUserLogins
.
stream
().
collect
(
Collectors
.
toMap
(
AppUserLogin:
:
getUsername
,
AppUserLogin:
:
getId
));
}
return
phoneAndUserIdMap
;
}
}
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/BaseUserMemberBiz.java
View file @
48af7a15
...
@@ -18,6 +18,7 @@ import org.springframework.stereotype.Service;
...
@@ -18,6 +18,7 @@ import org.springframework.stereotype.Service;
import
com.github.wxiaoqi.security.admin.entity.BaseUserMember
;
import
com.github.wxiaoqi.security.admin.entity.BaseUserMember
;
import
com.github.wxiaoqi.security.admin.mapper.BaseUserMemberMapper
;
import
com.github.wxiaoqi.security.admin.mapper.BaseUserMemberMapper
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
tk.mybatis.mapper.entity.Example
;
import
tk.mybatis.mapper.entity.Example
;
import
tk.mybatis.mapper.weekend.WeekendSqls
;
import
tk.mybatis.mapper.weekend.WeekendSqls
;
...
@@ -56,6 +57,7 @@ public class BaseUserMemberBiz extends BaseBiz<BaseUserMemberMapper,BaseUserMemb
...
@@ -56,6 +57,7 @@ public class BaseUserMemberBiz extends BaseBiz<BaseUserMemberMapper,BaseUserMemb
//用户购买会员信息更新
//用户购买会员信息更新
@Transactional
(
rollbackFor
=
Exception
.
class
,
propagation
=
Propagation
.
REQUIRED
)
public
void
updUserMemberByUserId
(
UserMemberDTO
userMemberDTO
)
throws
Exception
{
public
void
updUserMemberByUserId
(
UserMemberDTO
userMemberDTO
)
throws
Exception
{
if
(
userMemberDTO
==
null
){
if
(
userMemberDTO
==
null
){
log
.
error
(
"updUserMemberByUserId----参数为空"
);
log
.
error
(
"updUserMemberByUserId----参数为空"
);
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/BaseUserMemberExportBiz.java
0 → 100644
View file @
48af7a15
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
biz
;
import
com.github.wxiaoqi.security.admin.dto.UserMemberDTO
;
import
com.github.wxiaoqi.security.admin.entity.BaseUserMemberExport
;
import
com.github.wxiaoqi.security.admin.mapper.BaseUserMemberExportMapper
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.ArrayList
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/8 16:19
*/
@Service
@Slf4j
public
class
BaseUserMemberExportBiz
extends
BaseBiz
<
BaseUserMemberExportMapper
,
BaseUserMemberExport
>
{
@Autowired
private
UserMemberLevelBiz
userMemberLevelBiz
;
@Autowired
private
BaseUserMemberBiz
baseUserMemberBiz
;
@Autowired
private
AppUserLoginBiz
appUserLoginBiz
;
@Transactional
(
rollbackFor
=
Exception
.
class
,
propagation
=
Propagation
.
REQUIRED
)
public
void
importUserMember
(
List
<
String
[]>
userMemberData
){
List
<
BaseUserMemberExport
>
baseUserMemberExports
=
new
ArrayList
<>();
List
<
Integer
>
levels
=
userMemberData
.
stream
().
map
(
x
->
x
[
1
]).
map
(
Integer:
:
valueOf
).
collect
(
Collectors
.
toList
());
Map
<
Integer
,
Integer
>
levelAndDisCountMap
=
userMemberLevelBiz
.
getUserMemberLevelAndDisCountMapByLevels
(
levels
);
List
<
String
>
phones
=
userMemberData
.
stream
().
map
(
x
->
x
[
0
]).
collect
(
Collectors
.
toList
());
Map
<
String
,
Integer
>
phoneAndUserIdMap
=
appUserLoginBiz
.
findPhoneAndUserIdMapByPhones
(
phones
);
for
(
String
[]
data
:
userMemberData
)
{
String
phone
=
data
[
0
];
String
memberLevel
=
data
[
1
];
String
totalNumber
=
data
[
2
];
String
rentFreeDays
=
data
[
3
];
if
(
phoneAndUserIdMap
!=
null
&&
phoneAndUserIdMap
.
get
(
phone
)!=
null
){
UserMemberDTO
userMemberDTO
=
new
UserMemberDTO
();
userMemberDTO
.
setUserId
(
phoneAndUserIdMap
.
get
(
phone
));
userMemberDTO
.
setMemberLevel
(
Integer
.
valueOf
(
memberLevel
));
userMemberDTO
.
setDiscount
(
levelAndDisCountMap
==
null
?
0
:(
levelAndDisCountMap
.
get
(
Integer
.
valueOf
(
memberLevel
))==
null
?
0
:
levelAndDisCountMap
.
get
(
Integer
.
valueOf
(
memberLevel
))));
userMemberDTO
.
setTotalNumber
(
Integer
.
valueOf
(
totalNumber
));
userMemberDTO
.
setRentFreeDays
(
Integer
.
valueOf
(
rentFreeDays
));
try
{
baseUserMemberBiz
.
updUserMemberByUserId
(
userMemberDTO
);
}
catch
(
Exception
e
)
{
log
.
error
(
"会员更新错误:【{}】"
,
e
.
getMessage
());
throw
new
BaseException
(
e
);
}
}
BaseUserMemberExport
memberExport
=
BaseUserMemberExport
.
builder
()
.
username
(
phone
)
.
memberLevel
(
Integer
.
valueOf
(
memberLevel
))
.
totalNumber
(
Integer
.
valueOf
(
totalNumber
))
.
rentFreeDays
(
Integer
.
valueOf
(
rentFreeDays
))
.
discount
(
levelAndDisCountMap
==
null
?
0
:(
levelAndDisCountMap
.
get
(
Integer
.
valueOf
(
memberLevel
))==
null
?
0
:
levelAndDisCountMap
.
get
(
Integer
.
valueOf
(
memberLevel
))))
.
status
(
phoneAndUserIdMap
==
null
?
0
:
(
phoneAndUserIdMap
.
get
(
phone
)
==
null
?
0
:
1
))
.
isDel
(
0
)
.
build
();
if
(
log
.
isDebugEnabled
()){
log
.
debug
(
"当前组装的数据:【{}】"
,
memberExport
);
}
baseUserMemberExports
.
add
(
memberExport
);
}
InsertBatch
(
baseUserMemberExports
);
}
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
InsertBatch
(
List
<
BaseUserMemberExport
>
baseUserMemberExports
)
{
mapper
.
insertList
(
baseUserMemberExports
);
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/UserMemberLevelBiz.java
View file @
48af7a15
...
@@ -4,11 +4,15 @@ import com.ace.cache.annotation.Cache;
...
@@ -4,11 +4,15 @@ import com.ace.cache.annotation.Cache;
import
com.github.wxiaoqi.security.admin.entity.BaseUserMemberLevel
;
import
com.github.wxiaoqi.security.admin.entity.BaseUserMemberLevel
;
import
com.github.wxiaoqi.security.admin.mapper.BaseUserMemberLevelMapper
;
import
com.github.wxiaoqi.security.admin.mapper.BaseUserMemberLevelMapper
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
org.apache.commons.collections.CollectionUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
tk.mybatis.mapper.entity.Example
;
import
tk.mybatis.mapper.entity.Example
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.stream.Collectors
;
/**
/**
* @author keliii
* @author keliii
...
@@ -26,5 +30,13 @@ public class UserMemberLevelBiz extends BaseBiz<BaseUserMemberLevelMapper,BaseUs
...
@@ -26,5 +30,13 @@ public class UserMemberLevelBiz extends BaseBiz<BaseUserMemberLevelMapper,BaseUs
return
mapper
.
selectByExample
(
example
);
return
mapper
.
selectByExample
(
example
);
}
}
@Transactional
(
rollbackFor
=
Exception
.
class
,
propagation
=
Propagation
.
REQUIRED
)
public
Map
<
Integer
,
Integer
>
getUserMemberLevelAndDisCountMapByLevels
(
List
<
Integer
>
levels
){
List
<
BaseUserMemberLevel
>
baseUserMemberLevels
=
mapper
.
selectUserMembersLevelByLevels
(
levels
);
Map
<
Integer
,
Integer
>
levelAndDiscountMap
=
null
;
if
(
CollectionUtils
.
isNotEmpty
(
baseUserMemberLevels
)){
levelAndDiscountMap
=
baseUserMemberLevels
.
stream
().
collect
(
Collectors
.
toMap
(
BaseUserMemberLevel:
:
getLevel
,
BaseUserMemberLevel:
:
getDiscount
));
}
return
levelAndDiscountMap
;
}
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/mapper/AppUserLoginMapper.java
View file @
48af7a15
...
@@ -6,6 +6,8 @@ import org.apache.ibatis.annotations.Param;
...
@@ -6,6 +6,8 @@ import org.apache.ibatis.annotations.Param;
import
org.apache.ibatis.annotations.Update
;
import
org.apache.ibatis.annotations.Update
;
import
tk.mybatis.mapper.common.Mapper
;
import
tk.mybatis.mapper.common.Mapper
;
import
java.util.List
;
public
interface
AppUserLoginMapper
extends
Mapper
<
AppUserLogin
>
{
public
interface
AppUserLoginMapper
extends
Mapper
<
AppUserLogin
>
{
...
@@ -17,4 +19,6 @@ public interface AppUserLoginMapper extends Mapper<AppUserLogin> {
...
@@ -17,4 +19,6 @@ public interface AppUserLoginMapper extends Mapper<AppUserLogin> {
*/
*/
@Update
(
"update `app_user_login` set `last_host`=#{ip},`last_time`=#{lastTime} where `id`=#{userId}"
)
@Update
(
"update `app_user_login` set `last_host`=#{ip},`last_time`=#{lastTime} where `id`=#{userId}"
)
void
updateLoginUserInfoById
(
@Param
(
"userId"
)
Integer
userId
,
@Param
(
"ip"
)
String
ip
,
@Param
(
"lastTime"
)
long
lastTime
);
void
updateLoginUserInfoById
(
@Param
(
"userId"
)
Integer
userId
,
@Param
(
"ip"
)
String
ip
,
@Param
(
"lastTime"
)
long
lastTime
);
List
<
AppUserLogin
>
selectbyPhones
(
@Param
(
"phones"
)
List
<
String
>
phones
);
}
}
\ No newline at end of file
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/mapper/BaseUserMemberExportMapper.java
0 → 100644
View file @
48af7a15
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
mapper
;
import
com.github.wxiaoqi.security.admin.entity.BaseUserMemberExport
;
import
tk.mybatis.mapper.common.Mapper
;
import
tk.mybatis.mapper.common.special.InsertListMapper
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/8 16:21
*/
public
interface
BaseUserMemberExportMapper
extends
Mapper
<
BaseUserMemberExport
>,
InsertListMapper
<
BaseUserMemberExport
>
{
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/mapper/BaseUserMemberLevelMapper.java
View file @
48af7a15
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
mapper
;
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
mapper
;
import
com.github.wxiaoqi.security.admin.entity.BaseUserMemberLevel
;
import
com.github.wxiaoqi.security.admin.entity.BaseUserMemberLevel
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
import
tk.mybatis.mapper.common.Mapper
;
import
tk.mybatis.mapper.common.Mapper
;
import
java.util.List
;
/**
/**
* 会员等级表
* 会员等级表
*
*
...
@@ -11,4 +15,5 @@ import tk.mybatis.mapper.common.Mapper;
...
@@ -11,4 +15,5 @@ import tk.mybatis.mapper.common.Mapper;
*/
*/
public
interface
BaseUserMemberLevelMapper
extends
Mapper
<
BaseUserMemberLevel
>
{
public
interface
BaseUserMemberLevelMapper
extends
Mapper
<
BaseUserMemberLevel
>
{
List
<
BaseUserMemberLevel
>
selectUserMembersLevelByLevels
(
@Param
(
"levels"
)
List
<
Integer
>
levels
);
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/AppUserController.java
View file @
48af7a15
...
@@ -118,6 +118,7 @@ public class AppUserController extends CommonBaseController {
...
@@ -118,6 +118,7 @@ public class AppUserController extends CommonBaseController {
if
(
userVo
==
null
)
{
if
(
userVo
==
null
)
{
throw
new
Exception
();
throw
new
Exception
();
}
}
Integer
id
=
userVo
.
getId
();
BeanUtils
.
copyProperties
(
userDTO
,
userVo
);
BeanUtils
.
copyProperties
(
userDTO
,
userVo
);
if
(
userVo
.
getIsMember
()!=
null
&&
userVo
.
getIsMember
()>
0
){
if
(
userVo
.
getIsMember
()!=
null
&&
userVo
.
getIsMember
()>
0
){
//获取用户会员信息
//获取用户会员信息
...
@@ -126,6 +127,7 @@ public class AppUserController extends CommonBaseController {
...
@@ -126,6 +127,7 @@ public class AppUserController extends CommonBaseController {
BeanUtils
.
copyProperties
(
userDTO
,
memberVo
);
BeanUtils
.
copyProperties
(
userDTO
,
memberVo
);
}
}
}
}
userDTO
.
setId
(
id
);
return
ObjectRestResponse
.
succ
(
userDTO
);
return
ObjectRestResponse
.
succ
(
userDTO
);
}
}
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/BaseUserMemberExportController.java
0 → 100644
View file @
48af7a15
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
rest
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/8 16:20
*/
public
class
BaseUserMemberExportController
{
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/UserMemberController.java
View file @
48af7a15
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
rest
;
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
rest
;
import
com.github.wxiaoqi.security.admin.biz.BaseUserMemberBiz
;
import
com.github.wxiaoqi.security.admin.biz.BaseUserMemberBiz
;
import
com.github.wxiaoqi.security.admin.biz.BaseUserMemberExportBiz
;
import
com.github.wxiaoqi.security.admin.dto.UserMemberDTO
;
import
com.github.wxiaoqi.security.admin.dto.UserMemberDTO
;
import
com.github.wxiaoqi.security.admin.entity.BaseUserMemberLevel
;
import
com.github.wxiaoqi.security.admin.entity.BaseUserMemberLevel
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.excel.ExcelImport
;
import
com.xxfc.platform.vehicle.common.RestResponse
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.multipart.MultipartFile
;
import
java.util.List
;
import
java.util.List
;
...
@@ -22,8 +27,12 @@ public class UserMemberController {
...
@@ -22,8 +27,12 @@ public class UserMemberController {
@Autowired
@Autowired
private
BaseUserMemberBiz
memberBiz
;
private
BaseUserMemberBiz
memberBiz
;
@Autowired
private
BaseUserMemberExportBiz
baseUserMemberExportBiz
;
/**
/**
* 购买会员
* 购买会员
*
* @param userMemberDTO
* @param userMemberDTO
* @return
* @return
* @throws Exception
* @throws Exception
...
@@ -36,6 +45,7 @@ public class UserMemberController {
...
@@ -36,6 +45,7 @@ public class UserMemberController {
/**
/**
* 订单更改会员
* 订单更改会员
*
* @param userId
* @param userId
* @param days
* @param days
* @param type 1-用户锁定下单;2-购买下单;3-取消订单
* @param type 1-用户锁定下单;2-购买下单;3-取消订单
...
@@ -44,11 +54,26 @@ public class UserMemberController {
...
@@ -44,11 +54,26 @@ public class UserMemberController {
*/
*/
@RequestMapping
(
value
=
"/user/memberDays"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/user/memberDays"
,
method
=
RequestMethod
.
POST
)
public
int
memberDays
(
public
int
memberDays
(
@RequestParam
(
value
=
"userId"
,
defaultValue
=
"0"
)
Integer
userId
,
@RequestParam
(
value
=
"userId"
,
defaultValue
=
"0"
)
Integer
userId
,
@RequestParam
(
value
=
"days"
,
defaultValue
=
"0"
)
Integer
days
,
@RequestParam
(
value
=
"days"
,
defaultValue
=
"0"
)
Integer
days
,
@RequestParam
(
value
=
"type"
,
defaultValue
=
"1"
)
Integer
type
@RequestParam
(
value
=
"type"
,
defaultValue
=
"1"
)
Integer
type
)
throws
Exception
{
)
throws
Exception
{
return
memberBiz
.
upMemberDays
(
userId
,
days
,
type
);
return
memberBiz
.
upMemberDays
(
userId
,
days
,
type
);
}
}
@PostMapping
(
"/user/export"
)
public
ObjectRestResponse
importUserMember
(
MultipartFile
userMemberExcel
)
{
List
<
String
[]>
userMemberData
=
ExcelImport
.
getExcelData
(
userMemberExcel
);
if
(
userMemberData
.
size
()
<
1
)
{
return
ObjectRestResponse
.
createFailedResult
(
1001
,
"导入不能没数据!!!"
);
}
for
(
String
[]
userMemberDatum
:
userMemberData
)
{
if
(
userMemberDatum
.
length
!=
4
){
return
ObjectRestResponse
.
createFailedResult
(
1002
,
"数据不完整!!!"
);
}
}
userMemberData
.
remove
(
0
);
baseUserMemberExportBiz
.
importUserMember
(
userMemberData
);
return
ObjectRestResponse
.
succ
();
}
}
}
ace-modules/ace-admin/src/main/resources/mapper/AppUserLoginMapper.xml
0 → 100644
View file @
48af7a15
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.github.wxiaoqi.security.admin.mapper.AppUserLoginMapper"
>
<select
id=
"selectbyPhones"
resultType=
"com.github.wxiaoqi.security.admin.entity.AppUserLogin"
>
select `id`,`username` from `app_user_login` where `username` in
<foreach
collection=
"phones"
item=
"phone"
open=
"("
close=
")"
separator=
","
>
#{phone}
</foreach>
</select>
</mapper>
\ No newline at end of file
ace-modules/ace-admin/src/main/resources/mapper/BaseUserMemberExportMapper.xml
0 → 100644
View file @
48af7a15
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.github.wxiaoqi.security.admin.mapper.BaseUserMemberExportMapper"
>
<resultMap
type=
"com.github.wxiaoqi.security.admin.entity.BaseUserMemberExport"
id=
"baseUserMemberExportMap"
>
<id
property=
"id"
column=
"id"
/>
<result
property=
"discount"
column=
"discount"
/>
<result
property=
"memberLevel"
column=
"member_level"
/>
<result
property=
"rentFreeDays"
column=
"rent_free_days"
/>
<result
property=
"totalNumber"
column=
"total_number"
/>
<result
property=
"username"
column=
"username"
/>
<result
property=
"isDel"
column=
"is_del"
/>
<result
property=
"status"
column=
"status"
/>
</resultMap>
</mapper>
\ No newline at end of file
ace-modules/ace-admin/src/main/resources/mapper/BaseUserMemberLevelMapper.xml
0 → 100644
View file @
48af7a15
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.github.wxiaoqi.security.admin.mapper.BaseUserMemberLevelMapper"
>
<select
id=
"selectUserMembersLevelByLevels"
resultType=
"com.github.wxiaoqi.security.admin.entity.BaseUserMemberLevel"
>
select `level`,`discount` from `base_user_member_level` where `level` in
<foreach
collection=
"levels"
item=
"level"
separator=
","
open=
"("
close=
")"
>
#{level}
</foreach>
</select>
</mapper>
\ No newline at end of file
xx-campsite/xx-campsite-server/src/main/java/com/xxfc/platform/campsite/biz/CampsiteShopBiz.java
View file @
48af7a15
package
com
.
xxfc
.
platform
.
campsite
.
biz
;
package
com
.
xxfc
.
platform
.
campsite
.
biz
;
import
com.ace.cache.annotation.Cache
;
import
com.ace.cache.annotation.CacheClear
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.JSONObject
;
import
com.alibaba.fastjson.TypeReference
;
import
com.alibaba.fastjson.TypeReference
;
import
com.github.wxiaoqi.security.common.vo.GoodDataVO
;
import
com.github.wxiaoqi.security.common.vo.GoodDataVO
;
...
@@ -40,10 +38,6 @@ import java.util.stream.Collectors;
...
@@ -40,10 +38,6 @@ import java.util.stream.Collectors;
@Service
@Service
@Slf4j
@Slf4j
public
class
CampsiteShopBiz
extends
BaseBiz
<
CampsiteShopMapper
,
CampsiteShop
>
{
public
class
CampsiteShopBiz
extends
BaseBiz
<
CampsiteShopMapper
,
CampsiteShop
>
{
/**
* 地球半径,单位 km
*/
private
static
final
double
EARTH_RADIUS
=
6378.137
;
@Autowired
@Autowired
private
CampsiteShopTagBiz
campsiteShopTagBiz
;
private
CampsiteShopTagBiz
campsiteShopTagBiz
;
...
@@ -60,36 +54,46 @@ public class CampsiteShopBiz extends BaseBiz<CampsiteShopMapper, CampsiteShop> {
...
@@ -60,36 +54,46 @@ public class CampsiteShopBiz extends BaseBiz<CampsiteShopMapper, CampsiteShop> {
@Resource
(
name
=
"customRedisTemplate"
)
@Resource
(
name
=
"customRedisTemplate"
)
ValueOperations
<
String
,
String
>
campsiteValueOperations
;
ValueOperations
<
String
,
String
>
campsiteValueOperations
;
private
static
final
String
CAMPSITE_CACHE
=
"campsite_cache:"
;
/**
private
static
final
String
CAMSITE_DETAIL_CACHE
=
"campsite:detail:cache:"
;
* 营地缓存前缀
*/
private
static
final
String
CAMPSITE_LIST_CACHE_PREKEY
=
"campsite_cache:"
;
private
static
final
String
CAMSITE_DETAIL_CACHE_PREKEY
=
"campsite:detail:cache:"
;
private
static
final
String
CAMPSITE_CACHE_ALL
=
"all"
;
private
static
final
String
CAMPSITE_CACHE_ALL
=
"all"
;
private
static
final
long
CAMPSITE_EXPIRE_TIME
=
6000
;
private
static
final
long
CAMPSITE_CACHE_EXPIRE_TIME
=
6000
;
/**
/**
* 根据店铺类型查找列表
* 地球半径,单位 km
*/
private
static
final
double
EARTH_RADIUS
=
6378.137
;
/**
* 首页营地列表
*
*
* @param type
* @param page
* @param limit
* @return
* @return
*/
*/
public
List
<
GoodDataVO
>
getAllByHome
(
Integer
page
,
Integer
limit
)
{
return
mapper
.
findAllByHome
((
page
-
1
)
*
limit
,
limit
);
}
public
PageDataVO
<
CampsiteShopPageVo
>
findCampsiteShopPageByType
(
Integer
type
,
Integer
pageNo
,
Integer
pageSize
)
{
public
PageDataVO
<
CampsiteShopPageVo
>
findCampsiteShopPageByType
(
Integer
type
,
Integer
pageNo
,
Integer
pageSize
)
{
//根据type类型查找店铺
String
result
;
String
result
=
null
;
if
(
Objects
.
isNull
(
type
))
{
if
(
Objects
.
isNull
(
type
))
{
result
=
campHashOperations
.
get
(
CAMPSITE_
CACHE
,
CAMPSITE_CACHE_ALL
);
result
=
campHashOperations
.
get
(
CAMPSITE_
LIST_CACHE_PREKEY
,
String
.
format
(
"%s%d%d"
,
CAMPSITE_CACHE_ALL
,
pageNo
,
pageSize
)
);
}
else
{
}
else
{
result
=
campHashOperations
.
get
(
CAMPSITE_
CACHE
,
String
.
format
(
"%s%d%d"
,
String
.
valueOf
(
type
),
pageNo
,
pageSize
));
result
=
campHashOperations
.
get
(
CAMPSITE_
LIST_CACHE_PREKEY
,
String
.
format
(
"%s%d%d"
,
String
.
valueOf
(
type
),
pageNo
,
pageSize
));
}
}
if
(
result
!=
null
)
{
if
(
result
!=
null
)
{
return
JSONObject
.
parseObject
(
result
,
new
TypeReference
<
PageDataVO
<
CampsiteShopPageVo
>>(){});
return
JSONObject
.
parseObject
(
result
,
new
TypeReference
<
PageDataVO
<
CampsiteShopPageVo
>>()
{
});
}
}
PageDataVO
<
CampsiteShopPageVo
>
campsiteShopPageDataVO
=
new
PageDataVO
<>();
PageDataVO
<
CampsiteShopPageDTO
>
pageDataVO
=
PageDataVO
.
pageInfo
(
pageNo
,
pageSize
,
()
->
mapper
.
findAllCampsiteShopsByType
(
type
));
PageDataVO
<
CampsiteShopPageDTO
>
pageDataVO
=
PageDataVO
.
pageInfo
(
pageNo
,
pageSize
,
()
->
mapper
.
findAllCampsiteShopsByType
(
type
));
List
<
CampsiteShopPageDTO
>
campsiteShopPageDTOS
=
pageDataVO
.
getData
();
List
<
CampsiteShopPageDTO
>
campsiteShopPageDTOS
=
pageDataVO
.
getData
();
PageDataVO
<
CampsiteShopPageVo
>
campsiteShopPageDataVO
=
new
PageDataVO
<>();
campsiteShopPageDataVO
.
setTotalPage
(
pageDataVO
.
getTotalPage
());
campsiteShopPageDataVO
.
setTotalCount
(
pageDataVO
.
getTotalCount
());
campsiteShopPageDataVO
.
setPageSize
(
pageDataVO
.
getPageSize
());
campsiteShopPageDataVO
.
setPageNum
(
pageDataVO
.
getPageNum
());
if
(
CollectionUtils
.
isEmpty
(
campsiteShopPageDTOS
))
{
if
(
CollectionUtils
.
isEmpty
(
campsiteShopPageDTOS
))
{
campsiteShopPageDataVO
.
setData
(
new
ArrayList
<
CampsiteShopPageVo
>());
campsiteShopPageDataVO
.
setData
(
new
ArrayList
<
CampsiteShopPageVo
>());
return
campsiteShopPageDataVO
;
return
campsiteShopPageDataVO
;
...
@@ -97,6 +101,7 @@ public class CampsiteShopBiz extends BaseBiz<CampsiteShopMapper, CampsiteShop> {
...
@@ -97,6 +101,7 @@ public class CampsiteShopBiz extends BaseBiz<CampsiteShopMapper, CampsiteShop> {
if
(
log
.
isDebugEnabled
())
{
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"根据type=【{}】查询到的店铺数据:【{}】"
,
type
,
campsiteShopPageDTOS
);
log
.
debug
(
"根据type=【{}】查询到的店铺数据:【{}】"
,
type
,
campsiteShopPageDTOS
);
}
}
List
<
CampsiteShopPageVo
>
campsiteShopPageVoList
=
new
ArrayList
<>();
List
<
CampsiteShopPageVo
>
campsiteShopPageVoList
=
new
ArrayList
<>();
campsiteShopPageDTOS
=
campsiteShopPageDTOS
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
campsiteShopPageDTOS
=
campsiteShopPageDTOS
.
stream
().
distinct
().
collect
(
Collectors
.
toList
());
for
(
CampsiteShopPageDTO
campsiteShopPageDTO
:
campsiteShopPageDTOS
)
{
for
(
CampsiteShopPageDTO
campsiteShopPageDTO
:
campsiteShopPageDTOS
)
{
...
@@ -105,38 +110,44 @@ public class CampsiteShopBiz extends BaseBiz<CampsiteShopMapper, CampsiteShop> {
...
@@ -105,38 +110,44 @@ public class CampsiteShopBiz extends BaseBiz<CampsiteShopMapper, CampsiteShop> {
campsiteShopPageVoList
.
add
(
campsiteShopPageVo
);
campsiteShopPageVoList
.
add
(
campsiteShopPageVo
);
}
}
campsiteShopPageVoList
.
sort
(
Comparator
.
comparing
(
CampsiteShopPageVo:
:
getHot
).
reversed
().
thenComparing
(
CampsiteShopPageVo:
:
getCrtTime
).
reversed
());
campsiteShopPageVoList
.
sort
(
Comparator
.
comparing
(
CampsiteShopPageVo:
:
getHot
).
reversed
().
thenComparing
(
CampsiteShopPageVo:
:
getCrtTime
).
reversed
());
campsiteShopPageDataVO
.
setTotalPage
(
pageDataVO
.
getTotalPage
());
campsiteShopPageDataVO
.
setTotalCount
(
pageDataVO
.
getTotalCount
());
campsiteShopPageDataVO
.
setPageSize
(
pageDataVO
.
getPageSize
());
campsiteShopPageDataVO
.
setPageNum
(
pageDataVO
.
getPageNum
());
campsiteShopPageDataVO
.
setData
(
campsiteShopPageVoList
);
campsiteShopPageDataVO
.
setData
(
campsiteShopPageVoList
);
if
(
Objects
.
isNull
(
type
))
{
if
(
Objects
.
isNull
(
type
))
{
campHashOperations
.
put
(
CAMPSITE_
CACHE
,
CAMPSITE_CACHE_ALL
,
JSONObject
.
toJSONString
(
campsiteShopPageDataVO
));
campHashOperations
.
put
(
CAMPSITE_
LIST_CACHE_PREKEY
,
String
.
format
(
"%s%d%d"
,
CAMPSITE_CACHE_ALL
,
pageNo
,
pageSize
)
,
JSONObject
.
toJSONString
(
campsiteShopPageDataVO
));
}
else
{
}
else
{
campHashOperations
.
put
(
CAMPSITE_
CACHE
,
String
.
format
(
"%s%d%d"
,
String
.
valueOf
(
type
),
pageNo
,
pageSize
),
JSONObject
.
toJSONString
(
campsiteShopPageDataVO
));
campHashOperations
.
put
(
CAMPSITE_
LIST_CACHE_PREKEY
,
String
.
format
(
"%s%d%d"
,
String
.
valueOf
(
type
),
pageNo
,
pageSize
),
JSONObject
.
toJSONString
(
campsiteShopPageDataVO
));
}
}
return
campsiteShopPageDataVO
;
return
campsiteShopPageDataVO
;
}
}
/**
/**
* 根据店铺id查询店铺详情
*
* @param id
* @param id
* @param longitude 经度
* @param latitude 纬度
* @return
* @return
*/
*/
public
CampsiteShopDetailVo
findCampsiteShopDetailById
(
Integer
id
,
Double
longitude
,
Double
latitude
)
{
public
CampsiteShopDetailVo
findCampsiteShopDetailById
(
Integer
id
,
Double
longitude
,
Double
latitude
)
{
String
result
=
campsiteValueOperations
.
get
(
String
.
format
(
"%s%d"
,
CAMSITE_DETAIL_CACHE
,
id
));
String
result
=
campsiteValueOperations
.
get
(
String
.
format
(
"%s%d"
,
CAMSITE_DETAIL_CACHE_PREKEY
,
id
));
if
(
Objects
.
nonNull
(
result
)){
if
(
Objects
.
nonNull
(
result
))
{
return
JSONObject
.
parseObject
(
result
,
new
TypeReference
<
CampsiteShopDetailVo
>(){});
return
JSONObject
.
parseObject
(
result
,
new
TypeReference
<
CampsiteShopDetailVo
>()
{
});
}
}
CampsiteShopDetailVo
campsiteShopDetailVo
=
new
CampsiteShopDetailVo
();
CampsiteShopDetailVo
campsiteShopDetailVo
=
new
CampsiteShopDetailVo
();
//从店铺表根据店铺id查询
CampsiteShopDetailDTO
campsiteShopDetailDTO
=
mapper
.
findCampsiteShopDetailById
(
id
);
CampsiteShopDetailDTO
campsiteShopDetailDTO
=
mapper
.
findCampsiteShopDetailById
(
id
);
if
(
log
.
isDebugEnabled
())
{
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"根据店铺id=【{}】查询出店铺信息【{}】"
,
id
,
campsiteShopDetailDTO
);
log
.
debug
(
"根据店铺id=【{}】查询出店铺信息【{}】"
,
id
,
campsiteShopDetailDTO
);
}
}
if
(
Objects
.
isNull
(
campsiteShopDetailDTO
)){
if
(
Objects
.
isNull
(
campsiteShopDetailDTO
))
{
return
campsiteShopDetailVo
;
return
campsiteShopDetailVo
;
}
}
BeanUtils
.
copyProperties
(
campsiteShopDetailDTO
,
campsiteShopDetailVo
);
BeanUtils
.
copyProperties
(
campsiteShopDetailDTO
,
campsiteShopDetailVo
);
//从轮播表根据店铺id查询
List
<
CampsiteShopCarouselDetailDTO
>
campsiteShopCarouselDTOS
=
campsiteShopCarouselBiz
.
findByCampsiteShopId
(
id
);
List
<
CampsiteShopCarouselDetailDTO
>
campsiteShopCarouselDTOS
=
campsiteShopCarouselBiz
.
findByCampsiteShopId
(
id
);
if
(
log
.
isDebugEnabled
())
{
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"根据店铺id=【{}】查询出店铺轮播图信息:【{}】"
,
id
,
campsiteShopCarouselDTOS
);
log
.
debug
(
"根据店铺id=【{}】查询出店铺轮播图信息:【{}】"
,
id
,
campsiteShopCarouselDTOS
);
...
@@ -150,7 +161,6 @@ public class CampsiteShopBiz extends BaseBiz<CampsiteShopMapper, CampsiteShop> {
...
@@ -150,7 +161,6 @@ public class CampsiteShopBiz extends BaseBiz<CampsiteShopMapper, CampsiteShop> {
});
});
}
}
campsiteShopDetailVo
.
setCampsiteShopCarouselDetailVos
(
campsiteShopCarouselDetailVos
);
campsiteShopDetailVo
.
setCampsiteShopCarouselDetailVos
(
campsiteShopCarouselDetailVos
);
//从店铺类型表根据店铺id查询 -->类型列表拼接
List
<
CampsiteShopTagDTO
>
shopTagDTOS
=
campsiteShopTagBiz
.
findByCampsiteShopId
(
id
);
List
<
CampsiteShopTagDTO
>
shopTagDTOS
=
campsiteShopTagBiz
.
findByCampsiteShopId
(
id
);
if
(
log
.
isDebugEnabled
())
{
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"根据店铺id=【{}】查询出店铺类型:【{}】"
,
id
,
shopTagDTOS
);
log
.
debug
(
"根据店铺id=【{}】查询出店铺类型:【{}】"
,
id
,
shopTagDTOS
);
...
@@ -162,56 +172,39 @@ public class CampsiteShopBiz extends BaseBiz<CampsiteShopMapper, CampsiteShop> {
...
@@ -162,56 +172,39 @@ public class CampsiteShopBiz extends BaseBiz<CampsiteShopMapper, CampsiteShop> {
log
.
debug
(
"根据店铺经度=【{}】,纬度=【{}】和自己所在位置的经度=【{}】,纬度=【{}】计算出的距离:【{}km】"
,
campsiteShopDetailDTO
.
getLongitude
(),
campsiteShopDetailDTO
.
getLatitude
(),
longitude
,
latitude
,
distance
);
log
.
debug
(
"根据店铺经度=【{}】,纬度=【{}】和自己所在位置的经度=【{}】,纬度=【{}】计算出的距离:【{}km】"
,
campsiteShopDetailDTO
.
getLongitude
(),
campsiteShopDetailDTO
.
getLatitude
(),
longitude
,
latitude
,
distance
);
}
}
campsiteShopDetailVo
.
setDistance
(
String
.
format
(
"%.1f"
,
distance
));
campsiteShopDetailVo
.
setDistance
(
String
.
format
(
"%.1f"
,
distance
));
campsiteValueOperations
.
set
(
String
.
format
(
"%s%d"
,
CAMSITE_DETAIL_CACHE
,
id
),
JSONObject
.
toJSONString
(
campsiteShopDetailVo
));
campsiteValueOperations
.
set
(
String
.
format
(
"%s%d"
,
CAMSITE_DETAIL_CACHE_PREKEY
,
id
),
JSONObject
.
toJSONString
(
campsiteShopDetailVo
));
return
campsiteShopDetailVo
;
return
campsiteShopDetailVo
;
}
}
/**
* 根据创建时间或营地名称来查找营地列表
*
* @param campsiteShopAdminFindDTO
* @return
*/
public
PageDataVO
<
CampsiteShopAdminPageVo
>
findCampsiteShopPage
(
CampsiteShopAdminFindDTO
campsiteShopAdminFindDTO
)
{
public
PageDataVO
<
CampsiteShopAdminPageVo
>
findCampsiteShopPage
(
CampsiteShopAdminFindDTO
campsiteShopAdminFindDTO
)
{
if
(
log
.
isDebugEnabled
())
{
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"查询条件:【{}】"
,
campsiteShopAdminFindDTO
);
log
.
debug
(
"查询条件:【{}】"
,
campsiteShopAdminFindDTO
);
}
}
PageDataVO
<
CampsiteShopAdminPageVo
>
campsiteShopAdminPageDataVos
=
new
PageDataVO
<>();
//筛选时间处理
/* Long startTime = campsiteShopAdminFindDTO.getStartTime();
Long endTime = campsiteShopAdminFindDTO.getEndTime();
if (startTime==null || endTime ==null){
Long processTime = startTime!=null?startTime:(endTime!=null?endTime:null);
if (processTime!=null){
campsiteShopAdminFindDTO.setStartTime(processStartTime(processTime));
campsiteShopAdminFindDTO.setEndTime(processEndTime(processTime));
}
}else {
campsiteShopAdminFindDTO.setStartTime(processStartTime(startTime));
campsiteShopAdminFindDTO.setEndTime(processEndTime(endTime));
}*/
PageDataVO
<
CampsiteShopAdminPageDTO
>
campsiteShopAdminpageDTOPageDataVO
=
PageDataVO
.
pageInfo
(
campsiteShopAdminFindDTO
.
getPage
(),
campsiteShopAdminFindDTO
.
getLimit
(),
()
->
mapper
.
findAllCampsiteShops
(
campsiteShopAdminFindDTO
));
PageDataVO
<
CampsiteShopAdminPageDTO
>
campsiteShopAdminpageDTOPageDataVO
=
PageDataVO
.
pageInfo
(
campsiteShopAdminFindDTO
.
getPage
(),
campsiteShopAdminFindDTO
.
getLimit
(),
()
->
mapper
.
findAllCampsiteShops
(
campsiteShopAdminFindDTO
));
List
<
CampsiteShopAdminPageDTO
>
campsiteShopAdminPageDTOS
=
campsiteShopAdminpageDTOPageDataVO
.
getData
();
List
<
CampsiteShopAdminPageDTO
>
campsiteShopAdminPageDTOS
=
campsiteShopAdminpageDTOPageDataVO
.
getData
();
if
(
log
.
isDebugEnabled
())
{
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"查询结果:【{}】"
,
campsiteShopAdminPageDTOS
);
log
.
debug
(
"查询结果:【{}】"
,
campsiteShopAdminPageDTOS
);
}
}
PageDataVO
<
CampsiteShopAdminPageVo
>
campsiteShopAdminPageDataVos
=
new
PageDataVO
<>();
if
(
CollectionUtils
.
isEmpty
(
campsiteShopAdminPageDTOS
))
{
if
(
CollectionUtils
.
isEmpty
(
campsiteShopAdminPageDTOS
))
{
return
campsiteShopAdminPageDataVos
;
return
campsiteShopAdminPageDataVos
;
}
}
//转换成营地ids
List
<
Integer
>
campsiteShopIds
=
campsiteShopAdminPageDTOS
.
stream
().
map
(
CampsiteShopAdminPageDTO:
:
getId
).
collect
(
Collectors
.
toList
());
List
<
Integer
>
campsiteShopIds
=
campsiteShopAdminPageDTOS
.
stream
().
map
(
CampsiteShopAdminPageDTO:
:
getId
).
collect
(
Collectors
.
toList
());
//根据营地ids查询营地对应的标签 键营地id 值对应的标签列表
//根据营地ids查询营地对应的标签 键营地id 值对应的标签列表
Map
<
Integer
,
List
<
String
>>
shopTagsMap
=
campsiteShopTagBiz
.
findByCampsiteShopIds
(
campsiteShopIds
);
Map
<
Integer
,
List
<
String
>>
shop
IdOf
TagsMap
=
campsiteShopTagBiz
.
findByCampsiteShopIds
(
campsiteShopIds
);
if
(
log
.
isDebugEnabled
())
{
if
(
log
.
isDebugEnabled
())
{
log
.
debug
(
"营地id为:【{}】的类型【{}】"
,
campsiteShopIds
,
shopTagsMap
);
log
.
debug
(
"营地id为:【{}】的类型【{}】"
,
campsiteShopIds
,
shop
IdOf
TagsMap
);
}
}
campsiteShopAdminPageDTOS
=
campsiteShopAdminPageDTOS
.
stream
().
peek
(
campsiteShopAdminPageDTO
->
{
campsiteShopAdminPageDTOS
=
campsiteShopAdminPageDTOS
.
stream
().
peek
(
campsiteShopAdminPageDTO
->
{
if
(
Objects
.
nonNull
(
shopTagsMap
))
{
if
(
Objects
.
nonNull
(
shop
IdOf
TagsMap
))
{
List
<
String
>
tagNames
=
shopTagsMap
.
get
(
campsiteShopAdminPageDTO
.
getId
());
List
<
String
>
tagNames
=
shop
IdOf
TagsMap
.
get
(
campsiteShopAdminPageDTO
.
getId
());
campsiteShopAdminPageDTO
.
setStoreTypeName
(
tagNames
==
null
?
new
ArrayList
<
String
>()
:
tagNames
);
campsiteShopAdminPageDTO
.
setStoreTypeName
(
tagNames
==
null
?
new
ArrayList
<
String
>()
:
tagNames
);
}
}
}).
sorted
(
Comparator
.
comparing
(
CampsiteShopAdminPageDTO:
:
getHot
).
reversed
().
thenComparing
(
CampsiteShopAdminPageDTO:
:
getCrtTime
).
reversed
()).
collect
(
Collectors
.
toList
());
}).
sorted
(
Comparator
.
comparing
(
CampsiteShopAdminPageDTO:
:
getHot
).
reversed
().
thenComparing
(
CampsiteShopAdminPageDTO:
:
getCrtTime
).
reversed
()).
collect
(
Collectors
.
toList
());
//组装数据
//组装数据
campsiteShopAdminPageDataVos
.
setTotalPage
(
campsiteShopAdminpageDTOPageDataVO
.
getTotalPage
());
campsiteShopAdminPageDataVos
.
setTotalPage
(
campsiteShopAdminpageDTOPageDataVO
.
getTotalPage
());
campsiteShopAdminPageDataVos
.
setTotalCount
(
campsiteShopAdminpageDTOPageDataVO
.
getTotalCount
());
campsiteShopAdminPageDataVos
.
setTotalCount
(
campsiteShopAdminpageDTOPageDataVO
.
getTotalCount
());
...
@@ -222,12 +215,7 @@ public class CampsiteShopBiz extends BaseBiz<CampsiteShopMapper, CampsiteShop> {
...
@@ -222,12 +215,7 @@ public class CampsiteShopBiz extends BaseBiz<CampsiteShopMapper, CampsiteShop> {
return
campsiteShopAdminPageDataVos
;
return
campsiteShopAdminPageDataVos
;
}
}
/**
* 营地保存或更新
*
* @param campsiteShopAdminDTO
* @return
*/
@Transactional
(
rollbackFor
=
Exception
.
class
,
propagation
=
Propagation
.
REQUIRED
)
@Transactional
(
rollbackFor
=
Exception
.
class
,
propagation
=
Propagation
.
REQUIRED
)
public
int
saveCampsiteShop
(
CampsiteShopAdminDTO
campsiteShopAdminDTO
)
{
public
int
saveCampsiteShop
(
CampsiteShopAdminDTO
campsiteShopAdminDTO
)
{
CampsiteShop
campsiteShop
=
new
CampsiteShop
();
CampsiteShop
campsiteShop
=
new
CampsiteShop
();
...
@@ -260,17 +248,12 @@ public class CampsiteShopBiz extends BaseBiz<CampsiteShopMapper, CampsiteShop> {
...
@@ -260,17 +248,12 @@ public class CampsiteShopBiz extends BaseBiz<CampsiteShopMapper, CampsiteShop> {
//保存或更新 * 营地与营地类型信息
//保存或更新 * 营地与营地类型信息
List
<
Integer
>
campsiteTagDTOS
=
campsiteShopAdminDTO
.
getCampsiteTagDTOS
();
List
<
Integer
>
campsiteTagDTOS
=
campsiteShopAdminDTO
.
getCampsiteTagDTOS
();
campsiteShopTagBiz
.
saveBatch
(
campsiteTagDTOS
,
campsiteShop
.
getId
());
campsiteShopTagBiz
.
saveBatch
(
campsiteTagDTOS
,
campsiteShop
.
getId
());
redisTemplate
.
delete
(
CAMPSITE_
CACHE
);
redisTemplate
.
delete
(
CAMPSITE_
LIST_CACHE_PREKEY
);
return
effectRows
;
return
effectRows
;
}
}
/**
* 编辑查询
public
CampsiteShopAdminVO
findCampsiteById
(
Integer
id
)
{
*
* @param id
* @return
*/
public
CampsiteShopAdminVO
findByCampsiteId
(
Integer
id
)
{
CampsiteShopAdminVO
campsiteShopAdminVO
=
new
CampsiteShopAdminVO
();
CampsiteShopAdminVO
campsiteShopAdminVO
=
new
CampsiteShopAdminVO
();
CampsiteShop
campsiteShop
=
new
CampsiteShop
();
CampsiteShop
campsiteShop
=
new
CampsiteShop
();
campsiteShop
.
setId
(
id
);
campsiteShop
.
setId
(
id
);
...
@@ -301,8 +284,8 @@ public class CampsiteShopBiz extends BaseBiz<CampsiteShopMapper, CampsiteShop> {
...
@@ -301,8 +284,8 @@ public class CampsiteShopBiz extends BaseBiz<CampsiteShopMapper, CampsiteShop> {
}
}
campsiteShopAdminVO
.
setCarouse
(
campsiteShopAdminVO
.
getCarouse
()
==
null
?
new
ArrayList
<
CampsiteShopCarouselVo
>()
:
campsiteShopAdminVO
.
getCarouse
());
campsiteShopAdminVO
.
setCarouse
(
campsiteShopAdminVO
.
getCarouse
()
==
null
?
new
ArrayList
<
CampsiteShopCarouselVo
>()
:
campsiteShopAdminVO
.
getCarouse
());
campsiteShopAdminVO
.
setCampsiteTagListVos
(
campsiteShopAdminVO
.
getCampsiteTagListVos
()
==
null
?
new
ArrayList
<
CampsiteTagListVo
>()
:
campsiteShopAdminVO
.
getCampsiteTagListVos
());
campsiteShopAdminVO
.
setCampsiteTagListVos
(
campsiteShopAdminVO
.
getCampsiteTagListVos
()
==
null
?
new
ArrayList
<
CampsiteTagListVo
>()
:
campsiteShopAdminVO
.
getCampsiteTagListVos
());
redisTemplate
.
delete
(
String
.
format
(
"%s%d"
,
CAMSITE_DETAIL_CACHE
,
id
));
redisTemplate
.
delete
(
String
.
format
(
"%s%d"
,
CAMSITE_DETAIL_CACHE_PREKEY
,
id
));
redisTemplate
.
delete
(
CAMPSITE_
CACHE
);
redisTemplate
.
delete
(
CAMPSITE_
LIST_CACHE_PREKEY
);
return
campsiteShopAdminVO
;
return
campsiteShopAdminVO
;
}
}
...
@@ -314,37 +297,26 @@ public class CampsiteShopBiz extends BaseBiz<CampsiteShopMapper, CampsiteShop> {
...
@@ -314,37 +297,26 @@ public class CampsiteShopBiz extends BaseBiz<CampsiteShopMapper, CampsiteShop> {
*/
*/
public
int
updateCampsiteSatus
(
int
id
)
{
public
int
updateCampsiteSatus
(
int
id
)
{
int
effectRows
=
mapper
.
updateCampsiteStatusById
(
id
,
1
);
int
effectRows
=
mapper
.
updateCampsiteStatusById
(
id
,
1
);
if
(
effectRows
>
0
)
{
if
(
effectRows
>
0
)
{
redisTemplate
.
delete
(
String
.
format
(
"%s%d"
,
CAMSITE_DETAIL_CACHE
,
id
));
redisTemplate
.
delete
(
String
.
format
(
"%s%d"
,
CAMSITE_DETAIL_CACHE_PREKEY
,
id
));
redisTemplate
.
delete
(
CAMPSITE_
CACHE
);
redisTemplate
.
delete
(
CAMPSITE_
LIST_CACHE_PREKEY
);
}
}
return
effectRows
;
return
effectRows
;
}
}
/**
* 上下架
*
public
int
upperOrLowerShelves
(
Integer
id
,
Integer
status
)
{
* @param id
* @param status
* @return
*/
public
int
updateCampsiteSaleStatus
(
Integer
id
,
Integer
status
)
{
int
effectRows
=
mapper
.
updateCampsiteSaleStatusById
(
id
,
status
);
int
effectRows
=
mapper
.
updateCampsiteSaleStatusById
(
id
,
status
);
if
(
effectRows
>
0
)
{
if
(
effectRows
>
0
)
{
redisTemplate
.
delete
(
String
.
format
(
"%s%d"
,
CAMSITE_DETAIL_CACHE
,
id
));
redisTemplate
.
delete
(
String
.
format
(
"%s%d"
,
CAMSITE_DETAIL_CACHE_PREKEY
,
id
));
redisTemplate
.
delete
(
CAMPSITE_
CACHE
);
redisTemplate
.
delete
(
CAMPSITE_
LIST_CACHE_PREKEY
);
}
}
return
effectRows
;
return
effectRows
;
}
}
/**
* 检验营地名称是否存在
public
Boolean
checkCampsiteNameExist
(
Integer
id
,
String
name
)
{
*
* @param id
* @param name
* @return
*/
public
Boolean
chekcCampsiteNameExist
(
Integer
id
,
String
name
)
{
int
count
=
mapper
.
checkNameExist
(
id
,
name
);
int
count
=
mapper
.
checkNameExist
(
id
,
name
);
if
(
count
==
0
)
{
if
(
count
==
0
)
{
return
false
;
return
false
;
...
@@ -352,14 +324,8 @@ public class CampsiteShopBiz extends BaseBiz<CampsiteShopMapper, CampsiteShop> {
...
@@ -352,14 +324,8 @@ public class CampsiteShopBiz extends BaseBiz<CampsiteShopMapper, CampsiteShop> {
return
true
;
return
true
;
}
}
/**
private
long
transformStartTime
(
Long
startTime
)
{
* 处理开始时间
return
LocalDateTime
.
ofInstant
(
new
Date
(
startTime
).
toInstant
(),
ZoneOffset
.
ofHours
(+
8
))
*
* @param time
* @return
*/
private
long
processStartTime
(
Long
time
)
{
return
LocalDateTime
.
ofInstant
(
new
Date
(
time
).
toInstant
(),
ZoneOffset
.
ofHours
(+
8
))
.
withHour
(
0
)
.
withHour
(
0
)
.
withMinute
(
0
)
.
withMinute
(
0
)
.
withSecond
(
0
)
.
withSecond
(
0
)
...
@@ -368,14 +334,9 @@ public class CampsiteShopBiz extends BaseBiz<CampsiteShopMapper, CampsiteShop> {
...
@@ -368,14 +334,9 @@ public class CampsiteShopBiz extends BaseBiz<CampsiteShopMapper, CampsiteShop> {
.
toEpochMilli
();
.
toEpochMilli
();
}
}
/**
* 处理结束时间
private
long
transformEndTime
(
Long
endTime
)
{
*
return
LocalDateTime
.
ofInstant
(
new
Date
(
endTime
).
toInstant
(),
ZoneOffset
.
ofHours
(+
8
))
* @param time
* @return
*/
private
long
processEndTime
(
Long
time
)
{
return
LocalDateTime
.
ofInstant
(
new
Date
(
time
).
toInstant
(),
ZoneOffset
.
ofHours
(+
8
))
.
withHour
(
23
)
.
withHour
(
23
)
.
withMinute
(
59
)
.
withMinute
(
59
)
.
withSecond
(
59
)
.
withSecond
(
59
)
...
@@ -411,19 +372,4 @@ public class CampsiteShopBiz extends BaseBiz<CampsiteShopMapper, CampsiteShop> {
...
@@ -411,19 +372,4 @@ public class CampsiteShopBiz extends BaseBiz<CampsiteShopMapper, CampsiteShop> {
s
=
s
*
EARTH_RADIUS
;
s
=
s
*
EARTH_RADIUS
;
return
s
;
return
s
;
}
}
/**
* 首页营地列表
*
* @param page
* @param limit
* @return
*/
public
List
<
GoodDataVO
>
getAllByHome
(
Integer
page
,
Integer
limit
)
{
return
mapper
.
findAllByHome
((
page
-
1
)
*
limit
,
limit
);
}
;
}
}
\ No newline at end of file
xx-campsite/xx-campsite-server/src/main/java/com/xxfc/platform/campsite/rest/admin/CampsiteShopAdminController.java
View file @
48af7a15
...
@@ -56,8 +56,9 @@ public class CampsiteShopAdminController extends BaseController<CampsiteShopBiz,
...
@@ -56,8 +56,9 @@ public class CampsiteShopAdminController extends BaseController<CampsiteShopBiz,
@ApiOperation
(
"营地上下架"
)
@ApiOperation
(
"营地上下架"
)
@PutMapping
(
"/saleStatus"
)
@PutMapping
(
"/saleStatus"
)
public
ObjectRestResponse
<
Void
>
updateSaleStatus
(
@RequestParam
(
"id"
)
Integer
id
,
@RequestParam
(
"status"
)
Integer
status
){
public
ObjectRestResponse
<
Void
>
updateSaleStatus
(
@RequestParam
(
"id"
)
Integer
id
,
@RequestParam
(
"status"
)
Integer
status
){
int
effectRows
=
getBaseBiz
().
up
dateCampsiteSaleStatu
s
(
id
,
status
);
int
effectRows
=
getBaseBiz
().
up
perOrLowerShelve
s
(
id
,
status
);
if
(
effectRows
>
0
){
if
(
effectRows
>
0
){
return
ObjectRestResponse
.
succ
();
return
ObjectRestResponse
.
succ
();
}
}
return
ObjectRestResponse
.
createDefaultFail
();
return
ObjectRestResponse
.
createDefaultFail
();
...
@@ -66,14 +67,14 @@ public class CampsiteShopAdminController extends BaseController<CampsiteShopBiz,
...
@@ -66,14 +67,14 @@ public class CampsiteShopAdminController extends BaseController<CampsiteShopBiz,
@ApiOperation
(
"检验营地名称"
)
@ApiOperation
(
"检验营地名称"
)
@GetMapping
(
"/exist"
)
@GetMapping
(
"/exist"
)
public
ObjectRestResponse
<
Boolean
>
checkCampsiteNameExist
(
@RequestParam
(
value
=
"id"
,
required
=
false
)
Integer
id
,
@RequestParam
(
"name"
)
String
name
){
public
ObjectRestResponse
<
Boolean
>
checkCampsiteNameExist
(
@RequestParam
(
value
=
"id"
,
required
=
false
)
Integer
id
,
@RequestParam
(
"name"
)
String
name
){
Boolean
exist
=
getBaseBiz
().
che
kc
CampsiteNameExist
(
id
,
name
==
null
?
""
:
name
.
trim
());
Boolean
exist
=
getBaseBiz
().
che
ck
CampsiteNameExist
(
id
,
name
==
null
?
""
:
name
.
trim
());
return
ObjectRestResponse
.
succ
(
exist
);
return
ObjectRestResponse
.
succ
(
exist
);
}
}
@ApiOperation
(
"营地编辑查询"
)
@ApiOperation
(
"营地编辑查询"
)
@GetMapping
(
"/campsite/{id}"
)
@GetMapping
(
"/campsite/{id}"
)
public
ObjectRestResponse
<
CampsiteShopAdminVO
>
findByCampsiteId
(
@PathVariable
(
value
=
"id"
)
Integer
id
){
public
ObjectRestResponse
<
CampsiteShopAdminVO
>
findByCampsiteId
(
@PathVariable
(
value
=
"id"
)
Integer
id
){
CampsiteShopAdminVO
campsiteShopAdminVO
=
getBaseBiz
().
find
ByCampsite
Id
(
id
);
CampsiteShopAdminVO
campsiteShopAdminVO
=
getBaseBiz
().
find
CampsiteBy
Id
(
id
);
return
ObjectRestResponse
.
succ
(
campsiteShopAdminVO
);
return
ObjectRestResponse
.
succ
(
campsiteShopAdminVO
);
}
}
}
}
\ No newline at end of file
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/weixin/api/WXPay.java
View file @
48af7a15
...
@@ -34,7 +34,7 @@ import com.alibaba.fastjson.JSONObject;
...
@@ -34,7 +34,7 @@ import com.alibaba.fastjson.JSONObject;
@Slf4j
@Slf4j
public
class
WXPay
{
public
class
WXPay
{
/**
/**
*
公众号
支付
*
JSAPI
支付
* @param total_fee
* @param total_fee
* @param body
* @param body
* @param notify_url
* @param notify_url
...
...
xx-universal/xx-universal-api/src/main/java/com/xxfc/platform/universal/weixin/api/WXPrepay.java
View file @
48af7a15
...
@@ -228,7 +228,7 @@ public class WXPrepay {
...
@@ -228,7 +228,7 @@ public class WXPrepay {
treeMap
.
put
(
"total_fee"
,
this
.
total_fee
);
treeMap
.
put
(
"total_fee"
,
this
.
total_fee
);
treeMap
.
put
(
"spbill_create_ip"
,
this
.
spbill_create_ip
);
treeMap
.
put
(
"spbill_create_ip"
,
this
.
spbill_create_ip
);
treeMap
.
put
(
"trade_type"
,
this
.
trade_type
);
treeMap
.
put
(
"trade_type"
,
this
.
trade_type
);
treeMap
.
put
(
"
sub_
openid"
,
this
.
openid
);
treeMap
.
put
(
"openid"
,
this
.
openid
);
treeMap
.
put
(
"notify_url"
,
this
.
notify_url
);
treeMap
.
put
(
"notify_url"
,
this
.
notify_url
);
StringBuilder
sb
=
new
StringBuilder
();
StringBuilder
sb
=
new
StringBuilder
();
...
...
xx-universal/xx-universal-server/src/main/java/com/xxfc/platform/universal/biz/OrderPayBiz.java
View file @
48af7a15
...
@@ -66,8 +66,14 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper,OrderPay> {
...
@@ -66,8 +66,14 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper,OrderPay> {
if
(
amount
<=
0
)
{
if
(
amount
<=
0
)
{
amount
=
1
;
amount
=
1
;
}
}
Integer
type
=
orderPayVo
.
getType
();
String
jsParam
=
WXPay
.
apppay
(
amount
+
""
,
orderPayVo
.
getBody
(),
"https://"
+
SystemConfig
.
weixinHost
+
"/api/universal/pay/app/unauth/notify"
,
trade_no
,
orderPayVo
.
getBuyerIp
(),
0
);
String
jsParam
=
""
;
String
notify_url
=
"https://"
+
SystemConfig
.
weixinHost
+
"/api/universal/pay/app/unauth/notify"
;
if
(
type
!=
null
&&
type
==
2
){
jsParam
=
WXPay
.
webPay
(
amount
+
""
,
orderPayVo
.
getBody
(),
notify_url
,
trade_no
,
orderPayVo
.
getBuyerIp
(),
orderPayVo
.
getBuyerAccount
());
}
else
{
jsParam
=
WXPay
.
apppay
(
amount
+
""
,
orderPayVo
.
getBody
(),
notify_url
,
trade_no
,
orderPayVo
.
getBuyerIp
(),
0
);
}
log
.
info
(
"报名费回调路径jsParam:"
+
jsParam
);
log
.
info
(
"报名费回调路径jsParam:"
+
jsParam
);
if
(!
StringUtils
.
isBlank
(
jsParam
))
if
(!
StringUtils
.
isBlank
(
jsParam
))
{
{
...
@@ -111,7 +117,8 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper,OrderPay> {
...
@@ -111,7 +117,8 @@ public class OrderPayBiz extends BaseBiz<OrderPayMapper,OrderPay> {
OrderPay
pay
=
list
.
get
(
0
);
OrderPay
pay
=
list
.
get
(
0
);
if
(
StringUtils
.
isNotBlank
(
pay
.
getNotifyUrl
())){
if
(
StringUtils
.
isNotBlank
(
pay
.
getNotifyUrl
())){
String
url
=
pay
.
getNotifyUrl
();
String
url
=
pay
.
getNotifyUrl
();
url
+=
"&tradeNo="
+
orderNo
;
Integer
type
=
pay
.
getType
()==
null
?
1
:
pay
.
getType
();
url
+=
"&tradeNo="
+
orderNo
+
"&type="
+
type
;
log
.
error
(
"---支付回调处理---orderNo======="
+
orderNo
+
"----notifyUrl===="
+
url
);
log
.
error
(
"---支付回调处理---orderNo======="
+
orderNo
+
"----notifyUrl===="
+
url
);
String
result
=
""
;
String
result
=
""
;
if
(
url
.
contains
(
"https"
)||
url
.
contains
(
"HTTPS"
)){
if
(
url
.
contains
(
"https"
)||
url
.
contains
(
"HTTPS"
)){
...
...
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