Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
F
fileServe
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vanke
fileServe
Commits
52088261
Commit
52088261
authored
Jun 11, 2020
by
XiaHou
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修复相关接口
parent
0358c142
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
79 additions
and
23 deletions
+79
-23
UmsMemberController.java
...com/macro/mall/controller/member/UmsMemberController.java
+9
-5
UmsMemberDto.java
.../java/com/macro/mall/model/dto/quanxing/UmsMemberDto.java
+15
-0
UmsMemberMapper.xml
.../main/resources/com/macro/mall/mapper/UmsMemberMapper.xml
+14
-14
UmsMemberService.java
.../java/com/macro/mall/service/member/UmsMemberService.java
+3
-1
UmsMemberServiceImpl.java
.../macro/mall/service/member/impl/UmsMemberServiceImpl.java
+38
-3
No files found.
mall-admin/src/main/java/com/macro/mall/controller/member/UmsMemberController.java
View file @
52088261
...
@@ -9,6 +9,7 @@ import com.macro.mall.domain.vo.UmsMemberVo;
...
@@ -9,6 +9,7 @@ import com.macro.mall.domain.vo.UmsMemberVo;
import
com.macro.mall.domain.vo.member.UmsMemberTagVo
;
import
com.macro.mall.domain.vo.member.UmsMemberTagVo
;
import
com.macro.mall.model.UmsMember
;
import
com.macro.mall.model.UmsMember
;
import
com.macro.mall.model.common.ResultMsg
;
import
com.macro.mall.model.common.ResultMsg
;
import
com.macro.mall.model.dto.quanxing.UmsMemberDto
;
import
com.macro.mall.service.member.UmsMemberService
;
import
com.macro.mall.service.member.UmsMemberService
;
import
com.macro.mall.service.member.UmsMemberTagService
;
import
com.macro.mall.service.member.UmsMemberTagService
;
import
io.swagger.annotations.*
;
import
io.swagger.annotations.*
;
...
@@ -56,22 +57,25 @@ public class UmsMemberController {
...
@@ -56,22 +57,25 @@ public class UmsMemberController {
@ApiOperation
(
"权星后台_得到商家会员信息"
)
@ApiOperation
(
"权星后台_得到商家会员信息"
)
@RequestMapping
(
value
=
"/getMerchantMember"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/getMerchantMember"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
@ResponseBody
public
CommonResult
getMerchantMember
(
@ApiParam
(
"传入2即可 账户类型(0管理员1供应商2分销商)"
)
@RequestParam
(
"accouuntType"
)
Integer
accouuntType
){
public
CommonResult
<
List
<
UmsMember
>>
getMerchantMember
(
@ApiParam
(
"传入2即可 账户类型(0管理员1供应商2分销商)"
)
@RequestParam
(
"accouuntType"
)
Integer
accouuntType
){
return
CommonResult
.
success
(
this
.
memberService
.
getMemberListByAccountType
(
accouuntType
));
return
CommonResult
.
success
(
this
.
memberService
.
getMemberListByAccountType
(
accouuntType
));
}
}
@ApiOperation
(
"权星后台_查询会员分页数据"
)
@ApiOperation
(
"权星后台_查询会员分页数据"
)
@ResponseBody
@ResponseBody
@RequestMapping
(
value
=
"/getPageList"
,
method
=
RequestMethod
.
GET
)
@RequestMapping
(
value
=
"/getPageList"
,
method
=
RequestMethod
.
GET
)
public
CommonResult
<
CommonPage
<
UmsMember
>>
getPageList
(
@ApiParam
(
"页数"
)
@RequestParam
(
"pageNum"
)
Integer
pageNum
,
@ApiParam
(
"每页大小"
)
@RequestParam
(
"pageSize"
)
Integer
pageSize
,
public
CommonResult
<
CommonPage
<
UmsMemberDto
>>
getPageList
(
@ApiParam
(
"页数"
)
@RequestParam
(
"pageNum"
)
Integer
pageNum
,
@ApiParam
(
"每页大小"
)
@RequestParam
(
"pageSize"
)
Integer
pageSize
,
@ApiParam
(
"不传则查询所有角色 账户类型(0管理员1供应商2分销商)"
)
@RequestParam
(
"accouuntType"
)
Integer
accouuntType
){
@ApiParam
(
"不传则查询所有角色 账户类型(0管理员1供应商2分销商)"
)
@RequestParam
(
"accouuntType"
)
Integer
accouuntType
,
return
CommonResult
.
success
(
CommonPage
.
restPage
(
this
.
memberService
.
getPageList
(
pageNum
,
pageSize
,
accouuntType
)));
@ApiParam
(
"名字"
)
@RequestParam
(
"name"
)
String
name
,
@ApiParam
(
"手机号"
)
@RequestParam
(
"phone"
)
String
phone
,
@ApiParam
(
"启用禁用"
)
@RequestParam
(
"status"
)
Integer
status
){
return
CommonResult
.
success
(
this
.
memberService
.
getPageList
(
pageNum
,
pageSize
,
accouuntType
));
}
}
@ApiOperation
(
"权星后台_根据会员id查询一条会员数据"
)
@ApiOperation
(
"权星后台_根据会员id查询一条会员数据"
)
@RequestMapping
(
value
=
"/selectOneById"
,
method
=
RequestMethod
.
POST
)
@RequestMapping
(
value
=
"/selectOneById"
,
method
=
RequestMethod
.
POST
)
@ResponseBody
@ResponseBody
public
CommonResult
selectOneById
(
@ApiParam
(
"id"
)
@RequestParam
(
"id"
)
Long
id
){
public
CommonResult
<
UmsMember
>
selectOneById
(
@ApiParam
(
"id"
)
@RequestParam
(
"id"
)
Long
id
){
return
CommonResult
.
success
(
this
.
memberService
.
selectOneById
(
id
));
return
CommonResult
.
success
(
this
.
memberService
.
selectOneById
(
id
));
}
}
...
...
mall-mbg/src/main/java/com/macro/mall/model/dto/quanxing/UmsMemberDto.java
0 → 100644
View file @
52088261
package
com
.
macro
.
mall
.
model
.
dto
.
quanxing
;
import
com.macro.mall.model.PmsSupplierAudit
;
import
com.macro.mall.model.UmsMember
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.io.Serializable
;
@Data
public
class
UmsMemberDto
extends
UmsMember
implements
Serializable
{
@ApiModelProperty
(
value
=
"会员相关审核信息对象"
)
private
PmsSupplierAudit
pmsSupplierAudit
;
}
mall-mbg/src/main/resources/com/macro/mall/mapper/UmsMemberMapper.xml
View file @
52088261
...
@@ -139,13 +139,10 @@
...
@@ -139,13 +139,10 @@
</if>
</if>
</delete>
</delete>
<insert
id=
"insert"
parameterType=
"com.macro.mall.model.UmsMember"
>
<insert
id=
"insert"
parameterType=
"com.macro.mall.model.UmsMember"
>
<selectKey
keyProperty=
"id"
order=
"AFTER"
resultType=
"java.lang.Long"
>
insert into ums_member (id, member_level_id, username,
SELECT LAST_INSERT_ID()
password, nickname, phone,
</selectKey>
status, icon, gender,
insert into ums_member (member_level_id, username, password,
birthday, city, job, personalized_signature,
nickname, phone, status,
icon, gender, birthday,
city, job, personalized_signature,
source_type, integration, growth,
source_type, integration, growth,
create_date, create_by, update_date,
create_date, create_by, update_date,
update_by, delete_status, name,
update_by, delete_status, name,
...
@@ -156,10 +153,10 @@
...
@@ -156,10 +153,10 @@
invitation_code, invitation_code_id, union_id,
invitation_code, invitation_code_id, union_id,
label, distribution_level, accouunt_type,
label, distribution_level, accouunt_type,
login_time)
login_time)
values (#{
memberLevelId,jdbcType=BIGINT}, #{username,jdbcType=VARCHAR}, #{password
,jdbcType=VARCHAR},
values (#{
id,jdbcType=BIGINT}, #{memberLevelId,jdbcType=BIGINT}, #{username
,jdbcType=VARCHAR},
#{
nickname,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHAR}, #{status,jdbcType=INTEGE
R},
#{
password,jdbcType=VARCHAR}, #{nickname,jdbcType=VARCHAR}, #{phone,jdbcType=VARCHA
R},
#{
icon,jdbcType=VARCHAR}, #{gender,jdbcType=INTEGER}, #{birthday,jdbcType=DATE
},
#{
status,jdbcType=INTEGER}, #{icon,jdbcType=VARCHAR}, #{gender,jdbcType=INTEGER
},
#{city,jdbcType=VARCHAR}, #{job,jdbcType=VARCHAR}, #{personalizedSignature,jdbcType=VARCHAR},
#{
birthday,jdbcType=DATE}, #{
city,jdbcType=VARCHAR}, #{job,jdbcType=VARCHAR}, #{personalizedSignature,jdbcType=VARCHAR},
#{sourceType,jdbcType=INTEGER}, #{integration,jdbcType=INTEGER}, #{growth,jdbcType=INTEGER},
#{sourceType,jdbcType=INTEGER}, #{integration,jdbcType=INTEGER}, #{growth,jdbcType=INTEGER},
#{createDate,jdbcType=TIMESTAMP}, #{createBy,jdbcType=BIGINT}, #{updateDate,jdbcType=TIMESTAMP},
#{createDate,jdbcType=TIMESTAMP}, #{createBy,jdbcType=BIGINT}, #{updateDate,jdbcType=TIMESTAMP},
#{updateBy,jdbcType=BIGINT}, #{deleteStatus,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR},
#{updateBy,jdbcType=BIGINT}, #{deleteStatus,jdbcType=INTEGER}, #{name,jdbcType=VARCHAR},
...
@@ -172,11 +169,11 @@
...
@@ -172,11 +169,11 @@
#{loginTime,jdbcType=TIMESTAMP})
#{loginTime,jdbcType=TIMESTAMP})
</insert>
</insert>
<insert
id=
"insertSelective"
parameterType=
"com.macro.mall.model.UmsMember"
>
<insert
id=
"insertSelective"
parameterType=
"com.macro.mall.model.UmsMember"
>
<selectKey
keyProperty=
"id"
order=
"AFTER"
resultType=
"java.lang.Long"
>
SELECT LAST_INSERT_ID()
</selectKey>
insert into ums_member
insert into ums_member
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<trim
prefix=
"("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
id,
</if>
<if
test=
"memberLevelId != null"
>
<if
test=
"memberLevelId != null"
>
member_level_id,
member_level_id,
</if>
</if>
...
@@ -293,6 +290,9 @@
...
@@ -293,6 +290,9 @@
</if>
</if>
</trim>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"id != null"
>
#{id,jdbcType=BIGINT},
</if>
<if
test=
"memberLevelId != null"
>
<if
test=
"memberLevelId != null"
>
#{memberLevelId,jdbcType=BIGINT},
#{memberLevelId,jdbcType=BIGINT},
</if>
</if>
...
...
mall-service/src/main/java/com/macro/mall/service/member/UmsMemberService.java
View file @
52088261
package
com
.
macro
.
mall
.
service
.
member
;
package
com
.
macro
.
mall
.
service
.
member
;
import
com.macro.mall.common.api.CommonPage
;
import
com.macro.mall.common.api.CommonResult
;
import
com.macro.mall.common.api.CommonResult
;
import
com.macro.mall.domain.UmsMemberVerified
;
import
com.macro.mall.domain.UmsMemberVerified
;
import
com.macro.mall.domain.dto.UmsMemberParam
;
import
com.macro.mall.domain.dto.UmsMemberParam
;
...
@@ -8,6 +9,7 @@ import com.macro.mall.domain.vo.UmsMemberVo;
...
@@ -8,6 +9,7 @@ import com.macro.mall.domain.vo.UmsMemberVo;
import
com.macro.mall.model.UmsAdmin
;
import
com.macro.mall.model.UmsAdmin
;
import
com.macro.mall.model.UmsMember
;
import
com.macro.mall.model.UmsMember
;
import
com.macro.mall.model.common.ResultMsg
;
import
com.macro.mall.model.common.ResultMsg
;
import
com.macro.mall.model.dto.quanxing.UmsMemberDto
;
import
org.springframework.security.core.userdetails.UserDetails
;
import
org.springframework.security.core.userdetails.UserDetails
;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
...
@@ -188,7 +190,7 @@ public interface UmsMemberService {
...
@@ -188,7 +190,7 @@ public interface UmsMemberService {
* @param accouuntType
* @param accouuntType
* @return
* @return
*/
*/
List
<
UmsMember
>
getPageList
(
Integer
pageNum
,
Integer
pageSize
,
Integer
accouuntType
);
CommonPage
<
UmsMemberDto
>
getPageList
(
Integer
pageNum
,
Integer
pageSize
,
Integer
accouuntType
,
String
name
,
String
phone
,
Integer
status
);
/**
/**
* 根据id查询一条会员信息
* 根据id查询一条会员信息
...
...
mall-service/src/main/java/com/macro/mall/service/member/impl/UmsMemberServiceImpl.java
View file @
52088261
package
com
.
macro
.
mall
.
service
.
member
.
impl
;
package
com
.
macro
.
mall
.
service
.
member
.
impl
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageHelper
;
import
com.github.pagehelper.PageInfo
;
import
com.macro.mall.common.api.CommonPage
;
import
com.macro.mall.common.api.CommonResult
;
import
com.macro.mall.common.api.CommonResult
;
import
com.macro.mall.common.api.DateUtils
;
import
com.macro.mall.common.api.DateUtils
;
import
com.macro.mall.dao.UmsMemberDao
;
import
com.macro.mall.dao.UmsMemberDao
;
import
com.macro.mall.dao.quanxing.PmsSupplierAuditDao
;
import
com.macro.mall.domain.MemberDetails
;
import
com.macro.mall.domain.MemberDetails
;
import
com.macro.mall.domain.dto.UmsMemberParam
;
import
com.macro.mall.domain.dto.UmsMemberParam
;
import
com.macro.mall.domain.dto.UmsMemberReview
;
import
com.macro.mall.domain.dto.UmsMemberReview
;
...
@@ -15,6 +18,8 @@ import com.macro.mall.mapper.UmsMemberMapper;
...
@@ -15,6 +18,8 @@ import com.macro.mall.mapper.UmsMemberMapper;
import
com.macro.mall.model.*
;
import
com.macro.mall.model.*
;
import
com.macro.mall.domain.UmsMemberVerified
;
import
com.macro.mall.domain.UmsMemberVerified
;
import
com.macro.mall.model.common.ResultMsg
;
import
com.macro.mall.model.common.ResultMsg
;
import
com.macro.mall.model.dto.PmsSupplierAuditDto
;
import
com.macro.mall.model.dto.quanxing.UmsMemberDto
;
import
com.macro.mall.service.member.UmsMemberAccountService
;
import
com.macro.mall.service.member.UmsMemberAccountService
;
import
com.macro.mall.service.member.UmsMemberService
;
import
com.macro.mall.service.member.UmsMemberService
;
import
com.macro.mall.security.util.CodingUtil
;
import
com.macro.mall.security.util.CodingUtil
;
...
@@ -24,6 +29,7 @@ import com.macro.mall.service.system.RedisService;
...
@@ -24,6 +29,7 @@ import com.macro.mall.service.system.RedisService;
import
com.macro.mall.service.system.UmsAdminService
;
import
com.macro.mall.service.system.UmsAdminService
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.beans.factory.annotation.Value
;
import
org.springframework.security.authentication.BadCredentialsException
;
import
org.springframework.security.authentication.BadCredentialsException
;
...
@@ -74,6 +80,8 @@ public class UmsMemberServiceImpl implements UmsMemberService {
...
@@ -74,6 +80,8 @@ public class UmsMemberServiceImpl implements UmsMemberService {
private
OmsOrderSonMapper
orderSonMapper
;
private
OmsOrderSonMapper
orderSonMapper
;
@Autowired
@Autowired
private
IPmsSupplierAuditService
pmsSupplierAuditService
;
private
IPmsSupplierAuditService
pmsSupplierAuditService
;
@Resource
private
PmsSupplierAuditDao
pmsSupplierAuditDao
;
@Value
(
"${redis.key.prefix.authCode}"
)
@Value
(
"${redis.key.prefix.authCode}"
)
private
String
REDIS_KEY_PREFIX_AUTH_CODE
;
private
String
REDIS_KEY_PREFIX_AUTH_CODE
;
...
@@ -755,17 +763,44 @@ public class UmsMemberServiceImpl implements UmsMemberService {
...
@@ -755,17 +763,44 @@ public class UmsMemberServiceImpl implements UmsMemberService {
* @return
* @return
*/
*/
@Override
@Override
public
List
<
UmsMember
>
getPageList
(
Integer
pageNum
,
Integer
pageSize
,
Integer
accouuntType
){
public
CommonPage
<
UmsMemberDto
>
getPageList
(
Integer
pageNum
,
Integer
pageSize
,
Integer
accouuntType
,
String
name
,
String
phone
,
Integer
status
){
PageHelper
.
startPage
(
pageNum
,
pageSize
);
PageHelper
.
startPage
(
pageNum
,
pageSize
);
UmsMemberExample
example
=
new
UmsMemberExample
();
UmsMemberExample
example
=
new
UmsMemberExample
();
UmsMemberExample
.
Criteria
criteria
=
example
.
createCriteria
();
UmsMemberExample
.
Criteria
criteria
=
example
.
createCriteria
();
if
(
accouuntType
!=
null
){
//如果账号类型不为空
if
(
accouuntType
!=
null
){
//如果账号类型不为空
criteria
.
andAccouuntTypeEqualTo
(
accouuntType
);
criteria
.
andAccouuntTypeEqualTo
(
accouuntType
);
}
}
if
(
name
!=
null
&&
!
""
.
equals
(
name
)){
criteria
.
andNameLike
(
"name"
+
"%"
);
}
if
(
phone
!=
null
&&
!
""
.
equals
(
phone
)){
criteria
.
andPhoneLike
(
"phone"
+
"%"
);
}
if
(
status
!=
null
){
//如果账号类型不为空
criteria
.
andStatusEqualTo
(
status
);
}
//过滤已删除的数据
//过滤已删除的数据
criteria
.
andDeleteStatusEqualTo
(
0
);
//删除标识0 未删除 1已删除
criteria
.
andDeleteStatusEqualTo
(
0
);
//删除标识0 未删除 1已删除
List
<
UmsMember
>
umsMemberList
=
this
.
umsMemberMapper
.
selectByExample
(
example
);
List
<
UmsMember
>
dataList
=
this
.
umsMemberMapper
.
selectByExample
(
example
);
return
umsMemberList
;
//记录下 pagehelper第一次分页查询的 返回得总条数 等信息
PageInfo
<
UmsMember
>
pageInfo
=
new
PageInfo
<>(
dataList
);
//创建List对象
List
<
UmsMemberDto
>
umdList
=
new
ArrayList
<>();
dataList
.
forEach
(
umsMember
->
{
UmsMemberDto
umsMemberDto
=
new
UmsMemberDto
();
//将属性赋值到另一个对象中去
BeanUtils
.
copyProperties
(
umsMember
,
umsMemberDto
);
umsMemberDto
.
setPmsSupplierAudit
(
this
.
pmsSupplierAuditDao
.
selectOneByMemberId
(
umsMember
.
getId
()));
umdList
.
add
(
umsMemberDto
);
});
//因为进行了第二次查询 所以pageHelp得分页总数得到了变化 导致不准确 因此我们需要手动校准一下
CommonPage
<
UmsMemberDto
>
result
=
new
CommonPage
<
UmsMemberDto
>();
result
.
setTotalPage
(
pageInfo
.
getPages
());
result
.
setPageNum
(
pageInfo
.
getPageNum
());
result
.
setPageSize
(
pageInfo
.
getPageSize
());
result
.
setTotal
(
pageInfo
.
getTotal
());
result
.
setList
(
umdList
);
return
result
;
}
}
/**
/**
...
...
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