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
1aa41679
Commit
1aa41679
authored
Dec 12, 2019
by
hezhen
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' of
http://113.105.137.151:22280/youjj/cloud-platform
into dev
parents
e29fdfa2
4dfd4444
Changes
11
Hide whitespace changes
Inline
Side-by-side
Showing
11 changed files
with
393 additions
and
11 deletions
+393
-11
BaseController.java
...m/github/wxiaoqi/security/common/rest/BaseController.java
+2
-2
AppUserLogRemarkDTO.java
...ithub/wxiaoqi/security/admin/dto/AppUserLogRemarkDTO.java
+30
-0
AppStaffUser.java
...om/github/wxiaoqi/security/admin/entity/AppStaffUser.java
+43
-0
AppStaffUserVo.java
.../github/wxiaoqi/security/admin/entity/AppStaffUserVo.java
+19
-0
AppUserLogRemark.java
...ithub/wxiaoqi/security/admin/entity/AppUserLogRemark.java
+35
-0
AppStaffUserBiz.java
...om/github/wxiaoqi/security/admin/biz/AppStaffUserBiz.java
+77
-0
AppUserLogRemarkBiz.java
...ithub/wxiaoqi/security/admin/biz/AppUserLogRemarkBiz.java
+52
-0
AppStaffUserMapper.java
...hub/wxiaoqi/security/admin/mapper/AppStaffUserMapper.java
+10
-0
AppUserLogRemarkMapper.java
...wxiaoqi/security/admin/mapper/AppUserLogRemarkMapper.java
+9
-0
AppStaffUserController.java
...b/wxiaoqi/security/admin/rest/AppStaffUserController.java
+78
-0
BaseUserMemberController.java
...wxiaoqi/security/admin/rest/BaseUserMemberController.java
+38
-9
No files found.
ace-common/src/main/java/com/github/wxiaoqi/security/common/rest/BaseController.java
View file @
1aa41679
...
...
@@ -32,7 +32,7 @@ public class BaseController<Biz extends BaseBiz,Entity> extends CommonBaseContro
@ApiOperation
(
"添加"
)
@RequestMapping
(
value
=
""
,
method
=
RequestMethod
.
POST
)
@ResponseBody
public
ObjectRestResponse
<
Entity
>
add
(
@RequestBody
Entity
entity
){
public
ObjectRestResponse
<
Entity
>
add
(
@RequestBody
Entity
entity
)
throws
Exception
{
baseBiz
.
insertSelective
(
entity
);
return
new
ObjectRestResponse
<
Entity
>();
}
...
...
@@ -66,7 +66,7 @@ public class BaseController<Biz extends BaseBiz,Entity> extends CommonBaseContro
@ApiOperation
(
"查询所有"
)
@RequestMapping
(
value
=
"/all"
,
method
=
RequestMethod
.
GET
)
@ResponseBody
public
List
<
Entity
>
all
(){
public
List
<
Entity
>
all
()
throws
Exception
{
return
baseBiz
.
selectListAll
();
}
...
...
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/dto/AppUserLogRemarkDTO.java
0 → 100644
View file @
1aa41679
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
dto
;
import
lombok.Data
;
import
java.util.Date
;
@Data
public
class
AppUserLogRemarkDTO
{
private
Integer
id
;
/**
* 日志内容
*/
private
String
remark
;
/**
* 创建时间
*/
private
Date
crtTime
;
/**
* 用户id
*/
private
Integer
levelId
;
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/entity/AppStaffUser.java
0 → 100644
View file @
1aa41679
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
entity
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
tk.mybatis.mapper.annotation.KeySql
;
import
tk.mybatis.mapper.code.IdentityDialect
;
import
javax.persistence.Column
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
java.util.Date
;
/**
* @author Administrator
*/
@Table
(
name
=
"app_staff_user"
)
@Data
public
class
AppStaffUser
{
@Id
@KeySql
(
dialect
=
IdentityDialect
.
MYSQL
)
private
Integer
id
;
@Column
(
name
=
"su_id"
)
@ApiModelProperty
(
"员工app账号id"
)
private
Integer
suId
;
@Column
(
name
=
"u_name"
)
@ApiModelProperty
(
"客户姓名"
)
private
String
uName
;
@ApiModelProperty
(
"客户手机"
)
private
String
phone
;
@ApiModelProperty
(
"客户公司"
)
private
String
company
;
@ApiModelProperty
(
"备注"
)
private
String
remarks
;
@Column
(
name
=
"crt_time"
)
@ApiModelProperty
(
"创建时间"
)
private
Date
crtTime
;
@Column
(
name
=
"upd_time"
)
@ApiModelProperty
(
"修改时间"
)
private
Date
updTime
;
@Column
(
name
=
"is_del"
)
@ApiModelProperty
(
"状态:0-未删除 1-已删除"
)
private
Integer
isDel
;
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/entity/AppStaffUserVo.java
0 → 100644
View file @
1aa41679
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
entity
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
/**
* @author Administrator
* @Auther: Administrator
* @Date: 2019/12/12 09:52
* @Description:
*/
@Data
public
class
AppStaffUserVo
extends
AppStaffUser
{
@ApiModelProperty
(
"员工姓名"
)
private
String
employeeName
;
@ApiModelProperty
(
"员工手机号"
)
private
String
employeePhone
;
}
ace-modules/ace-admin-api/src/main/java/com/github/wxiaoqi/security/admin/entity/AppUserLogRemark.java
0 → 100644
View file @
1aa41679
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
entity
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
javax.persistence.Column
;
import
javax.persistence.GeneratedValue
;
import
javax.persistence.Id
;
import
javax.persistence.Table
;
import
java.util.Date
;
/**
* APP员工客户日志备注表
*/
@Table
(
name
=
"app_uesr_log_remark"
)
@Data
public
class
AppUserLogRemark
{
@Id
@GeneratedValue
(
generator
=
"JDBC"
)
//此处加上注解
private
Integer
id
;
@ApiModelProperty
(
"日志内容"
)
@Column
(
name
=
"remark"
)
private
String
remark
;
@ApiModelProperty
(
"创建时间"
)
@Column
(
name
=
"crt_time"
)
private
Date
crtTime
;
@ApiModelProperty
(
"用户id"
)
@Column
(
name
=
"level_id"
)
private
Integer
levelId
;
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppStaffUserBiz.java
0 → 100644
View file @
1aa41679
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
biz
;
import
com.alibaba.druid.sql.visitor.functions.If
;
import
com.github.wxiaoqi.security.admin.entity.AppStaffUser
;
import
com.github.wxiaoqi.security.admin.entity.AppStaffUserVo
;
import
com.github.wxiaoqi.security.admin.mapper.AppStaffUserMapper
;
import
com.github.wxiaoqi.security.admin.vo.AppUserVo
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.beans.BeanUtils
;
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
;
/**
* @author Administrator
*/
@Service
@RequiredArgsConstructor
(
onConstructor_
={
@Autowired
})
public
class
AppStaffUserBiz
extends
BaseBiz
<
AppStaffUserMapper
,
AppStaffUser
>
{
private
final
AppUserLoginBiz
appUserLoginBiz
;
private
final
AppUserDetailBiz
appUserDetailBiz
;
public
List
<
AppStaffUser
>
getAll
(
Integer
id
)
{
Example
example
=
new
Example
(
AppStaffUser
.
class
);
example
.
createCriteria
().
andEqualTo
(
"suId"
,
id
).
andEqualTo
(
"isDel"
,
0
);
return
selectByExample
(
example
);
}
@Override
public
int
insertSelectiveRe
(
AppStaffUser
appStaffUser
)
{
appStaffUser
.
setCrtTime
(
new
Date
());
return
mapper
.
insertSelective
(
appStaffUser
);
}
@Override
public
int
updateSelectiveByIdRe
(
AppStaffUser
appStaffUser
)
{
appStaffUser
.
setUpdTime
(
new
Date
());
return
mapper
.
updateByPrimaryKeySelective
(
appStaffUser
);
}
public
AppStaffUser
findOne
(
AppStaffUser
appStaffUser
)
{
Example
example
=
new
Example
(
AppStaffUser
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andEqualTo
(
"isDel"
,
0
);
if
(
appStaffUser
.
getId
()!=
null
)
{
criteria
.
andEqualTo
(
"id"
,
appStaffUser
.
getId
());
return
mapper
.
selectOneByExample
(
example
);
}
if
(
appStaffUser
.
getPhone
()!=
null
){
criteria
.
andEqualTo
(
"phone"
,
appStaffUser
.
getPhone
());
AppStaffUser
staffUser
=
mapper
.
selectOneByExample
(
example
);
if
(
staffUser
!=
null
)
{
AppStaffUserVo
appStaffUserVo
=
new
AppStaffUserVo
();
BeanUtils
.
copyProperties
(
staffUser
,
appStaffUserVo
);
Integer
suId
=
staffUser
.
getSuId
();
AppUserVo
userInfoById
=
appUserDetailBiz
.
getUserInfoById
(
suId
);
appStaffUserVo
.
setEmployeeName
(
userInfoById
.
getRealname
());
appStaffUserVo
.
setEmployeePhone
(
userInfoById
.
getUsername
());
return
appStaffUserVo
;
}
}
return
null
;
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/biz/AppUserLogRemarkBiz.java
0 → 100644
View file @
1aa41679
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
biz
;
import
com.github.wxiaoqi.security.admin.dto.AppUserLogRemarkDTO
;
import
com.github.wxiaoqi.security.admin.entity.AppUserLogRemark
;
import
com.github.wxiaoqi.security.admin.mapper.AppUserLogRemarkMapper
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.util.process.ResultCode
;
import
lombok.extern.slf4j.Slf4j
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
tk.mybatis.mapper.entity.Example
;
import
java.util.List
;
@Transactional
@Service
@Slf4j
public
class
AppUserLogRemarkBiz
extends
BaseBiz
<
AppUserLogRemarkMapper
,
AppUserLogRemark
>
{
/**
* 房车助手下级用户新增
*
* @param appUserLogRemarkDTO
* @return
*/
public
ObjectRestResponse
addAppUserLogRemark
(
AppUserLogRemarkDTO
appUserLogRemarkDTO
)
{
if
(
appUserLogRemarkDTO
==
null
||
StringUtils
.
isBlank
(
appUserLogRemarkDTO
.
getRemark
())
||
appUserLogRemarkDTO
.
getLevelId
()
==
null
)
{
ObjectRestResponse
.
createFailedResult
(
ResultCode
.
NOTEXIST_CODE
,
"参数不能为空"
);
}
AppUserLogRemark
appUserLogRemark
=
new
AppUserLogRemark
();
BeanUtils
.
copyProperties
(
appUserLogRemarkDTO
,
appUserLogRemark
);
insertSelective
(
appUserLogRemark
);
return
ObjectRestResponse
.
succ
();
}
/**
* 房车助手下级用户查询
*/
public
List
<
AppUserLogRemark
>
findAppUserLogRemark
(
Integer
levelId
)
{
Example
example
=
new
Example
(
AppUserLogRemark
.
class
);
example
.
createCriteria
().
andEqualTo
(
"levelId"
,
levelId
);
List
<
AppUserLogRemark
>
list
=
selectByExample
(
example
);
return
list
;
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/mapper/AppStaffUserMapper.java
0 → 100644
View file @
1aa41679
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
mapper
;
import
com.github.wxiaoqi.security.admin.entity.AppStaffUser
;
import
tk.mybatis.mapper.common.Mapper
;
/**
* @author Administrator
*/
public
interface
AppStaffUserMapper
extends
Mapper
<
AppStaffUser
>
{
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/mapper/AppUserLogRemarkMapper.java
0 → 100644
View file @
1aa41679
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
mapper
;
import
com.github.wxiaoqi.security.admin.entity.AppUserLogRemark
;
import
tk.mybatis.mapper.common.Mapper
;
public
interface
AppUserLogRemarkMapper
extends
Mapper
<
AppUserLogRemark
>
{
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/AppStaffUserController.java
0 → 100644
View file @
1aa41679
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
rest
;
import
com.github.wxiaoqi.security.admin.biz.AppStaffUserBiz
;
import
com.github.wxiaoqi.security.admin.entity.AppStaffUser
;
import
com.github.wxiaoqi.security.admin.feign.dto.AppUserDTO
;
import
com.github.wxiaoqi.security.auth.client.config.UserAuthConfig
;
import
com.github.wxiaoqi.security.common.msg.ObjectRestResponse
;
import
com.github.wxiaoqi.security.common.rest.BaseController
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.RequiredArgsConstructor
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
import
java.util.ArrayList
;
import
java.util.List
;
/**
* @author Administrator
*/
@RestController
@RequestMapping
(
"/staff"
)
@RequiredArgsConstructor
(
onConstructor_
=
{
@Autowired
})
@Api
(
tags
=
{
"员工客户管理"
})
public
class
AppStaffUserController
extends
BaseController
<
AppStaffUserBiz
,
AppStaffUser
>
{
private
final
UserAuthConfig
authConfig
;
private
final
HttpServletRequest
request
;
private
final
PublicController
publicController
;
private
final
String
POSITION_NAME
=
"员工"
;
/**
* 获取该用户所用的客户
* @return
* @throws Exception
*/
@Override
@GetMapping
(
"/all"
)
public
List
<
AppStaffUser
>
all
()
throws
Exception
{
AppUserDTO
userDTO
=
(
AppUserDTO
)
publicController
.
userDetailByToken
(
authConfig
.
getToken
(
request
)).
getData
();
if
(
POSITION_NAME
.
equals
(
userDTO
.
getPositionName
()))
{
return
baseBiz
.
getAll
(
userDTO
.
getUserid
())
;
}
return
new
ArrayList
<>();
}
@Override
@ApiOperation
(
"添加"
)
@PostMapping
(
value
=
""
)
public
ObjectRestResponse
<
AppStaffUser
>
add
(
@RequestBody
AppStaffUser
appStaffUser
)
throws
Exception
{
AppUserDTO
userDTO
=
(
AppUserDTO
)
publicController
.
userDetailByToken
(
authConfig
.
getToken
(
request
)).
getData
();
appStaffUser
.
setSuId
(
userDTO
.
getUserid
());
baseBiz
.
insertSelective
(
appStaffUser
);
return
new
ObjectRestResponse
<
AppStaffUser
>();
}
@ApiOperation
(
"查询一条"
)
@GetMapping
(
value
=
"one"
)
public
ObjectRestResponse
<
AppStaffUser
>
findOne
(
AppStaffUser
appStaffUser
)
{
AppStaffUser
staffUser
=
baseBiz
.
findOne
(
appStaffUser
);
if
(
staffUser
!=
null
)
{
return
ObjectRestResponse
.
succ
(
staffUser
);
}
return
ObjectRestResponse
.
succ
();
}
@ApiOperation
(
"删除"
)
@DeleteMapping
(
value
=
"delete/{id}"
)
public
ObjectRestResponse
<
AppStaffUser
>
delete
(
@PathVariable
Integer
id
)
{
AppStaffUser
staffUser
=
new
AppStaffUser
();
staffUser
.
setId
(
id
);
staffUser
.
setIsDel
(
1
);
baseBiz
.
updateSelectiveById
(
staffUser
);
return
ObjectRestResponse
.
succ
();
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/rest/BaseUserMemberController.java
View file @
1aa41679
package
com
.
github
.
wxiaoqi
.
security
.
admin
.
rest
;
import
com.github.wxiaoqi.security.admin.biz.AppUserLogRemarkBiz
;
import
com.github.wxiaoqi.security.admin.biz.BaseUserMemberBiz
;
import
com.github.wxiaoqi.security.admin.dto.AppUserLogRemarkDTO
;
import
com.github.wxiaoqi.security.admin.dto.BaseUserMemberVO
;
import
com.github.wxiaoqi.security.admin.dto.UserMemberDTO
;
import
com.github.wxiaoqi.security.admin.entity.BaseUserMember
;
...
...
@@ -19,6 +21,7 @@ import java.util.Objects;
/**
* 用户会员
*
* @author Administrator
*/
@Slf4j
...
...
@@ -32,38 +35,63 @@ public class BaseUserMemberController extends BaseController<BaseUserMemberBiz,
@Autowired
private
UserAuthConfig
userAuthConfig
;
@Autowired
private
AppUserLogRemarkBiz
appUserLogRemarkBiz
;
/**
* 房车助手下级用户日志新增
*/
@RequestMapping
(
value
=
"admin/addAppUserLogRemark"
,
method
=
RequestMethod
.
POST
)
public
ObjectRestResponse
addAppUserLogRemark
(
AppUserLogRemarkDTO
appUserLogRemarkDTO
)
{
appUserLogRemarkBiz
.
addAppUserLogRemark
(
appUserLogRemarkDTO
);
return
ObjectRestResponse
.
succ
();
}
/**
* 房车助手下级用户日志查询
*/
@RequestMapping
(
value
=
"admin/findAppUserLogRemark"
,
method
=
RequestMethod
.
GET
)
@ApiOperation
(
"房车助手下级用户查询"
)
public
ObjectRestResponse
findAppUserLogRemark
(
Integer
levelId
)
{
return
ObjectRestResponse
.
succ
(
appUserLogRemarkBiz
.
findAppUserLogRemark
(
levelId
));
}
/**
* 获取用户会员
*
* @param userId
* @return
*/
@ApiOperation
(
value
=
"根据用户id获取用户会员信息"
)
@GetMapping
(
"/findOne/{userId}"
)
public
ObjectRestResponse
<
BaseUserMemberVO
>
findOneByUserId
(
@PathVariable
Integer
userId
)
throws
Exception
{
public
ObjectRestResponse
<
BaseUserMemberVO
>
findOneByUserId
(
@PathVariable
Integer
userId
)
throws
Exception
{
BaseUserMemberVO
oneByUserId
=
baseBiz
.
findOneByUserId
(
userId
);
oneByUserId
=(
oneByUserId
==
null
?
new
BaseUserMemberVO
()
:
oneByUserId
);
return
ObjectRestResponse
.
succ
(
oneByUserId
);
oneByUserId
=
(
oneByUserId
==
null
?
new
BaseUserMemberVO
()
:
oneByUserId
);
return
ObjectRestResponse
.
succ
(
oneByUserId
);
}
/**
* 根据token获取用户会员信息
*
* @return
*/
@GetMapping
(
"app/getUserMember"
)
@ApiOperation
(
value
=
"根据token获取用户会员信息"
)
public
ObjectRestResponse
<
BaseUserMemberVO
>
findOneByToken
(){
public
ObjectRestResponse
<
BaseUserMemberVO
>
findOneByToken
()
{
try
{
AppUserDTO
user
=
userFeign
.
userDetailByToken
(
userAuthConfig
.
getToken
(
request
)).
getData
();
return
ObjectRestResponse
.
succ
(
baseBiz
.
findOneByUserId
(
user
.
getUserid
()));
return
ObjectRestResponse
.
succ
(
baseBiz
.
findOneByUserId
(
user
.
getUserid
()));
}
catch
(
Exception
e
)
{
log
.
error
(
e
.
getMessage
(),
e
);
return
ObjectRestResponse
.
createDefaultFail
();
}
}
// /**
...
...
@@ -81,6 +109,7 @@ public class BaseUserMemberController extends BaseController<BaseUserMemberBiz,
/**
* 设置用户会员
*
* @param userMemberDTO
* @return
*/
...
...
@@ -89,15 +118,15 @@ public class BaseUserMemberController extends BaseController<BaseUserMemberBiz,
public
ObjectRestResponse
UpdateUserMember
(
@RequestBody
UserMemberDTO
userMemberDTO
)
throws
Exception
{
if
(
userMemberDTO
==
null
)
{
if
(
userMemberDTO
==
null
)
{
return
ObjectRestResponse
.
createDefaultFail
();
}
if
(
Objects
.
nonNull
(
userMemberDTO
.
getRentFreeDays
())
&&
userMemberDTO
.
getRentFreeDays
()<
0
)
{
if
(
Objects
.
nonNull
(
userMemberDTO
.
getRentFreeDays
())
&&
userMemberDTO
.
getRentFreeDays
()
<
0
)
{
return
ObjectRestResponse
.
createDefaultFail
();
}
if
(
Objects
.
nonNull
(
userMemberDTO
.
getTotalNumber
())
&&
userMemberDTO
.
getTotalNumber
()<
0
)
{
if
(
Objects
.
nonNull
(
userMemberDTO
.
getTotalNumber
())
&&
userMemberDTO
.
getTotalNumber
()
<
0
)
{
return
ObjectRestResponse
.
createDefaultFail
();
}
...
...
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