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
91ccc385
Commit
91ccc385
authored
Oct 06, 2020
by
周健威
Browse files
Options
Browse Files
Download
Plain Diff
Merge remote-tracking branch 'origin/dev-chw' into dev-chw
parents
2f7c1c31
bf45530c
Changes
30
Hide whitespace changes
Inline
Side-by-side
Showing
30 changed files
with
1275 additions
and
41 deletions
+1275
-41
CheckObjectIsNullUtils.java
.../wxiaoqi/security/common/util/CheckObjectIsNullUtils.java
+46
-0
MemberRightType.java
...thub/wxiaoqi/security/admin/constant/MemberRightType.java
+22
-0
BaseMemberLevelFindDTO.java
...ub/wxiaoqi/security/admin/dto/BaseMemberLevelFindDTO.java
+19
-0
BaseMemberLevelPageDTO.java
...ub/wxiaoqi/security/admin/dto/BaseMemberLevelPageDTO.java
+21
-0
MemberLevelRightsDTO.java
...thub/wxiaoqi/security/admin/dto/MemberLevelRightsDTO.java
+41
-0
UserCommentFindDTO.java
...github/wxiaoqi/security/admin/dto/UserCommentFindDTO.java
+22
-0
AppUserRelation.java
...github/wxiaoqi/security/admin/entity/AppUserRelation.java
+5
-0
BaseMemberLevel.java
...github/wxiaoqi/security/admin/entity/BaseMemberLevel.java
+198
-0
BranchCompany.java
...m/github/wxiaoqi/security/admin/entity/BranchCompany.java
+12
-0
CompanyInfoApply.java
...ithub/wxiaoqi/security/admin/entity/CompanyInfoApply.java
+6
-0
UserComment.java
...com/github/wxiaoqi/security/admin/entity/UserComment.java
+79
-0
UserCommentVo.java
...a/com/github/wxiaoqi/security/admin/vo/UserCommentVo.java
+31
-0
AppUserRelationBiz.java
...github/wxiaoqi/security/admin/biz/AppUserRelationBiz.java
+34
-27
BaseMemberLevelBiz.java
...github/wxiaoqi/security/admin/biz/BaseMemberLevelBiz.java
+236
-0
BranchCompanyBiz.java
...m/github/wxiaoqi/security/admin/biz/BranchCompanyBiz.java
+10
-0
CompanyInfoBiz.java
...com/github/wxiaoqi/security/admin/biz/CompanyInfoBiz.java
+5
-1
UserCommentBiz.java
...com/github/wxiaoqi/security/admin/biz/UserCommentBiz.java
+109
-0
BaseMemberLevelMapper.java
.../wxiaoqi/security/admin/mapper/BaseMemberLevelMapper.java
+38
-0
UserCommentMapper.java
...thub/wxiaoqi/security/admin/mapper/UserCommentMapper.java
+21
-0
AppUserCommentController.java
...wxiaoqi/security/admin/rest/AppUserCommentController.java
+50
-0
AdminBaseMemberLevelController.java
...rity/admin/rest/admin/AdminBaseMemberLevelController.java
+57
-0
AppPermissionService.java
...aoqi/security/admin/rpc/service/AppPermissionService.java
+37
-10
UserCommentMapper.xml
...ace-admin/src/main/resources/mapper/UserCommentMapper.xml
+25
-0
VehicleExtensionFindDTO.java
...fc/platform/vehicle/pojo/dto/VehicleExtensionFindDTO.java
+27
-0
VehicleExtensionVO.java
...com/xxfc/platform/vehicle/pojo/vo/VehicleExtensionVO.java
+5
-0
VehicleBiz.java
...c/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
+9
-3
VehicleExtensionBiz.java
...va/com/xxfc/platform/vehicle/biz/VehicleExtensionBiz.java
+35
-0
VehicleEextensionMapper.java
...xxfc/platform/vehicle/mapper/VehicleEextensionMapper.java
+4
-0
AdminVehicleController.java
...c/platform/vehicle/rest/admin/AdminVehicleController.java
+19
-0
VehicleExtensionMapper.xml
...rver/src/main/resources/mapper/VehicleExtensionMapper.xml
+52
-0
No files found.
ace-common/src/main/java/com/github/wxiaoqi/security/common/util/CheckObjectIsNullUtils.java
0 → 100644
View file @
91ccc385
package
com
.
github
.
wxiaoqi
.
security
.
common
.
util
;
import
java.lang.reflect.Field
;
import
java.lang.reflect.Type
;
/**
* <p>Description: 判断对象是否为空,进一步判断对象中的属性是否都为空 </p>
* @author duanfeixia
* @date 2018年11月12日
*/
public
class
CheckObjectIsNullUtils
{
/**
* 判断对象是否为空,且对象的所有属性都为空
* ps: boolean类型会有默认值false 判断结果不会为null 会影响判断结果
* 序列化的默认值也会影响判断结果
* @param object
* @return
*/
public
static
boolean
objCheckIsNull
(
Object
object
){
Class
clazz
=
(
Class
)
object
.
getClass
();
// 得到类对象
Field
fields
[]
=
clazz
.
getDeclaredFields
();
// 得到所有属性
boolean
flag
=
true
;
//定义返回结果,默认为true
for
(
Field
field
:
fields
){
field
.
setAccessible
(
true
);
Object
fieldValue
=
null
;
try
{
fieldValue
=
field
.
get
(
object
);
//得到属性值
Type
fieldType
=
field
.
getGenericType
();
//得到属性类型
String
fieldName
=
field
.
getName
();
// 得到属性名
System
.
out
.
println
(
"属性类型:"
+
fieldType
+
",属性名:"
+
fieldName
+
",属性值:"
+
fieldValue
);
}
catch
(
IllegalArgumentException
e
)
{
e
.
printStackTrace
();
}
catch
(
IllegalAccessException
e
)
{
e
.
printStackTrace
();
}
if
(
fieldValue
!=
null
){
//只要有一个属性值不为null 就返回false 表示对象不为null
flag
=
false
;
break
;
}
}
return
flag
;
}
}
\ No newline at end of file
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/constant/MemberRightType.java
0 → 100644
View file @
91ccc385
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
constant
;
public
enum
MemberRightType
{
DISCOUNT
(
0
,
"折扣"
),
COUNPON
(
1
,
"优惠券"
),
FREE_SHIPPING
(
2
,
"包邮"
);
private
Integer
type
;
private
String
name
;
MemberRightType
(
Integer
type
,
String
name
)
{
this
.
type
=
type
;
this
.
name
=
name
;
}
public
Integer
getType
()
{
return
type
;
}
public
String
getName
()
{
return
name
;
}
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/dto/BaseMemberLevelFindDTO.java
0 → 100644
View file @
91ccc385
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
dto
;
import
com.github.wxiaoqi.security.common.vo.PageParam
;
import
lombok.Data
;
import
java.util.List
;
/**
* @author libin
* @version 1.0
* @description
* @data 2020/6/24 9:18
*/
@Data
public
class
BaseMemberLevelFindDTO
extends
PageParam
{
String
appId
;
List
<
Integer
>
levelIds
;
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/dto/BaseMemberLevelPageDTO.java
0 → 100644
View file @
91ccc385
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
dto
;
import
com.github.wxiaoqi.security.admin.entity.BaseUserMemberLevel
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
lombok.Data
;
import
java.util.List
;
/**
* @author libin
* @version 1.0
* @description
* @data 2020/6/24 9:21
*/
@Data
public
class
BaseMemberLevelPageDTO
{
private
Integer
maxLevel
;
private
Integer
specificTime
;
private
PageDataVO
<
BaseUserMemberLevel
>
memberLevels
;
private
List
<
MemberLevelRightsDTO
>
memberLevelRightsModel
;
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/dto/MemberLevelRightsDTO.java
0 → 100644
View file @
91ccc385
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
dto
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
java.util.List
;
/**
* @author libin
* @version 1.0
* @description
* @data 2020/6/24 10:25
*/
@Data
@AllArgsConstructor
@NoArgsConstructor
public
class
MemberLevelRightsDTO
{
private
Integer
type
;
private
MemberRights
rights
;
private
String
name
;
private
Integer
status
;
private
Boolean
sysn
;
@Data
@AllArgsConstructor
@NoArgsConstructor
public
static
class
MemberRights
{
private
Integer
discount
;
private
List
<
Coupon
>
coupons
;
private
Boolean
isFreeShipping
;
}
@Data
@AllArgsConstructor
@NoArgsConstructor
public
static
class
Coupon
{
private
Long
id
;
private
String
name
;
}
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/dto/UserCommentFindDTO.java
0 → 100644
View file @
91ccc385
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
dto
;
import
com.github.wxiaoqi.security.common.vo.PageParam
;
import
lombok.Data
;
import
java.util.List
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/8/23 16:27
*/
@Data
public
class
UserCommentFindDTO
extends
PageParam
{
private
Integer
parentId
;
private
Integer
soureId
;
private
Integer
rootParentId
;
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/entity/AppUserRelation.java
View file @
91ccc385
...
@@ -40,6 +40,11 @@ public class AppUserRelation implements Serializable {
...
@@ -40,6 +40,11 @@ public class AppUserRelation implements Serializable {
@Column
(
name
=
"parent_id"
)
@Column
(
name
=
"parent_id"
)
@ApiModelProperty
(
value
=
"父id"
)
@ApiModelProperty
(
value
=
"父id"
)
private
Integer
parentId
;
private
Integer
parentId
;
@Column
(
name
=
"company_id"
)
@ApiModelProperty
(
value
=
"店铺id"
)
private
Integer
companyId
;
/**
/**
* 绑定的来源:1-app;2-小程序
* 绑定的来源:1-app;2-小程序
...
...
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/entity/BaseMemberLevel.java
0 → 100644
View file @
91ccc385
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
entity
;
import
cn.hutool.json.JSONUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.TypeReference
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
com.github.wxiaoqi.security.admin.dto.MemberLevelRightsDTO
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
org.springframework.util.StringUtils
;
import
javax.persistence.*
;
import
java.io.Serializable
;
import
java.math.BigDecimal
;
import
java.util.Comparator
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
* 会员等级设置
*
* @author hezhen
* @email 18178966185@163.com
* @date 2020-06-24 09:12:21
*/
@Data
@Table
(
name
=
"base_member_level"
)
public
class
BaseMemberLevel
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 主键(也等值level级别(因级别变动))
*/
@Id
@GeneratedValue
(
generator
=
"JDBC"
)
@ApiModelProperty
(
"主键(也等值level级别(因级别变动))"
)
private
Integer
id
;
/**
* 等级名称(VIP1,VIP2,VIP3........),展示使用
*/
@Column
(
name
=
"level"
)
@ApiModelProperty
(
value
=
"等级名称(VIP1,VIP2,VIP3........),展示使用"
)
private
Integer
level
;
/**
* 升级条件 0:充值 1:积分 2:注册自动升级
*/
@Column
(
name
=
"up_condition_type"
)
@ApiModelProperty
(
value
=
"升级条件 0:充值 1:积分 2:注册自动升级 "
)
private
Integer
upConditionType
;
/**
* 充值类型 0:一次性充值 1:累计充值
*/
@Column
(
name
=
"recharge_type"
)
@ApiModelProperty
(
value
=
"充值类型 0:一次性充值 1:累计充值"
)
private
Integer
rechargeType
;
/**
* 一次性充值|累积充值
*/
@Column
(
name
=
"money"
)
@ApiModelProperty
(
value
=
"一次性充值|累积充值"
)
private
BigDecimal
money
;
/**
* 积分
*/
@Column
(
name
=
"points"
)
@ApiModelProperty
(
value
=
"积分"
)
private
Integer
points
;
/**
*
*/
@Column
(
name
=
"crt_time"
)
@ApiModelProperty
(
value
=
""
,
hidden
=
true
)
private
Long
crtTime
;
/**
*
*/
@Column
(
name
=
"upd_time"
)
@ApiModelProperty
(
value
=
""
,
hidden
=
true
)
private
Long
updTime
;
/**
* 会员名称
*/
@Column
(
name
=
"member_name"
)
@ApiModelProperty
(
value
=
"会员名称"
)
private
String
memberName
;
/**
* 是否删除 0:未删除 1:已删除
*/
@Column
(
name
=
"is_del"
)
@ApiModelProperty
(
value
=
"是否删除 0:未删除 1:已删除"
)
private
Integer
isDel
;
/**
* 图标
*/
@Column
(
name
=
"icon"
)
@ApiModelProperty
(
value
=
"图标"
)
private
String
icon
;
/**
* 有效数;-1是永久有效
*/
@Column
(
name
=
"end_date"
)
@ApiModelProperty
(
value
=
"有效数;-1是永久有效"
)
private
Long
endDate
;
/**
* 描述
*/
@Column
(
name
=
"describes"
)
@ApiModelProperty
(
value
=
"描述"
)
private
String
describes
;
/**
* 权益
*/
@Column
(
name
=
"rights"
)
@ApiModelProperty
(
value
=
"权益"
)
@JsonIgnore
private
String
rights
;
@Transient
private
Integer
maxLevel
;
@Transient
private
List
<
MemberLevelRightsDTO
>
memberRights
;
@ApiModelProperty
(
value
=
"升级条件"
)
@Transient
private
String
upConditionStr
;
@ApiModelProperty
(
value
=
"折扣"
)
@Transient
private
Integer
discount
;
public
List
<
MemberLevelRightsDTO
>
getMemberRights
()
{
if
(
StringUtils
.
hasText
(
getRights
())){
List
<
MemberLevelRightsDTO
>
rightsDTOS
=
JSON
.
parseObject
(
getRights
(),
new
TypeReference
<
List
<
MemberLevelRightsDTO
>>(){});
rightsDTOS
=
rightsDTOS
.
stream
().
sorted
(
Comparator
.
comparing
(
MemberLevelRightsDTO:
:
getType
)).
collect
(
Collectors
.
toList
());
return
rightsDTOS
;
}
return
memberRights
;
}
public
Integer
getDiscount
(){
discount
=
0
;
List
<
MemberLevelRightsDTO
>
rightsDTOS
=
getMemberRights
();
if
(
rightsDTOS
!=
null
&&
rightsDTOS
.
size
()
>
0
){
List
<
MemberLevelRightsDTO
>
rightsDTOList
=
rightsDTOS
.
stream
().
filter
(
x
->
x
.
getType
()
==
0
&&
x
.
getStatus
()
==
1
).
collect
(
Collectors
.
toList
());
if
(
rightsDTOList
!=
null
&&
rightsDTOList
.
size
()
>
0
){
MemberLevelRightsDTO
memberLevelRightsDTO
=
rightsDTOList
.
get
(
0
);
MemberLevelRightsDTO
.
MemberRights
rights
=
memberLevelRightsDTO
.
getRights
();
if
(
rights
!=
null
){
discount
=
rights
.
getDiscount
();
}
}
}
return
discount
;
}
public
String
getUpConditionStr
(){
upConditionStr
=
""
;
if
(
getUpConditionType
()
!=
null
){
if
(
getUpConditionType
()
==
0
){
if
(
getRechargeType
()
!=
null
&&
getRechargeType
()
==
0
){
upConditionStr
=
"一次性充值"
+
getMoney
();
}
else
if
(
getRechargeType
()
!=
null
&&
getRechargeType
()
==
1
){
upConditionStr
=
"累计充值"
+
getMoney
();
}
}
else
if
(
getUpConditionType
()
==
1
){
upConditionStr
=
"积分满"
+
getPoints
();
}
else
if
(
getUpConditionType
()
==
2
){
upConditionStr
=
"注册自动升级"
;
}
else
if
(
getUpConditionType
()
==
3
){
upConditionStr
=
"累计消费满"
+
getMoney
();
}
}
return
upConditionStr
;
}
public
static
void
main
(
String
[]
args
)
{
BaseUserMemberLevel
memberLevel
=
new
BaseUserMemberLevel
();
System
.
out
.
println
(
JSONUtil
.
wrap
(
memberLevel
,
false
));
}
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/entity/BranchCompany.java
View file @
91ccc385
...
@@ -119,6 +119,18 @@ public class BranchCompany {
...
@@ -119,6 +119,18 @@ public class BranchCompany {
*/
*/
@ApiModelProperty
(
"负责人联系方式"
)
@ApiModelProperty
(
"负责人联系方式"
)
private
String
leaderContactInfo
;
private
String
leaderContactInfo
;
@ApiModelProperty
(
"邀请码"
)
private
String
code
;
@ApiModelProperty
(
"邀请人id"
)
@Column
(
name
=
"inviter_account"
)
private
Integer
inviterAccount
;
/**
/**
* 分公司状态
* 分公司状态
*/
*/
...
...
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/entity/CompanyInfoApply.java
View file @
91ccc385
...
@@ -54,6 +54,12 @@ public class CompanyInfoApply {
...
@@ -54,6 +54,12 @@ public class CompanyInfoApply {
private
String
mobile
;
private
String
mobile
;
@ApiModelProperty
(
"邀请人id"
)
@Column
(
name
=
"inviter_account"
)
private
Integer
inviterAccount
;
@ApiModelProperty
(
"状态:0-待审核;1-审核成功;2-驳回"
)
@ApiModelProperty
(
"状态:0-待审核;1-审核成功;2-驳回"
)
private
Integer
status
;
private
Integer
status
;
...
...
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/entity/UserComment.java
0 → 100644
View file @
91ccc385
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
entity
;
import
com.fasterxml.jackson.annotation.JsonIgnore
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.persistence.*
;
import
java.util.Date
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/12/24 16:41
*/
@Data
@NoArgsConstructor
@AllArgsConstructor
@Entity
@Table
(
name
=
"user_comment"
)
public
class
UserComment
{
@Id
@GeneratedValue
(
generator
=
"JDBC"
)
private
Integer
id
;
/**
* 被评论id
*/
@Column
(
name
=
"parent_id"
)
private
Integer
parentId
;
/**
* 资源ID
*/
@Column
(
name
=
"soure_id"
)
private
Integer
soureId
;
/**
* 资源类型:1-活动;
*/
@Column
(
name
=
"soure_type"
)
private
Integer
soureType
;
/**
* 用户ID
*/
@Column
(
name
=
"user_id"
)
private
Integer
userId
;
/**
* 用户ID
*/
@Column
(
name
=
"comment_text"
)
private
String
commentText
;
/**
* 回复评论者的ID
*/
@Column
(
name
=
"to_user_id"
)
private
Integer
toUserId
;
/**
* 最上级id
*/
@Column
(
name
=
"root_parent_id"
)
private
Integer
rootParentId
;
/**
* 回复数量
*/
@Column
(
name
=
"reply_num"
)
private
Integer
replyNum
;
/**
*评论时间
*/
@Column
(
name
=
"create_time"
)
private
Date
createTime
;
/**
* 是否删除:0-正常;1-删除
*/
@Column
(
name
=
"is_del"
)
private
Integer
isDel
;
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/vo/UserCommentVo.java
0 → 100644
View file @
91ccc385
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
vo
;
import
com.github.wxiaoqi.security.admin.entity.UserComment
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.util.List
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/7/12 9:20
*/
@Data
public
class
UserCommentVo
extends
UserComment
{
@ApiModelProperty
(
"用户名称"
)
private
String
userName
;
@ApiModelProperty
(
"用户名称"
)
private
String
toUserName
;
private
PageDataVO
<
UserCommentVo
>
childer
;
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserRelationBiz.java
View file @
91ccc385
...
@@ -66,6 +66,9 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper, AppUserRe
...
@@ -66,6 +66,9 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper, AppUserRe
@Autowired
@Autowired
private
AppStaffUserBiz
staffUserBiz
;
private
AppStaffUserBiz
staffUserBiz
;
@Autowired
private
BranchCompanyBiz
companyBiz
;
private
static
final
HashMap
<
Integer
,
Boolean
>
map
=
new
HashMap
<>();
private
static
final
HashMap
<
Integer
,
Boolean
>
map
=
new
HashMap
<>();
private
static
final
HashMap
<
Integer
,
Boolean
>
parentMap
=
new
HashMap
<>();
private
static
final
HashMap
<
Integer
,
Boolean
>
parentMap
=
new
HashMap
<>();
...
@@ -115,54 +118,53 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper, AppUserRe
...
@@ -115,54 +118,53 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper, AppUserRe
* @param parentId
* @param parentId
*/
*/
@Transactional
(
rollbackFor
=
Exception
.
class
,
propagation
=
Propagation
.
REQUIRED
)
@Transactional
(
rollbackFor
=
Exception
.
class
,
propagation
=
Propagation
.
REQUIRED
)
public
void
bindRelation
(
Integer
userId
,
Integer
parentId
,
Integer
type
){
public
void
bindRelation
(
Integer
userId
,
Integer
parentId
,
Integer
companyId
,
Integer
type
){
try
{
try
{
if
(
userId
.
equals
(
parentId
)){
if
(
userId
.
equals
(
parentId
)){
log
.
info
(
"----userId==="
+
userId
+
"----parentId===="
+
parentId
+
"----自己不能成为自己的上线"
);
log
.
info
(
"----userId==="
+
userId
+
"----parentId===="
+
parentId
+
"----自己不能成为自己的上线"
);
return
;
return
;
}
}
if
(
parentId
>
0
){
/* AppUserVo appUserVo=userDetailBiz.getUserInfoById(userId);
AppUserVo
appUserVo
=
userDetailBiz
.
getUserInfoById
(
parentId
);
if
(
appUserVo
==
null
){
if (appUserVo==null){
log
.
info
(
"----userId==="
+
userId
+
"----parentId===="
+
parentId
+
"----该上线用户不存在"
);
log.info("----userId==="+userId+"----parentId===="+parentId+"----该用户不存在");
return
;
return;
}
}*/
AppUserRelation
relation
=
getMyBiz
().
getRelationByUserId
(
parentId
);
AppUserVo
appUserVo
=
userDetailBiz
.
getUserInfoById
(
parentId
);
if
(
relation
==
null
){
if
(
appUserVo
==
null
){
relation
=
new
AppUserRelation
();
log
.
info
(
"----userId==="
+
userId
+
"----parentId===="
+
parentId
+
"----该上线用户不存在"
);
relation
.
setUserId
(
parentId
);
return
;
relation
.
setBindType
(
type
);
insertSelective
(
relation
);
}
}
}
AppUserRelation
relation
=
getMyBiz
().
getRelationByUserId
(
parentId
);
Long
time
=
System
.
currentTimeMillis
();
Long
time
=
System
.
currentTimeMillis
();
if
(
relation
==
null
){
relation
=
new
AppUserRelation
();
relation
.
setUserId
(
parentId
);
relation
.
setBindType
(
type
);
insertSelective
(
relation
);
}
Long
bindTime
=
time
-
validTime
;
Long
bindTime
=
time
-
validTime
;
//判断用户是否有有效的下线
//判断用户是否有有效的下线
if
(
getCountByParentId
(
userId
,
bindTime
)==
0L
){
if
(
getCountByParentId
(
userId
,
bindTime
)==
0L
){
relation
=
getMyBiz
().
getRelationByUserId
(
userId
);
AppUserRelation
relation
=
getMyBiz
().
getRelationByUserId
(
userId
);
if
(
relation
==
null
){
if
(
relation
==
null
){
relation
=
new
AppUserRelation
();
relation
=
new
AppUserRelation
();
relation
.
setUserId
(
userId
);
relation
.
setUserId
(
userId
);
relation
.
setParentId
(
parentId
);
relation
.
setParentId
(
parentId
);
relation
.
setCompanyId
(
companyId
);
relation
.
setBindType
(
type
);
relation
.
setBindType
(
type
);
relation
.
setBindTime
(
time
);
relation
.
setBindTime
(
time
);
insertSelective
(
relation
);
insertSelective
(
relation
);
}
else
{
}
else
{
//判断用户是否有有效的上线
//判断用户是否有有效的上线
Integer
parentId1
=
relation
.
getParentId
()
==
null
?
0
:
relation
.
getParentId
();
Integer
companyId1
=
relation
.
getCompanyId
()
==
null
?
0
:
relation
.
getCompanyId
();
log
.
info
(
"----userId==="
+
userId
+
"----bindTime===="
+
bindTime
+
"----relation.getBindTime()==="
+
relation
.
getBindTime
());
log
.
info
(
"----userId==="
+
userId
+
"----bindTime===="
+
bindTime
+
"----relation.getBindTime()==="
+
relation
.
getBindTime
());
if
(
relation
.
getParentId
()==
null
||
relation
.
getParentId
()==
0
||(
relation
.
getIsForever
()!=
1
&&
validTime
>
0
&&
relation
.
getBindTime
()<
bindTime
)){
if
(
(
parentId1
==
0
&&
companyId1
==
0
)
||(
relation
.
getIsForever
()!=
1
&&
validTime
>
0
&&
relation
.
getBindTime
()<
bindTime
)){
relation
.
setParentId
(
parentId
);
relation
.
setParentId
(
parentId
);
relation
.
setCompanyId
(
companyId
);
relation
.
setBindType
(
type
);
relation
.
setBindType
(
type
);
relation
.
setBindTime
(
time
);
relation
.
setBindTime
(
time
);
getMyBiz
().
updRelation
(
relation
);
getMyBiz
().
updRelation
(
relation
);
}
}
}
}
if
(
relation
!=
null
){
if
(
relation
!=
null
&&
parentId
>
0
){
AppStaffUserDTO
staffUserDTO
=
new
AppStaffUserDTO
();
AppStaffUserDTO
staffUserDTO
=
new
AppStaffUserDTO
();
staffUserDTO
.
setSuId
(
relation
.
getParentId
());
staffUserDTO
.
setSuId
(
relation
.
getParentId
());
staffUserDTO
.
setUid
(
relation
.
getUserId
());
staffUserDTO
.
setUid
(
relation
.
getUserId
());
...
@@ -178,16 +180,21 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper, AppUserRe
...
@@ -178,16 +180,21 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper, AppUserRe
//首页关系绑定
//首页关系绑定
public
ObjectRestResponse
appBindRelation
(
Integer
userId
,
String
code
)
{
public
ObjectRestResponse
appBindRelation
(
Integer
userId
,
String
code
)
{
Integer
parentId
=
0
;
Integer
parentId
=
0
;
Integer
companyId
=
0
;
if
(
StringUtils
.
isNotBlank
(
code
))
{
if
(
StringUtils
.
isNotBlank
(
code
))
{
//判断处理活动关键字
//判断处理活动关键字
String
[]
codes
=
code
.
split
(
"_"
);
String
[]
codes
=
code
.
split
(
"_"
);
if
(
codes
.
length
>
1
)
{
if
(
codes
.
length
>
1
)
{
code
=
codes
[
0
];
code
=
codes
[
0
];
}
}
parentId
=
appUserDetailBiz
.
getUserByCode
(
code
);
if
(
code
.
contains
(
CompanyInfoBiz
.
CODE
)){
companyId
=
companyBiz
.
getCompanyByCode
(
code
);
}
else
{
parentId
=
appUserDetailBiz
.
getUserByCode
(
code
);
}
}
}
if
(
parentId
!=
null
&&
parentId
>
0
&&
userId
!=
null
&&
userId
>
0
)
{
if
(
parentId
!=
null
&&
parentId
>
0
&&
userId
!=
null
&&
userId
>
0
)
{
getMyBiz
().
bindRelation
(
userId
,
parentId
,
1
);
getMyBiz
().
bindRelation
(
userId
,
parentId
,
companyId
,
1
);
}
}
return
ObjectRestResponse
.
succ
();
return
ObjectRestResponse
.
succ
();
}
}
...
@@ -204,7 +211,7 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper, AppUserRe
...
@@ -204,7 +211,7 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper, AppUserRe
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"该上级不存在"
);
return
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NULL_CODE
,
"该上级不存在"
);
}
}
Integer
parentId
=
userLogin
.
getId
();
Integer
parentId
=
userLogin
.
getId
();
getMyBiz
().
bindRelation
(
userId
,
parentId
,
1
);
getMyBiz
().
bindRelation
(
userId
,
parentId
,
0
,
1
);
return
ObjectRestResponse
.
succ
();
return
ObjectRestResponse
.
succ
();
}
}
...
@@ -236,7 +243,7 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper, AppUserRe
...
@@ -236,7 +243,7 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper, AppUserRe
if
(
userVo
==
null
)
{
if
(
userVo
==
null
)
{
upRelationTemp
(
pid
,
userid
);
upRelationTemp
(
pid
,
userid
);
}
else
{
}
else
{
bindRelation
(
platform_userid
,
pid
,
2
);
bindRelation
(
platform_userid
,
pid
,
0
,
2
);
}
}
}
}
return
ObjectRestResponse
.
succ
();
return
ObjectRestResponse
.
succ
();
...
@@ -283,7 +290,7 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper, AppUserRe
...
@@ -283,7 +290,7 @@ public class AppUserRelationBiz extends BaseBiz<AppUserRelationMapper, AppUserRe
return
;
return
;
}
}
Integer
parentId
=
relationTemp
.
getUserId
();
Integer
parentId
=
relationTemp
.
getUserId
();
bindRelation
(
platform_userid
,
parentId
,
2
);
bindRelation
(
platform_userid
,
parentId
,
0
,
2
);
}
}
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/BaseMemberLevelBiz.java
0 → 100644
View file @
91ccc385
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
biz
;
import
cn.hutool.core.bean.BeanUtil
;
import
cn.hutool.core.collection.CollectionUtil
;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSONObject
;
import
com.github.wxiaoqi.security.admin.constant.MemberRightType
;
import
com.github.wxiaoqi.security.admin.dto.MemberLevelRightsDTO
;
import
com.github.wxiaoqi.security.admin.dto.BaseMemberLevelFindDTO
;
import
com.github.wxiaoqi.security.admin.dto.BaseMemberLevelPageDTO
;
import
com.github.wxiaoqi.security.admin.entity.BaseMemberLevel
;
import
com.github.wxiaoqi.security.admin.mapper.BaseMemberLevelMapper
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.xxfc.platform.activity.feign.ActivityFeign
;
import
com.xxfc.platform.universal.feign.ThirdFeign
;
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
org.springframework.util.StringUtils
;
import
tk.mybatis.mapper.entity.Example
;
import
java.math.BigDecimal
;
import
java.time.Instant
;
import
java.util.*
;
import
java.util.stream.Collectors
;
/**
* 会员等级设置
*
* @author hezhen
* @email 18178966185@163.com
* @date 2020-06-24 09:12:21
*/
@Service
@Transactional
(
rollbackFor
=
Exception
.
class
,
propagation
=
Propagation
.
REQUIRED
)
public
class
BaseMemberLevelBiz
extends
BaseBiz
<
BaseMemberLevelMapper
,
BaseMemberLevel
>
{
@Autowired
private
BaseUserMemberBiz
baseUserMemberBiz
;
@Autowired
private
ThirdFeign
thirdFeign
;
@Autowired
private
ActivityFeign
activityFeign
;
private
static
final
String
MEMBERMODEL_TYPE
=
"MEMBER_RIGHTS"
;
private
static
final
String
MEMBERMODEL_CODE
=
"DA_YUN"
;
public
ObjectRestResponse
<
PageDataVO
>
selectList
(
BaseMemberLevelFindDTO
userMemberLevelDTO
)
{
Integer
page
=
userMemberLevelDTO
.
getPage
()==
null
?
1
:
userMemberLevelDTO
.
getPage
();
Integer
limit
=
userMemberLevelDTO
.
getLimit
()==
null
?
10
:
userMemberLevelDTO
.
getLimit
();
return
ObjectRestResponse
.
succ
(
PageDataVO
.
pageInfo
(
page
,
limit
,
()->
getList
(
userMemberLevelDTO
)));
}
public
List
<
BaseMemberLevel
>
getList
(
BaseMemberLevelFindDTO
userMemberLevelDTO
){
Example
memberLevelExample
=
new
Example
(
BaseMemberLevel
.
class
);
memberLevelExample
.
setOrderByClause
(
"level asc"
);
Example
.
Criteria
criteria
=
memberLevelExample
.
createCriteria
();
criteria
.
andEqualTo
(
"isDel"
,
0
);
if
(
userMemberLevelDTO
.
getLevelIds
()
!=
null
&&
userMemberLevelDTO
.
getLevelIds
().
size
()
>
0
){
criteria
.
andIn
(
"id"
,
userMemberLevelDTO
.
getLevelIds
());
}
return
mapper
.
selectByExample
(
memberLevelExample
);
}
public
BaseMemberLevel
getMinDiscount
(
String
appId
){
BaseMemberLevelFindDTO
userMemberLevelDTO
=
new
BaseMemberLevelFindDTO
();
userMemberLevelDTO
.
setAppId
(
appId
);
List
<
BaseMemberLevel
>
list
=
getList
(
userMemberLevelDTO
);
BaseMemberLevel
baseUserMemberLevel
=
new
BaseMemberLevel
();
if
(
list
.
size
()
>
0
){
baseUserMemberLevel
=
list
.
stream
().
filter
(
o
->
o
.
getDiscount
()
>
0
).
min
(
Comparator
.
comparing
(
BaseMemberLevel:
:
getDiscount
)).
get
();
}
return
baseUserMemberLevel
;
}
public
BaseMemberLevel
getUserMemberLevelDetailById
(
Integer
id
)
{
BaseMemberLevel
userMemberLevel
=
mapper
.
selectByPrimaryKey
(
id
);
Integer
maxLevel
=
getMaxLevel
();
userMemberLevel
.
setMaxLevel
(
maxLevel
);
return
userMemberLevel
;
}
private
List
<
Long
>
getCouponIds
(
List
<
BaseMemberLevel
>
memberLevels
)
{
return
memberLevels
.
stream
()
.
map
(
BaseMemberLevel:
:
getMemberRights
)
.
flatMap
(
List:
:
stream
)
.
filter
(
x
->
Objects
.
equals
(
x
.
getType
(),
MemberRightType
.
COUNPON
.
getType
()))
.
map
(
MemberLevelRightsDTO:
:
getRights
)
.
map
(
MemberLevelRightsDTO
.
MemberRights
::
getCoupons
)
.
flatMap
(
List:
:
stream
)
.
filter
(
Objects:
:
nonNull
)
.
map
(
MemberLevelRightsDTO
.
Coupon
::
getId
).
collect
(
Collectors
.
toList
());
}
public
void
saveOrUpdateBaseUserMemberLevel
(
BaseMemberLevel
baseMemberLevel
)
{
List
<
MemberLevelRightsDTO
>
memberRights
=
baseMemberLevel
.
getMemberRights
();
for
(
MemberLevelRightsDTO
memberRight
:
memberRights
)
{
//同步会员权益
if
(
Objects
.
nonNull
(
baseMemberLevel
.
getId
()))
{
if
(
Objects
.
nonNull
(
memberRight
.
getSysn
())
&&
memberRight
.
getSysn
())
{
//baseUserMemberBiz.sysnUserMemberLevelRights(baseMemberLevel.getId(), memberRight, baseMemberLevel.getAppId());
}
}
memberRight
.
setSysn
(
null
);
}
baseMemberLevel
.
setRights
(
JSON
.
toJSONString
(
memberRights
));
if
(
Objects
.
nonNull
(
baseMemberLevel
.
getId
()))
{
baseMemberLevel
.
setUpdTime
(
Instant
.
now
().
toEpochMilli
());
mapper
.
updateByPrimaryKeySelective
(
baseMemberLevel
);
}
else
{
baseMemberLevel
.
setCrtTime
(
Instant
.
now
().
toEpochMilli
());
mapper
.
insertSelective
(
baseMemberLevel
);
}
}
public
void
deleteUserMemberLevelById
(
Integer
id
,
Integer
changeLevel
)
{
//1.根据id删除
//1.1 根据id查询
BaseMemberLevel
baseUserMemberLevel
=
mapper
.
selectByPrimaryKey
(
id
);
//1.2 删除
baseUserMemberLevel
.
setIsDel
(
1
);
mapper
.
updateByPrimaryKeySelective
(
baseUserMemberLevel
);
//2.同步会员等级操作
changeLevel
=
baseUserMemberLevel
.
getLevel
()
+
changeLevel
;
if
(
changeLevel
==
0
){
//baseUserMemberBiz.sysnBaseUserMember(baseUserMemberLevel.getLevel() ,0,"",changeLevel,appId);
}
else
{
//2.1 根据level查询
BaseMemberLevel
memberLevel
=
mapper
.
selectByLevel
(
changeLevel
);
//2.2 同步会员
//baseUserMemberBiz.sysnBaseUserMember(baseUserMemberLevel.getId(),memberLevel);
}
//3.更改比当前数据level大的数据,-1
mapper
.
updateUserMemberLevel
(
baseUserMemberLevel
.
getLevel
());
}
public
Integer
getMaxLevel
()
{
Integer
maxLevel
=
mapper
.
selectMaxLevel
();
maxLevel
=
maxLevel
==
null
?
0
:
maxLevel
;
return
maxLevel
;
}
/*public JSONObject getLevelInfo(BaseUserMember userMember){
BaseUserMemberVo userMemberVo = baseUserMemberBiz.getUserMemberByUserId(userMember.getUserId());
JSONObject jsonObject=new JSONObject();
Integer level=0;
if (userMemberVo != null){
BaseMemberLevel memberLevel = selectById(userMemberVo.getMemberLevel());
Integer levelId=0;
if (memberLevel != null ){
levelId=memberLevel.getLevel()==null?0:memberLevel.getLevel();
}
jsonObject.put("currentMember",memberLevel);
level=levelId+1;
}else {
level=1;
}
BaseMemberLevel nextMember=mapper.selectByLevel(level);
BaseMemberLevel maxMember=mapper.selectByLevel(getMaxLevel());
if (nextMember == null){
nextMember=maxMember;
}
jsonObject.put("nextMember",nextMember);
jsonObject.put("maxMember",maxMember);
UsersPurse usersPurse = usersPurseBiz.getUserPurseByUserId(userMember.getUserId());
BigDecimal totalBuy=BigDecimal.ZERO;
if (usersPurse != null ){
totalBuy=usersPurse.getTotalBuy();
}
jsonObject.put("totalBuy",totalBuy);
jsonObject.put("percentage",totalBuy.divide(nextMember.getMoney(),2).multiply(new BigDecimal(100)).setScale(0, BigDecimal.ROUND_HALF_UP));
return jsonObject;
}*/
public
List
<
BaseMemberLevel
>
getAll
(
BaseMemberLevel
baseUserMemberLevel
){
return
selectList
(
baseUserMemberLevel
);
}
public
BaseMemberLevel
getNextLevel
(
BaseMemberLevel
baseUserMemberLevel
){
return
mapper
.
getNextLevel
(
baseUserMemberLevel
.
getMoney
(),
baseUserMemberLevel
.
getLevel
());
}
public
BaseMemberLevel
getMemberLevel
(
Integer
levelId
,
String
levelIds
){
if
(
org
.
apache
.
commons
.
lang3
.
StringUtils
.
isNotBlank
(
levelIds
)){
BaseMemberLevel
userMemberLevel
=
selectById
(
levelId
);
if
(
userMemberLevel
!=
null
){
int
[]
ints
=
Arrays
.
stream
(
levelIds
.
split
(
","
)).
mapToInt
(
s
->
Integer
.
parseInt
(
s
)).
toArray
();
Arrays
.
sort
(
ints
);
List
<
Integer
>
aList
=
Arrays
.
stream
(
ints
).
boxed
().
collect
(
Collectors
.
toList
());
BaseMemberLevelFindDTO
userMemberLevelDTO
=
new
BaseMemberLevelFindDTO
();
userMemberLevelDTO
.
setLevelIds
(
aList
);
List
<
BaseMemberLevel
>
list
=
getList
(
userMemberLevelDTO
);
if
(
list
!=
null
&&
list
.
size
()
>
0
){
BaseMemberLevel
userMemberLevel1
=
null
;
for
(
BaseMemberLevel
baseUserMemberLevel:
list
){
if
(
baseUserMemberLevel
.
getLevel
()
>
userMemberLevel
.
getLevel
()){
userMemberLevel1
=
baseUserMemberLevel
;
break
;
}
}
return
userMemberLevel1
;
}
}
}
return
null
;
}
public
List
<
BaseMemberLevel
>
getListByLevelId
(
Integer
levelId
){
return
mapper
.
getListByLevelId
(
levelId
);
}
}
\ No newline at end of file
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/BranchCompanyBiz.java
View file @
91ccc385
...
@@ -45,6 +45,16 @@ public class BranchCompanyBiz extends BaseBiz<BranchCompanyMapper, BranchCompany
...
@@ -45,6 +45,16 @@ public class BranchCompanyBiz extends BaseBiz<BranchCompanyMapper, BranchCompany
return
ObjectRestResponse
.
succ
();
return
ObjectRestResponse
.
succ
();
}
}
public
Integer
getCompanyByCode
(
String
code
)
{
Example
example
=
new
Example
(
BranchCompany
.
class
);
example
.
createCriteria
().
andEqualTo
(
"code"
,
code
).
andEqualTo
(
"isDel"
,
0
);
List
<
BranchCompany
>
list
=
mapper
.
selectByExample
(
example
);
if
(
list
!=
null
&&
list
.
size
()
!=
0
)
{
return
list
.
get
(
0
).
getId
();
}
return
0
;
}
public
void
sendQueue
(
BranchCompany
branchCompany
)
{
public
void
sendQueue
(
BranchCompany
branchCompany
)
{
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/CompanyInfoBiz.java
View file @
91ccc385
...
@@ -9,6 +9,7 @@ import com.github.wxiaoqi.security.admin.mapper.CompanyInfoMapper;
...
@@ -9,6 +9,7 @@ import com.github.wxiaoqi.security.admin.mapper.CompanyInfoMapper;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
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.ReferralCodeUtil
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.xxfc.platform.app.entity.Cofig
;
import
com.xxfc.platform.app.entity.Cofig
;
...
@@ -49,6 +50,8 @@ public class CompanyInfoBiz extends BaseBiz<CompanyInfoMapper, CompanyInfo>{
...
@@ -49,6 +50,8 @@ public class CompanyInfoBiz extends BaseBiz<CompanyInfoMapper, CompanyInfo>{
@Autowired
@Autowired
BranchCompanyBiz
branchCompanyBiz
;
BranchCompanyBiz
branchCompanyBiz
;
public
static
final
String
CODE
=
"SHOP-"
;
...
@@ -71,6 +74,8 @@ public class CompanyInfoBiz extends BaseBiz<CompanyInfoMapper, CompanyInfo>{
...
@@ -71,6 +74,8 @@ public class CompanyInfoBiz extends BaseBiz<CompanyInfoMapper, CompanyInfo>{
//初始化店铺
//初始化店铺
BranchCompany
branchCompany
=
getBranchCompanyInfo
();
BranchCompany
branchCompany
=
getBranchCompanyInfo
();
branchCompany
.
setCompanyId
(
id
);
branchCompany
.
setCompanyId
(
id
);
branchCompany
.
setInviterAccount
(
companyInfoApply
.
getInviterAccount
());
branchCompany
.
setCode
(
CODE
+
ReferralCodeUtil
.
encode
(
companyInfoApply
.
getId
().
intValue
()));
branchCompanyBiz
.
addOrUpd
(
branchCompany
);
branchCompanyBiz
.
addOrUpd
(
branchCompany
);
}
}
sendQueue
(
companyInfo
);
sendQueue
(
companyInfo
);
...
@@ -169,7 +174,6 @@ public class CompanyInfoBiz extends BaseBiz<CompanyInfoMapper, CompanyInfo>{
...
@@ -169,7 +174,6 @@ public class CompanyInfoBiz extends BaseBiz<CompanyInfoMapper, CompanyInfo>{
user
.
setPassword
(
password
);
user
.
setPassword
(
password
);
user
.
setStatus
(
1
);
user
.
setStatus
(
1
);
user
.
setCorporationId
(
branchId
);
user
.
setCorporationId
(
branchId
);
user
.
setCompanyId
(
companyInfo
.
getId
().
intValue
());
user
.
setDataAll
(
2
);
user
.
setDataAll
(
2
);
user
.
setDataCorporation
(
branchId
+
""
);
user
.
setDataCorporation
(
branchId
+
""
);
user
.
setAppUserId
(
appUserId
);
user
.
setAppUserId
(
appUserId
);
...
...
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/UserCommentBiz.java
0 → 100644
View file @
91ccc385
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
biz
;
import
cn.hutool.json.JSONUtil
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.github.wxiaoqi.security.admin.dto.CompanyInfoFindDTO
;
import
com.github.wxiaoqi.security.admin.dto.UserCommentFindDTO
;
import
com.github.wxiaoqi.security.admin.entity.*
;
import
com.github.wxiaoqi.security.admin.mapper.CompanyInfoMapper
;
import
com.github.wxiaoqi.security.admin.mapper.UserCommentMapper
;
import
com.github.wxiaoqi.security.admin.vo.UserCommentVo
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.xxfc.platform.app.entity.Cofig
;
import
com.xxfc.platform.app.feign.ConfigFeign
;
import
com.xxfc.platform.universal.dto.SendMsgDTO
;
import
com.xxfc.platform.universal.feign.MQSenderFeign
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
tk.mybatis.mapper.entity.Example
;
import
java.util.Date
;
import
java.util.List
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
config
.
rabbit
.
RabbitConstant
.
ADMIN_TOPIC
;
import
static
com
.
github
.
wxiaoqi
.
security
.
common
.
config
.
rabbit
.
RabbitConstant
.
KEY_CORPORATION_UPD
;
@Service
@Slf4j
public
class
UserCommentBiz
extends
BaseBiz
<
UserCommentMapper
,
UserComment
>{
public
void
addOrUpd
(
UserComment
userComment
){
if
(
StringUtils
.
isBlank
(
userComment
.
getCommentText
())){
throw
new
BaseException
(
"参数不能为空"
,
ResultCode
.
FAILED_CODE
);
}
Integer
parentId
=
userComment
.
getParentId
()
==
null
?
0
:
userComment
.
getParentId
();
if
(
parentId
>
0
){
UserComment
parentComment
=
selectById
(
parentId
);
if
(
parentComment
==
null
){
throw
new
BaseException
(
"该评论不存在"
,
ResultCode
.
FAILED_CODE
);
}
userComment
.
setSoureId
(
parentComment
.
getSoureId
());
userComment
.
setSoureType
(
parentComment
.
getSoureType
());
userComment
.
setToUserId
(
parentComment
.
getUserId
());
userComment
.
setRootParentId
(
parentComment
.
getRootParentId
());
}
else
{
if
(
userComment
.
getSoureId
()
==
null
||
userComment
.
getSoureId
()
==
0
){
throw
new
BaseException
(
"资源ID不能为空"
,
ResultCode
.
FAILED_CODE
);
}
}
userComment
.
setCreateTime
(
new
Date
());
insertSelective
(
userComment
);
Integer
id
=
userComment
.
getId
();
if
(
id
>
0
){
Integer
rootParentId
=
userComment
.
getRootParentId
()
==
null
?
0
:
userComment
.
getRootParentId
();
if
(
rootParentId
==
0
){
UserComment
userComment1
=
new
UserComment
();
userComment1
.
setId
(
id
);
userComment1
.
setRootParentId
(
id
);
updateSelectiveById
(
userComment1
);
}
else
{
mapper
.
addreplyNum
(
rootParentId
);
}
}
}
public
PageDataVO
<
UserCommentVo
>
selectList
(
UserCommentFindDTO
userCommentFindDTO
){
PageHelper
.
startPage
(
userCommentFindDTO
.
getPage
(),
userCommentFindDTO
.
getLimit
());
PageInfo
<
UserCommentVo
>
pageInfo
=
new
PageInfo
<>(
getList
(
userCommentFindDTO
));
PageDataVO
<
UserCommentVo
>
dataVO
=
PageDataVO
.
pageInfo
(
pageInfo
);
Integer
rootParentId
=
userCommentFindDTO
.
getRootParentId
()
==
null
?
0
:
userCommentFindDTO
.
getRootParentId
();
if
(
rootParentId
==
0
&&
dataVO
.
getData
()
!=
null
){
List
<
UserCommentVo
>
list
=
dataVO
.
getData
();
if
(
list
!=
null
&&
list
.
size
()
>
0
){
for
(
UserCommentVo
commentVo:
list
){
userCommentFindDTO
.
setParentId
(
null
);
userCommentFindDTO
.
setRootParentId
(
commentVo
.
getRootParentId
());
PageDataVO
<
UserCommentVo
>
pageDataVO
=
selectList
(
userCommentFindDTO
);
if
(
pageDataVO
!=
null
){
commentVo
.
setChilder
(
pageDataVO
);
}
}
}
}
return
dataVO
;
}
public
List
<
UserCommentVo
>
getList
(
UserCommentFindDTO
commentFindDTO
){
return
mapper
.
selectList
(
commentFindDTO
);
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/mapper/BaseMemberLevelMapper.java
0 → 100644
View file @
91ccc385
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
mapper
;
import
com.github.wxiaoqi.security.admin.entity.BaseMemberLevel
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
import
org.apache.ibatis.annotations.Update
;
import
tk.mybatis.mapper.common.Mapper
;
import
java.math.BigDecimal
;
import
java.util.List
;
/**
* 会员等级设置
*
* @author hezhen
* @email 18178966185@163.com
* @date 2020-06-24 09:12:21
*/
public
interface
BaseMemberLevelMapper
extends
Mapper
<
BaseMemberLevel
>
{
@Select
(
"select max(`level`) from `base_member_level` where `is_del`=0 "
)
Integer
selectMaxLevel
();
@Update
(
"update `base_member_level` set `level`=`level`-1 where `is_del`=0 and `level`>#{level}"
)
int
updateUserMemberLevel
(
@Param
(
"level"
)
Integer
level
);
@Select
(
"select * from `base_member_level` as `buml` where buml.`level`=#{level} and buml.is_del=0"
)
BaseMemberLevel
selectByLevel
(
@Param
(
"level"
)
Integer
changeLevel
);
@Select
(
"select * from `base_member_level` as `buml` where buml.`level`> #{level} and buml.`money` <= #{money} and buml.is_del=0 ORDER BY buml.`level` DESC LIMIT 1 "
)
BaseMemberLevel
getNextLevel
(
@Param
(
"money"
)
BigDecimal
money
,
@Param
(
"level"
)
Integer
Level
);
@Select
(
"SELECT * FROM base_member_level WHERE is_del = 0 AND `level` >= \n"
+
"(SELECT `level` FROM base_member_level WHERE id=#{levelId} LIMIT 1 ) ORDER BY `level` ASC"
)
List
<
BaseMemberLevel
>
getListByLevelId
(
@Param
(
"levelId"
)
Integer
levelId
);
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/mapper/UserCommentMapper.java
0 → 100644
View file @
91ccc385
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
mapper
;
import
com.github.wxiaoqi.security.admin.dto.UserCommentFindDTO
;
import
com.github.wxiaoqi.security.admin.entity.UserComment
;
import
com.github.wxiaoqi.security.admin.vo.UserCommentVo
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Update
;
import
tk.mybatis.mapper.additional.idlist.SelectByIdListMapper
;
import
tk.mybatis.mapper.common.Mapper
;
import
java.util.List
;
public
interface
UserCommentMapper
extends
Mapper
<
UserComment
>,
SelectByIdListMapper
<
UserComment
,
Integer
>
{
@Update
(
"update user_comment set reply_num=reply_num+1 where id=#{id}"
)
void
addreplyNum
(
@Param
(
"id"
)
Integer
id
);
List
<
UserCommentVo
>
selectList
(
UserCommentFindDTO
commentFindDTO
);
}
\ No newline at end of file
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/AppUserCommentController.java
0 → 100644
View file @
91ccc385
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
rest
;
import
com.github.wxiaoqi.security.admin.biz.UserCommentBiz
;
import
com.github.wxiaoqi.security.admin.dto.UserCommentFindDTO
;
import
com.github.wxiaoqi.security.admin.entity.UserComment
;
import
com.github.wxiaoqi.security.auth.client.annotation.IgnoreUserToken
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.RequiredArgsConstructor
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
/**
* @author Administrator
*/
@Slf4j
@RestController
@RequestMapping
(
"app/comment"
)
@Api
(
tags
=
{
"评论"
})
public
class
AppUserCommentController
extends
BaseController
<
UserCommentBiz
>
{
@GetMapping
(
"app/unauth/selectList"
)
@ApiModelProperty
(
"列表"
)
@IgnoreUserToken
public
ObjectRestResponse
selectList
(
UserCommentFindDTO
commentFindDTO
)
{
return
ObjectRestResponse
.
succ
(
baseBiz
.
selectList
(
commentFindDTO
));
}
@PostMapping
(
"send"
)
@ApiModelProperty
(
"商家入驻申请"
)
public
ObjectRestResponse
apply
(
@RequestBody
UserComment
userComment
)
{
userComment
.
setUserId
(
getCurrentUserIdInt
());
baseBiz
.
addOrUpd
(
userComment
);
return
ObjectRestResponse
.
succ
();
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/admin/AdminBaseMemberLevelController.java
0 → 100644
View file @
91ccc385
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
rest
.
admin
;
import
com.github.wxiaoqi.security.admin.biz.BaseMemberLevelBiz
;
import
com.github.wxiaoqi.security.admin.dto.BaseMemberLevelFindDTO
;
import
com.github.wxiaoqi.security.admin.entity.BaseMemberLevel
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
org.springframework.web.bind.annotation.*
;
/**
* @author libin
* @version 1.0
* @description
* @data 2020/6/24 16:11
*/
@RestController
@RequestMapping
(
"/backstage/baseMemberLevel"
)
public
class
AdminBaseMemberLevelController
extends
BaseController
<
BaseMemberLevelBiz
,
BaseMemberLevel
>
{
@GetMapping
(
"/selectList"
)
public
ObjectRestResponse
selectList
(
BaseMemberLevelFindDTO
userMemberLevelFindDTO
)
{
return
baseBiz
.
selectList
(
userMemberLevelFindDTO
);
}
@PostMapping
(
"/save"
)
public
ObjectRestResponse
<
Void
>
saveUserMemberLevel
(
@RequestBody
BaseMemberLevel
baseMemberLevel
)
{
baseBiz
.
saveOrUpdateBaseUserMemberLevel
(
baseMemberLevel
);
return
ObjectRestResponse
.
succ
();
}
@DeleteMapping
(
"/delete/{id}/{changeLevel}"
)
public
ObjectRestResponse
<
Void
>
deleteUserMemberLevel
(
@PathVariable
(
value
=
"id"
)
Integer
id
,
@PathVariable
(
value
=
"changeLevel"
)
Integer
changeLevel
)
{
baseBiz
.
deleteUserMemberLevelById
(
id
,
changeLevel
);
return
ObjectRestResponse
.
succ
();
}
@GetMapping
(
"/detail/{id}"
)
public
ObjectRestResponse
<
BaseMemberLevel
>
findUserMemberLevelDetail
(
@PathVariable
(
value
=
"id"
)
Integer
id
)
{
BaseMemberLevel
userMemberLevel
=
baseBiz
.
getUserMemberLevelDetailById
(
id
);
return
ObjectRestResponse
.
succ
(
userMemberLevel
);
}
@GetMapping
(
"/maxLevel"
)
public
ObjectRestResponse
getMaxLevel
()
{
return
ObjectRestResponse
.
succ
(
baseBiz
.
getMaxLevel
());
}
@GetMapping
(
"/getAll"
)
public
ObjectRestResponse
getAll
(
BaseMemberLevelFindDTO
userMemberLevelFindDTO
)
{
return
ObjectRestResponse
.
succ
(
baseBiz
.
getList
(
userMemberLevelFindDTO
));
}
}
\ No newline at end of file
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rpc/service/AppPermissionService.java
View file @
91ccc385
...
@@ -117,6 +117,10 @@ public class AppPermissionService {
...
@@ -117,6 +117,10 @@ public class AppPermissionService {
private
AppUserAlipayBiz
alipayBiz
;
private
AppUserAlipayBiz
alipayBiz
;
@Autowired
private
BranchCompanyBiz
companyBiz
;
private
static
final
Integer
maxNumber
=
5
;
private
static
final
Integer
maxNumber
=
5
;
...
@@ -266,8 +270,14 @@ public class AppPermissionService {
...
@@ -266,8 +270,14 @@ public class AppPermissionService {
String
[]
codes
=
code
.
split
(
"_"
);
String
[]
codes
=
code
.
split
(
"_"
);
if
(
codes
.
length
>
0
)
{
if
(
codes
.
length
>
0
)
{
String
userCode
=
codes
[
0
];
String
userCode
=
codes
[
0
];
if
(
appUserDetailBiz
.
getUserByCode
(
userCode
)==
0
)
{
if
(
userCode
.
contains
(
CompanyInfoBiz
.
CODE
)){
return
JsonResultUtil
.
createFailedResult
(
ResultCode
.
NOTEXIST_CODE
,
"邀请人不存在"
);
if
(
companyBiz
.
getCompanyByCode
(
code
)
==
0
)
{
return
JsonResultUtil
.
createFailedResult
(
ResultCode
.
NOTEXIST_CODE
,
"邀请店铺不存在"
);
}
}
else
{
if
(
appUserDetailBiz
.
getUserByCode
(
userCode
)
==
0
)
{
return
JsonResultUtil
.
createFailedResult
(
ResultCode
.
NOTEXIST_CODE
,
"邀请人不存在"
);
}
}
}
}
}
}
}
...
@@ -326,6 +336,7 @@ public class AppPermissionService {
...
@@ -326,6 +336,7 @@ public class AppPermissionService {
log
.
info
(
"注册:解析地址后: "
+
userid
+
"---time===="
+
System
.
currentTimeMillis
()/
1000L
);
log
.
info
(
"注册:解析地址后: "
+
userid
+
"---time===="
+
System
.
currentTimeMillis
()/
1000L
);
//邀请人id关系绑定
//邀请人id关系绑定
Integer
parentId
=
0
;
Integer
parentId
=
0
;
Integer
companyId
=
0
;
if
(
StringUtils
.
isNotBlank
(
code
)){
if
(
StringUtils
.
isNotBlank
(
code
)){
//判断处理活动关键字
//判断处理活动关键字
String
[]
codes
=
code
.
split
(
"_"
);
String
[]
codes
=
code
.
split
(
"_"
);
...
@@ -333,11 +344,16 @@ public class AppPermissionService {
...
@@ -333,11 +344,16 @@ public class AppPermissionService {
code
=
codes
[
0
];
code
=
codes
[
0
];
activityCode
=
codes
[
1
];
activityCode
=
codes
[
1
];
}
}
parentId
=
appUserDetailBiz
.
getUserByCode
(
code
);
if
(
code
.
contains
(
CompanyInfoBiz
.
CODE
)){
companyId
=
companyBiz
.
getCompanyByCode
(
code
);
}
else
{
parentId
=
appUserDetailBiz
.
getUserByCode
(
code
);
}
}
}
if
(
parentId
!=
null
&&
parentId
>
0
){
if
(
parentId
>
0
||
companyId
>
0
){
rsUserDetail
.
setSource
(
1
);
rsUserDetail
.
setSource
(
1
);
relationBiz
.
bindRelation
(
userid
,
parentId
,
1
);
relationBiz
.
bindRelation
(
userid
,
parentId
,
companyId
,
1
);
if
(
StringUtils
.
isNotBlank
(
activityCode
)){
if
(
StringUtils
.
isNotBlank
(
activityCode
)){
rsUserDetail
.
setInviterAccount
(
parentId
);
rsUserDetail
.
setInviterAccount
(
parentId
);
}
}
...
@@ -1276,8 +1292,14 @@ public class AppPermissionService {
...
@@ -1276,8 +1292,14 @@ public class AppPermissionService {
String
[]
codes
=
code
.
split
(
"_"
);
String
[]
codes
=
code
.
split
(
"_"
);
if
(
codes
.
length
>
0
)
{
if
(
codes
.
length
>
0
)
{
String
userCode
=
codes
[
0
];
String
userCode
=
codes
[
0
];
if
(
appUserDetailBiz
.
getUserByCode
(
userCode
)==
0
)
{
if
(
userCode
.
contains
(
CompanyInfoBiz
.
CODE
)){
return
JsonResultUtil
.
createFailedResult
(
ResultCode
.
NOTEXIST_CODE
,
"邀请人不存在"
);
if
(
companyBiz
.
getCompanyByCode
(
code
)
==
0
)
{
return
JsonResultUtil
.
createFailedResult
(
ResultCode
.
NOTEXIST_CODE
,
"邀请店铺不存在"
);
}
}
else
{
if
(
appUserDetailBiz
.
getUserByCode
(
userCode
)
==
0
)
{
return
JsonResultUtil
.
createFailedResult
(
ResultCode
.
NOTEXIST_CODE
,
"邀请人不存在"
);
}
}
}
}
}
}
}
...
@@ -1317,6 +1339,7 @@ public class AppPermissionService {
...
@@ -1317,6 +1339,7 @@ public class AppPermissionService {
log
.
info
(
"注册:解析地址后: "
+
userid
+
"---time===="
+
System
.
currentTimeMillis
()/
1000L
);
log
.
info
(
"注册:解析地址后: "
+
userid
+
"---time===="
+
System
.
currentTimeMillis
()/
1000L
);
//邀请人id关系绑定
//邀请人id关系绑定
Integer
parentId
=
0
;
Integer
parentId
=
0
;
Integer
companyId
=
0
;
if
(
StringUtils
.
isNotBlank
(
code
)){
if
(
StringUtils
.
isNotBlank
(
code
)){
//判断处理活动关键字
//判断处理活动关键字
String
[]
codes
=
code
.
split
(
"_"
);
String
[]
codes
=
code
.
split
(
"_"
);
...
@@ -1324,11 +1347,15 @@ public class AppPermissionService {
...
@@ -1324,11 +1347,15 @@ public class AppPermissionService {
code
=
codes
[
0
];
code
=
codes
[
0
];
activityCode
=
codes
[
1
];
activityCode
=
codes
[
1
];
}
}
parentId
=
appUserDetailBiz
.
getUserByCode
(
code
);
if
(
code
.
contains
(
CompanyInfoBiz
.
CODE
)){
companyId
=
companyBiz
.
getCompanyByCode
(
code
);
}
else
{
parentId
=
appUserDetailBiz
.
getUserByCode
(
code
);
}
}
}
if
(
parentId
!=
null
&&
parentId
>
0
){
if
(
parentId
>
0
||
companyId
>
0
){
rsUserDetail
.
setSource
(
1
);
rsUserDetail
.
setSource
(
1
);
relationBiz
.
bindRelation
(
userid
,
parentId
,
1
);
relationBiz
.
bindRelation
(
userid
,
parentId
,
companyId
,
1
);
if
(
StringUtils
.
isNotBlank
(
activityCode
)){
if
(
StringUtils
.
isNotBlank
(
activityCode
)){
rsUserDetail
.
setInviterAccount
(
parentId
);
rsUserDetail
.
setInviterAccount
(
parentId
);
}
}
...
...
ace-modules/ace-admin/src/main/resources/mapper/UserCommentMapper.xml
0 → 100644
View file @
91ccc385
<?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.UserCommentMapper"
>
<select
id=
"selectList"
resultType=
"com.github.wxiaoqi.security.admin.vo.UserCommentVo"
parameterType=
"com.github.wxiaoqi.security.admin.dto.UserCommentFindDTO"
>
SELECT
c.*,
IFNULL(d1.realname,d1.nickname) as userName,
IFNULL(d2.realname,d2.nickname) as toUserName
FROM user_comment c
LEFT JOIN app_user_detail d1 ON c.user_id=d1.userid
LEFT JOIN app_user_detail d2 ON c.to_user_id=d2.userid
<where>
c.soure_id=#{soureId}
<if
test=
"parentId != null "
>
AND c.`parent_id`= #{parentId}
</if>
<if
test=
"rootParentId != null and rootParentId > 0 "
>
AND ( c.`parent_id` > 0 and c.root_parent_id = #{rootParentId} )
</if>
</where>
order by c.create_time ASC
</select>
</mapper>
\ No newline at end of file
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/dto/VehicleExtensionFindDTO.java
0 → 100644
View file @
91ccc385
package
com
.
xxfc
.
platform
.
vehicle
.
pojo
.
dto
;
import
lombok.Data
;
import
java.util.List
;
/**
* @author libin
* @version 1.0
* @description
* @data 2019/8/23 16:27
*/
@Data
public
class
VehicleExtensionFindDTO
{
private
String
vehicleId
;
private
Integer
vehicleApplyId
;
private
List
<
Integer
>
cataIds
;
Integer
parentId
;
Integer
goodsType
;
}
xx-vehicle/xx-vehicle-api/src/main/java/com/xxfc/platform/vehicle/pojo/vo/VehicleExtensionVO.java
View file @
91ccc385
...
@@ -18,6 +18,11 @@ public class VehicleExtensionVO extends VehicleExtension {
...
@@ -18,6 +18,11 @@ public class VehicleExtensionVO extends VehicleExtension {
@ApiModelProperty
(
"扩展名称"
)
@ApiModelProperty
(
"扩展名称"
)
private
String
cataName
;
private
String
cataName
;
@ApiModelProperty
(
"是否选中:0-未;1-是"
)
private
Integer
isSelected
;
@ApiModelProperty
(
"父级是否选中:0-未;1-是"
)
private
Integer
isParentSelected
;
public
List
<
VehicleExtensionVO
>
children
;
public
List
<
VehicleExtensionVO
>
children
;
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleBiz.java
View file @
91ccc385
...
@@ -13,6 +13,7 @@ import com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface;
...
@@ -13,6 +13,7 @@ import com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
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.CheckObjectIsNullUtils
;
import
com.github.wxiaoqi.security.common.util.Query
;
import
com.github.wxiaoqi.security.common.util.Query
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
import
com.github.wxiaoqi.security.common.vo.PageDataVO
;
...
@@ -1602,9 +1603,11 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
...
@@ -1602,9 +1603,11 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
throw
new
BaseException
(
"公司名称不能重复"
,
ResultCode
.
FAILED_CODE
);
throw
new
BaseException
(
"公司名称不能重复"
,
ResultCode
.
FAILED_CODE
);
}
}
Vehicle
vehicle
=
JSONUtil
.
toBean
(
vehicleApply
.
getChangeJson
(),
Vehicle
.
class
);
Vehicle
vehicle
=
JSONUtil
.
toBean
(
vehicleApply
.
getChangeJson
(),
Vehicle
.
class
);
if
(
StringUtils
.
isNotBlank
(
vehicleApply
.
getVehicleId
())){
if
(
StringUtils
.
isNotBlank
(
vehicleId
)){
vehicle
.
setId
(
vehicleId
);
if
(!
CheckObjectIsNullUtils
.
objCheckIsNull
(
vehicle
)
){
updateSelectiveById
(
vehicle
);
vehicle
.
setId
(
vehicleId
);
updateSelectiveById
(
vehicle
);
}
}
else
{
}
else
{
vehicle
.
setId
(
UUID
.
randomUUID
().
toString
());
vehicle
.
setId
(
UUID
.
randomUUID
().
toString
());
insertSelective
(
vehicle
);
insertSelective
(
vehicle
);
...
@@ -1637,4 +1640,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
...
@@ -1637,4 +1640,7 @@ public class VehicleBiz extends BaseBiz<VehicleMapper, Vehicle> implements UserR
}
}
}
}
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/biz/VehicleExtensionBiz.java
View file @
91ccc385
...
@@ -5,9 +5,12 @@ package com.xxfc.platform.vehicle.biz;
...
@@ -5,9 +5,12 @@ package com.xxfc.platform.vehicle.biz;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.exception.BaseException
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
com.xxfc.platform.vehicle.entity.Vehicle
;
import
com.xxfc.platform.vehicle.entity.VehicleApply
;
import
com.xxfc.platform.vehicle.entity.VehicleExtension
;
import
com.xxfc.platform.vehicle.entity.VehicleExtension
;
import
com.xxfc.platform.vehicle.entity.VehiclePlatCata
;;
import
com.xxfc.platform.vehicle.entity.VehiclePlatCata
;;
import
com.xxfc.platform.vehicle.mapper.VehicleEextensionMapper
;
import
com.xxfc.platform.vehicle.mapper.VehicleEextensionMapper
;
import
com.xxfc.platform.vehicle.pojo.dto.VehicleExtensionFindDTO
;
import
com.xxfc.platform.vehicle.pojo.vo.VehicleExtensionVO
;
import
com.xxfc.platform.vehicle.pojo.vo.VehicleExtensionVO
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.apache.commons.lang3.StringUtils
;
...
@@ -27,6 +30,12 @@ public class VehicleExtensionBiz extends BaseBiz<VehicleEextensionMapper, Vehicl
...
@@ -27,6 +30,12 @@ public class VehicleExtensionBiz extends BaseBiz<VehicleEextensionMapper, Vehicl
@Autowired
@Autowired
VehiclePlatCataBiz
vehiclePlatCataBiz
;
VehiclePlatCataBiz
vehiclePlatCataBiz
;
@Autowired
VehicleBiz
vehicleBiz
;
@Autowired
VehicleApplyBiz
vehicleApplyBiz
;
...
@@ -97,6 +106,32 @@ public class VehicleExtensionBiz extends BaseBiz<VehicleEextensionMapper, Vehicl
...
@@ -97,6 +106,32 @@ public class VehicleExtensionBiz extends BaseBiz<VehicleEextensionMapper, Vehicl
public
List
<
VehicleExtensionVO
>
getTreeByPlatCata
(
VehicleExtensionFindDTO
extensionFindDTO
){
if
(
StringUtils
.
isBlank
(
extensionFindDTO
.
getVehicleId
())
&&
extensionFindDTO
.
getVehicleApplyId
()
==
null
){
throw
new
BaseException
(
"参数不能为空"
,
ResultCode
.
FAILED_CODE
);
}
if
(
StringUtils
.
isNotBlank
(
extensionFindDTO
.
getVehicleId
())){
Vehicle
vehicle
=
vehicleBiz
.
selectById
(
extensionFindDTO
.
getVehicleId
());
extensionFindDTO
.
setGoodsType
(
vehicle
.
getGoodsType
());
}
else
{
VehicleApply
vehicleApply
=
vehicleApplyBiz
.
selectById
(
extensionFindDTO
.
getVehicleApplyId
());
extensionFindDTO
.
setGoodsType
(
vehicleApply
.
getGoodsType
());
extensionFindDTO
.
setCataIds
(
Arrays
.
asList
(
vehicleApply
.
getExtensionList
().
split
(
","
)).
parallelStream
().
map
(
s
->
Integer
.
valueOf
(
s
)).
collect
(
Collectors
.
toList
()));
}
extensionFindDTO
.
setParentId
(
0
);
List
<
VehicleExtensionVO
>
vehicleExtensionVOS
=
mapper
.
selectListByPlatCata
(
extensionFindDTO
);
if
(
vehicleExtensionVOS
.
size
()
>
0
){
for
(
VehicleExtensionVO
extensionVO:
vehicleExtensionVOS
)
{
extensionFindDTO
.
setParentId
(
extensionVO
.
getId
());
extensionVO
.
setChildren
(
mapper
.
selectListByPlatCata
(
extensionFindDTO
));
}
}
return
vehicleExtensionVOS
;
}
...
...
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/mapper/VehicleEextensionMapper.java
View file @
91ccc385
...
@@ -3,6 +3,7 @@ package com.xxfc.platform.vehicle.mapper;
...
@@ -3,6 +3,7 @@ package com.xxfc.platform.vehicle.mapper;
import
com.xxfc.platform.vehicle.entity.VehicleExtension
;
import
com.xxfc.platform.vehicle.entity.VehicleExtension
;
import
com.xxfc.platform.vehicle.pojo.dto.VehicleExtensionFindDTO
;
import
com.xxfc.platform.vehicle.pojo.vo.VehicleExtensionVO
;
import
com.xxfc.platform.vehicle.pojo.vo.VehicleExtensionVO
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Param
;
import
tk.mybatis.mapper.additional.idlist.SelectByIdListMapper
;
import
tk.mybatis.mapper.additional.idlist.SelectByIdListMapper
;
...
@@ -24,4 +25,7 @@ public interface VehicleEextensionMapper extends Mapper<VehicleExtension>, Selec
...
@@ -24,4 +25,7 @@ public interface VehicleEextensionMapper extends Mapper<VehicleExtension>, Selec
List
<
VehicleExtensionVO
>
selectListByApplyParent
(
@Param
(
"cataIds"
)
List
<
Integer
>
cataIds
);
List
<
VehicleExtensionVO
>
selectListByApplyParent
(
@Param
(
"cataIds"
)
List
<
Integer
>
cataIds
);
List
<
VehicleExtensionVO
>
selectListByPlatCata
(
VehicleExtensionFindDTO
vehicleExtensionFindDTO
);
}
}
\ No newline at end of file
xx-vehicle/xx-vehicle-server/src/main/java/com/xxfc/platform/vehicle/rest/admin/AdminVehicleController.java
View file @
91ccc385
...
@@ -5,15 +5,23 @@ import com.github.wxiaoqi.security.admin.feign.UserFeign;
...
@@ -5,15 +5,23 @@ import com.github.wxiaoqi.security.admin.feign.UserFeign;
import
com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface
;
import
com.github.wxiaoqi.security.admin.feign.rest.UserRestInterface
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.xxfc.platform.vehicle.biz.VehicleBiz
;
import
com.xxfc.platform.vehicle.biz.VehicleBiz
;
import
com.xxfc.platform.vehicle.biz.VehicleExtensionBiz
;
import
com.xxfc.platform.vehicle.entity.Vehicle
;
import
com.xxfc.platform.vehicle.entity.Vehicle
;
import
com.xxfc.platform.vehicle.pojo.dto.VehicleExtensionFindDTO
;
import
com.xxfc.platform.vehicle.pojo.dto.VehicleFindDTO
;
import
com.xxfc.platform.vehicle.pojo.dto.VehicleFindDTO
;
import
com.xxfc.platform.vehicle.pojo.vo.VehicleExtensionVO
;
import
com.xxfc.platform.vehicle.rest.BaseController
;
import
com.xxfc.platform.vehicle.rest.BaseController
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
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
java.util.Arrays
;
import
java.util.List
;
import
java.util.stream.Collectors
;
/**
/**
* @author Administrator
* @author Administrator
*/
*/
...
@@ -30,6 +38,9 @@ public class AdminVehicleController extends BaseController<VehicleBiz> implement
...
@@ -30,6 +38,9 @@ public class AdminVehicleController extends BaseController<VehicleBiz> implement
@Autowired
@Autowired
UserFeign
userFeign
;
UserFeign
userFeign
;
@Autowired
VehicleExtensionBiz
extensionBiz
;
@Override
@Override
public
UserFeign
getUserFeign
()
{
public
UserFeign
getUserFeign
()
{
...
@@ -78,6 +89,14 @@ public class AdminVehicleController extends BaseController<VehicleBiz> implement
...
@@ -78,6 +89,14 @@ public class AdminVehicleController extends BaseController<VehicleBiz> implement
@GetMapping
(
"tree"
)
@ApiModelProperty
(
"扩展详情"
)
public
ObjectRestResponse
tree
(
VehicleExtensionFindDTO
extensionFindDTO
)
{
return
ObjectRestResponse
.
succ
(
extensionBiz
.
getTreeByPlatCata
(
extensionFindDTO
));
}
...
...
xx-vehicle/xx-vehicle-server/src/main/resources/mapper/VehicleExtensionMapper.xml
View file @
91ccc385
...
@@ -75,4 +75,56 @@
...
@@ -75,4 +75,56 @@
GROUP BY c.parent_id
GROUP BY c.parent_id
ORDER BY c1.id
ORDER BY c1.id
</select>
</select>
<select
id=
"selectListByPlatCata"
parameterType=
"com.xxfc.platform.vehicle.pojo.dto.VehicleExtensionFindDTO"
resultType=
"com.xxfc.platform.vehicle.pojo.vo.VehicleExtensionVO"
>
SELECT
c.id,
c.`name` as cataName,
<choose>
<when
test=
"vehicleId != null and vehicleId != ''"
>
IF(e.cata_id is NULL,0,1) as isSelected,
IF(e1.cata_id is NULL,0,1) as isParentSelected
</when>
<otherwise>
IF(c2.id is NULL,0,1) as isSelected,
IF(c1.parent_id is NULL,0,1) as isParentSelected
</otherwise>
</choose>
FROM vehicle_plat_cata c
<if
test=
"vehicleId != null and vehicleId != '' "
>
LEFT JOIN (SELECT * FROM vehicle_extension WHERE
is_del = 0 and vehicle_id=#{vehicleId} ) e ON c.id=e.cata_id
</if>
<if
test=
"vehicleId != null and vehicleId != '' "
>
LEFT JOIN (SELECT * FROM vehicle_extension WHERE
is_del = 0 and vehicle_id=#{vehicleId} ) e1 ON c.id=e1.parent_cata_id
</if>
<if
test=
"cataIds != null and cataIds.size() > 0 "
>
LEFT JOIN (select * FROM vehicle_plat_cata WHERE id in
<foreach
collection=
"cataIds"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
GROUP BY parent_id) c1 ON c.id=c1.parent_id
</if>
<if
test=
"cataIds != null and cataIds.size() > 0"
>
LEFT JOIN (select * FROM vehicle_plat_cata WHERE id in
<foreach
collection=
"cataIds"
item=
"id"
open=
"("
separator=
","
close=
")"
>
#{id}
</foreach>
) c2 ON c.id=c2.id
</if>
<where>
<if
test=
"parentId != null "
>
and c.parent_id=#{parentId}
</if>
<if
test=
"goodsType != null "
>
and c.goods_type=#{goodsType}
</if>
</where>
GROUP BY c.id
ORDER BY c.id
</select>
</mapper>
</mapper>
\ No newline at end of file
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