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
0f8826c9
Commit
0f8826c9
authored
Dec 10, 2019
by
hanfeng
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
客户管理
parent
21ff9ff5
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
184 additions
and
2 deletions
+184
-2
BaseController.java
...m/github/wxiaoqi/security/common/rest/BaseController.java
+2
-2
AppStaffUser.java
...om/github/wxiaoqi/security/admin/entity/AppStaffUser.java
+43
-0
AppStaffUserBiz.java
...om/github/wxiaoqi/security/admin/biz/AppStaffUserBiz.java
+53
-0
AppStaffUserMapper.java
...hub/wxiaoqi/security/admin/mapper/AppStaffUserMapper.java
+10
-0
AppStaffUserController.java
...b/wxiaoqi/security/admin/rest/AppStaffUserController.java
+76
-0
No files found.
ace-common/src/main/java/com/github/wxiaoqi/security/common/rest/BaseController.java
View file @
0f8826c9
...
...
@@ -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/entity/AppStaffUser.java
0 → 100644
View file @
0f8826c9
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/src/main/java/com/github/wxiaoqi/security/admin/biz/AppStaffUserBiz.java
0 → 100644
View file @
0f8826c9
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.mapper.AppStaffUserMapper
;
import
com.github.wxiaoqi.security.common.biz.BaseBiz
;
import
org.springframework.stereotype.Service
;
import
tk.mybatis.mapper.entity.Example
;
import
java.util.Date
;
import
java.util.List
;
/**
* @author Administrator
*/
@Service
public
class
AppStaffUserBiz
extends
BaseBiz
<
AppStaffUserMapper
,
AppStaffUser
>
{
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
();
if
(
appStaffUser
.
getId
()!=
null
)
{
criteria
.
andEqualTo
(
"id"
,
appStaffUser
.
getId
());
}
if
(
appStaffUser
.
getPhone
()!=
null
){
criteria
.
andEqualTo
(
"phone"
,
appStaffUser
.
getPhone
());
}
return
mapper
.
selectOneByExample
(
example
);
}
}
ace-modules/ace-admin/src/main/java/com/github/wxiaoqi/security/admin/mapper/AppStaffUserMapper.java
0 → 100644
View file @
0f8826c9
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/rest/AppStaffUserController.java
0 → 100644
View file @
0f8826c9
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.ApiOperation
;
import
io.swagger.models.auth.In
;
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
})
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
()))
{
baseBiz
.
getAll
(
userDTO
.
getId
())
;
}
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
(
"查询一条"
)
@PostMapping
(
value
=
"one"
)
public
ObjectRestResponse
<
AppStaffUser
>
findOne
(
@RequestParam
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
.
updateById
(
staffUser
);
return
ObjectRestResponse
.
succ
();
}
}
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