Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Z
zhny
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
王夏晖
zhny
Commits
6ca9af48
Commit
6ca9af48
authored
May 16, 2018
by
王夏晖
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
团队后台维护
parent
9d438574
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
220 additions
and
0 deletions
+220
-0
BusTeamRepository.java
...rcisoft/business/evaluate/team/dao/BusTeamRepository.java
+9
-0
BusTeamController.java
...rcisoft/business/manage/controller/BusTeamController.java
+73
-0
BusTeamService.java
...a/org/rcisoft/business/manage/service/BusTeamService.java
+47
-0
BusTeamServiceImpl.java
...soft/business/manage/service/impl/BusTeamServiceImpl.java
+91
-0
No files found.
src/main/java/org/rcisoft/business/evaluate/team/dao/BusTeamRepository.java
View file @
6ca9af48
...
...
@@ -32,6 +32,15 @@ public interface BusTeamRepository extends BaseMapper<BusTeam>{
@Select
(
"<script>select * from bus_team</script>"
)
List
<
Map
<
String
,
Object
>>
listTeamAll
();
/**
* 分页查询 busTeam
*
*/
@Select
(
"<script>select a.*,b.* from bus_team a,sys_principal b where a.pri_id =b.pri_id "
+
" and team_type = #{teamType}"
+
"</script>"
)
List
<
Map
<
String
,
Object
>>
queryBusTeams
(
@Param
(
"teamType"
)
String
teamType
);
}
src/main/java/org/rcisoft/business/manage/controller/BusTeamController.java
0 → 100644
View file @
6ca9af48
package
org
.
rcisoft
.
business
.
manage
.
controller
;
/*固定导入*/
import
io.swagger.annotations.ApiOperation
;
import
org.rcisoft.business.evaluate.team.entity.BusTeam
;
import
org.rcisoft.business.manage.service.BusTeamService
;
import
org.rcisoft.core.constant.MessageConstant
;
import
org.rcisoft.core.controller.PaginationController
;
import
org.rcisoft.core.model.GridModel
;
import
org.rcisoft.core.model.PersistModel
;
import
org.rcisoft.core.result.Result
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.propertyeditors.CustomDateEditor
;
import
org.springframework.web.bind.WebDataBinder
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.context.request.WebRequest
;
import
javax.validation.Valid
;
import
java.text.DateFormat
;
import
java.text.SimpleDateFormat
;
import
java.util.Date
;
/**
* Created by on 2018-5-16 14:34:55.
*/
@RestController
@RequestMapping
(
"manage/busteam"
)
public
class
BusTeamController
extends
PaginationController
<
BusTeam
>
{
@Autowired
private
BusTeamService
busTeamServiceImpl
;
@ApiOperation
(
value
=
"添加"
,
notes
=
"添加"
)
@PostMapping
(
value
=
"/add"
)
public
Result
add
(
@Valid
BusTeam
busTeam
)
{
PersistModel
data
=
busTeamServiceImpl
.
save
(
busTeam
);
return
Result
.
builder
(
data
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
busTeam
);
}
@ApiOperation
(
value
=
"修改"
,
notes
=
"修改"
)
@PutMapping
(
"/update"
)
public
Result
update
(
@Valid
BusTeam
busTeam
)
{
PersistModel
data
=
busTeamServiceImpl
.
merge
(
busTeam
);
return
Result
.
builder
(
data
);
}
@ApiOperation
(
value
=
"删除"
,
notes
=
"删除"
)
@DeleteMapping
(
"/delete"
)
public
Result
update
(
@RequestParam
String
id
)
{
PersistModel
data
=
busTeamServiceImpl
.
delete
(
id
);
return
Result
.
builder
(
data
);
}
@ApiOperation
(
value
=
"查看 集合"
,
notes
=
"查看 集合"
)
@GetMapping
(
value
=
"/queryBusTeamByPagination"
)
public
GridModel
listByPagination
(
@RequestParam
String
teamType
)
{
busTeamServiceImpl
.
findAllByPagination
(
getPaginationUtility
(),
teamType
);
return
getGridModelResponse
();
}
@InitBinder
public
void
initBinder
(
WebDataBinder
webDataBinder
,
WebRequest
webRequest
)
{
DateFormat
dateFormat
=
new
SimpleDateFormat
(
"yyyy-MM-dd HH:mm:ss"
);
webDataBinder
.
registerCustomEditor
(
Date
.
class
,
new
CustomDateEditor
(
dateFormat
,
true
));
}
}
src/main/java/org/rcisoft/business/manage/service/BusTeamService.java
0 → 100644
View file @
6ca9af48
package
org
.
rcisoft
.
business
.
manage
.
service
;
import
org.rcisoft.business.evaluate.team.entity.BusTeam
;
import
org.rcisoft.core.aop.PageUtil
;
import
org.rcisoft.core.model.PersistModel
;
import
java.util.List
;
import
java.util.Map
;
/**
* Created by on 2018-5-16 14:34:55.
*/
public
interface
BusTeamService
{
/**
* 保存
* @param busTeam
* @return
*/
PersistModel
save
(
BusTeam
busTeam
);
/**
* 修改
* @param busTeam
* @return
*/
PersistModel
merge
(
BusTeam
busTeam
);
/**
* 删除
* @return
*/
PersistModel
delete
(
String
id
);
/**
* 分页查询
* @return
*/
List
<
Map
<
String
,
Object
>>
findAllByPagination
(
PageUtil
<
BusTeam
>
paginationUtility
,
String
teamType
);
}
src/main/java/org/rcisoft/business/manage/service/impl/BusTeamServiceImpl.java
0 → 100644
View file @
6ca9af48
package
org
.
rcisoft
.
business
.
manage
.
service
.
impl
;
import
lombok.extern.slf4j.Slf4j
;
import
org.rcisoft.business.evaluate.team.dao.BusTeamRepository
;
import
org.rcisoft.business.evaluate.team.entity.BusTeam
;
import
org.rcisoft.business.manage.service.BusTeamService
;
import
org.rcisoft.core.aop.PageUtil
;
import
org.rcisoft.core.model.PersistModel
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Isolation
;
import
org.springframework.transaction.annotation.Propagation
;
import
org.springframework.transaction.annotation.Transactional
;
import
tk.mybatis.mapper.entity.Example
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.UUID
;
/**
* Created by on 2018-5-16 14:34:55.
*/
@Service
@Transactional
(
readOnly
=
true
,
propagation
=
Propagation
.
NOT_SUPPORTED
)
@Slf4j
public
class
BusTeamServiceImpl
implements
BusTeamService
{
@Autowired
private
BusTeamRepository
busTeamRepository
;
/**
* 保存 busTeam
* @param busTeam
* @return
*/
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
@Override
public
PersistModel
save
(
BusTeam
busTeam
){
//增加操作
busTeam
.
setTeamId
(
UUID
.
randomUUID
().
toString
().
replace
(
"-"
,
""
));
int
line
=
busTeamRepository
.
insertSelective
(
busTeam
);
return
new
PersistModel
(
line
);
}
/**
* 修改 busTeam
* @param busTeam
* @return
*/
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
@Override
public
PersistModel
merge
(
BusTeam
busTeam
){
Integer
line
=
0
;
String
message
=
""
;
Example
example
=
new
Example
(
BusTeam
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andEqualTo
(
"teamId"
,
busTeam
.
getTeamId
());
if
(
busTeam
.
getTeamId
()!=
null
&&
!
busTeam
.
getTeamId
().
equals
(
""
)){
line
=
busTeamRepository
.
updateByExampleSelective
(
busTeam
,
example
);
}
else
{
message
=
"ID为空,更新失败"
;
}
return
new
PersistModel
(
line
,
message
);
}
@Override
public
PersistModel
delete
(
String
id
)
{
Integer
line
=
0
;
String
message
=
""
;
Example
example
=
new
Example
(
BusTeam
.
class
);
Example
.
Criteria
criteria
=
example
.
createCriteria
();
criteria
.
andEqualTo
(
"teamId"
,
id
);
if
(
id
!=
null
&&
!
id
.
equals
(
""
)){
line
=
busTeamRepository
.
deleteByExample
(
example
);
}
else
{
message
=
"ID为空,删除失败"
;
}
return
new
PersistModel
(
line
,
message
);
}
/**
* 分页查询 busTeam
* @return
*/
public
List
<
Map
<
String
,
Object
>>
findAllByPagination
(
PageUtil
<
BusTeam
>
paginationUtility
,
String
teamType
){
return
busTeamRepository
.
queryBusTeams
(
teamType
);
}
}
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