Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
E
education
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
李丛阳
education
Commits
3856c8c6
Commit
3856c8c6
authored
May 16, 2018
by
刘子正
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
教师BTeacher、学生BStudent、班级BClass、教室BRooms、角色SysRole、用户SysUser 改为物理删除,统一异常编号
parent
b4ab840c
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
14 additions
and
14 deletions
+14
-14
BClassServiceImpl.java
...isoft/business/bclass/service/impl/BClassServiceImpl.java
+1
-1
BRoomsController.java
.../rcisoft/business/brooms/controller/BRoomsController.java
+1
-1
BRoomsServiceImpl.java
...isoft/business/brooms/service/impl/BRoomsServiceImpl.java
+3
-3
BStudentController.java
...soft/business/bstudent/controller/BStudentController.java
+1
-1
BStudentServiceImpl.java
...t/business/bstudent/service/impl/BStudentServiceImpl.java
+2
-2
BTeacherController.java
...soft/business/bteacher/controller/BTeacherController.java
+1
-1
BTeacherServiceImpl.java
...t/business/bteacher/service/impl/BTeacherServiceImpl.java
+3
-3
SysRoleServiceImpl.java
...org/rcisoft/sys/role/service/impl/SysRoleServiceImpl.java
+1
-1
SysUserServiceImpl.java
...org/rcisoft/sys/user/service/impl/SysUserServiceImpl.java
+1
-1
No files found.
src/main/java/org/rcisoft/business/bclass/service/impl/BClassServiceImpl.java
View file @
3856c8c6
...
@@ -77,7 +77,7 @@ public class BClassServiceImpl implements BClassService {
...
@@ -77,7 +77,7 @@ public class BClassServiceImpl implements BClassService {
@Override
@Override
public
PersistModel
removeBClass
(
String
id
)
{
public
PersistModel
removeBClass
(
String
id
)
{
if
(
brClassStudentRepository
.
selectStuentNumByClassId
(
id
)>
0
)
{
if
(
brClassStudentRepository
.
selectStuentNumByClassId
(
id
)>
0
)
{
throw
new
ServiceException
(
ResultServiceEnums
.
CLASS_HAS_STUDENTS
);
throw
new
ServiceException
(
ResultServiceEnums
.
DATA_HAS_USED
);
}
}
int
line
=
bClassRepository
.
deleteByPrimaryKey
(
id
);
int
line
=
bClassRepository
.
deleteByPrimaryKey
(
id
);
return
new
PersistModel
(
line
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
);
return
new
PersistModel
(
line
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
);
...
...
src/main/java/org/rcisoft/business/brooms/controller/BRoomsController.java
View file @
3856c8c6
...
@@ -68,7 +68,7 @@ public class BRoomsController extends FileController<BRooms> {
...
@@ -68,7 +68,7 @@ public class BRoomsController extends FileController<BRooms> {
bRooms
);
bRooms
);
}
}
@ApiOperation
(
value
=
"
逻辑删除"
,
notes
=
"逻辑
删除"
)
@ApiOperation
(
value
=
"
物理删除"
,
notes
=
"物理
删除"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"id"
,
required
=
true
,
dataType
=
"varchar"
)})
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"id"
,
value
=
"id"
,
required
=
true
,
dataType
=
"varchar"
)})
@DeleteMapping
(
"/delete/{id:\\w+}"
)
@DeleteMapping
(
"/delete/{id:\\w+}"
)
public
Result
delete
(
@PathVariable
String
id
)
{
public
Result
delete
(
@PathVariable
String
id
)
{
...
...
src/main/java/org/rcisoft/business/brooms/service/impl/BRoomsServiceImpl.java
View file @
3856c8c6
...
@@ -62,7 +62,7 @@ public class BRoomsServiceImpl implements BRoomsService {
...
@@ -62,7 +62,7 @@ public class BRoomsServiceImpl implements BRoomsService {
}
}
/**
/**
*
逻辑
删除
*
物理
删除
* @param bRooms
* @param bRooms
* @return
* @return
*/
*/
...
@@ -71,10 +71,10 @@ public class BRoomsServiceImpl implements BRoomsService {
...
@@ -71,10 +71,10 @@ public class BRoomsServiceImpl implements BRoomsService {
public
PersistModel
remove
(
BRooms
bRooms
){
public
PersistModel
remove
(
BRooms
bRooms
){
if
(
bArrangeRepository
.
countThisRoomNum
(
bRooms
.
getBusinessId
())
!=
0
if
(
bArrangeRepository
.
countThisRoomNum
(
bRooms
.
getBusinessId
())
!=
0
||
bSlScheduleRepository
.
countThisRoomNum
(
bRooms
.
getBusinessId
())
!=
0
){
||
bSlScheduleRepository
.
countThisRoomNum
(
bRooms
.
getBusinessId
())
!=
0
){
throw
new
ServiceException
(
ResultServiceEnums
.
ROOM
_HAS_USED
);
throw
new
ServiceException
(
ResultServiceEnums
.
DATA
_HAS_USED
);
}
else
{
}
else
{
int
line
=
bRoomsRepository
.
deleteByPrimaryKey
(
bRooms
.
getBusinessId
());
int
line
=
bRoomsRepository
.
deleteByPrimaryKey
(
bRooms
.
getBusinessId
());
log
.
info
(
UserUtil
.
getUserInfoProp
(
bRooms
.
getToken
(),
UserUtil
.
USER_USERNAME
)+
"
逻辑
删除了ID为"
+
log
.
info
(
UserUtil
.
getUserInfoProp
(
bRooms
.
getToken
(),
UserUtil
.
USER_USERNAME
)+
"
物理
删除了ID为"
+
bRooms
.
getBusinessId
()+
"的信息"
);
bRooms
.
getBusinessId
()+
"的信息"
);
return
new
PersistModel
(
line
);
return
new
PersistModel
(
line
);
}
}
...
...
src/main/java/org/rcisoft/business/bstudent/controller/BStudentController.java
View file @
3856c8c6
...
@@ -122,7 +122,7 @@ public class BStudentController extends PaginationController<BStudent> {
...
@@ -122,7 +122,7 @@ public class BStudentController extends PaginationController<BStudent> {
}
}
@ApiOperation
(
value
=
"
逻辑
删除"
,
notes
=
"根据ID删除一条记录"
)
@ApiOperation
(
value
=
"
物理
删除"
,
notes
=
"根据ID删除一条记录"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"businessId"
,
required
=
true
,
dataType
=
"varchar"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"businessId"
,
required
=
true
,
dataType
=
"varchar"
)
@PreAuthorize
(
"hasRole('ROLE_1001')"
)
@PreAuthorize
(
"hasRole('ROLE_1001')"
)
@PostMapping
(
value
=
"/remove"
)
@PostMapping
(
value
=
"/remove"
)
...
...
src/main/java/org/rcisoft/business/bstudent/service/impl/BStudentServiceImpl.java
View file @
3856c8c6
...
@@ -259,7 +259,7 @@ public class BStudentServiceImpl implements BStudentService {
...
@@ -259,7 +259,7 @@ public class BStudentServiceImpl implements BStudentService {
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
PersistModel
removeBBStudent
(
String
id
)
{
public
PersistModel
removeBBStudent
(
String
id
)
{
if
(
brSlStudentRepository
.
selectSlNumByStuId
(
id
)>
0
)
{
if
(
brSlStudentRepository
.
selectSlNumByStuId
(
id
)>
0
)
{
throw
new
ServiceException
(
ResultServiceEnums
.
STUDENT_HAS_SL
);
throw
new
ServiceException
(
ResultServiceEnums
.
DATA_HAS_USED
);
}
}
BStudent
bStudent
=
new
BStudent
();
BStudent
bStudent
=
new
BStudent
();
bStudent
.
setBusinessId
(
id
);
bStudent
.
setBusinessId
(
id
);
...
@@ -268,7 +268,7 @@ public class BStudentServiceImpl implements BStudentService {
...
@@ -268,7 +268,7 @@ public class BStudentServiceImpl implements BStudentService {
bStudent
.
setDeleted
();
bStudent
.
setDeleted
();
UserUtil
.
setCurrentMergeOperation
(
bStudent
);
UserUtil
.
setCurrentMergeOperation
(
bStudent
);
int
line
=
bStudentRepository
.
logicalDelete
(
bStudent
);
int
line
=
bStudentRepository
.
deleteByPrimaryKey
(
bStudent
);
brClassStudentRepository
.
deleteCSByStuId
(
student
.
getCode
());
brClassStudentRepository
.
deleteCSByStuId
(
student
.
getCode
());
return
new
PersistModel
(
line
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
);
return
new
PersistModel
(
line
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
);
...
...
src/main/java/org/rcisoft/business/bteacher/controller/BTeacherController.java
View file @
3856c8c6
...
@@ -63,7 +63,7 @@ public class BTeacherController extends PaginationController<BTeacher> {
...
@@ -63,7 +63,7 @@ public class BTeacherController extends PaginationController<BTeacher> {
bTeacher
);
bTeacher
);
}
}
@ApiOperation
(
value
=
"
逻辑
删除"
,
notes
=
"根据ID删除一条记录"
)
@ApiOperation
(
value
=
"
物理
删除"
,
notes
=
"根据ID删除一条记录"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"businessId"
,
required
=
true
,
dataType
=
"varchar"
)
@ApiImplicitParam
(
name
=
"id"
,
value
=
"businessId"
,
required
=
true
,
dataType
=
"varchar"
)
@PreAuthorize
(
"hasRole('ROLE_1001')"
)
@PreAuthorize
(
"hasRole('ROLE_1001')"
)
@PostMapping
(
value
=
"/remove"
)
@PostMapping
(
value
=
"/remove"
)
...
...
src/main/java/org/rcisoft/business/bteacher/service/impl/BTeacherServiceImpl.java
View file @
3856c8c6
...
@@ -215,15 +215,15 @@ public class BTeacherServiceImpl implements BTeacherService {
...
@@ -215,15 +215,15 @@ public class BTeacherServiceImpl implements BTeacherService {
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
PersistModel
removeBTeacher
(
String
id
)
{
public
PersistModel
removeBTeacher
(
String
id
)
{
if
(
bSlRepository
.
selectSlNumByStuent
(
id
)>
0
)
{
if
(
bSlRepository
.
selectSlNumByStuent
(
id
)>
0
)
{
throw
new
ServiceException
(
ResultServiceEnums
.
TEACHER_HAS_SL
);
throw
new
ServiceException
(
ResultServiceEnums
.
DATA_HAS_USED
);
}
}
BTeacher
bTeacher
=
new
BTeacher
();
BTeacher
bTeacher
=
new
BTeacher
();
bTeacher
.
setBusinessId
(
id
);
bTeacher
.
setBusinessId
(
id
);
BTeacher
teacher
=
bTeacherRepository
.
selectOne
(
bTeacher
);
BTeacher
teacher
=
bTeacherRepository
.
selectOne
(
bTeacher
);
UserUtil
.
setCurrentMergeOperation
(
bTeacher
);
UserUtil
.
setCurrentMergeOperation
(
bTeacher
);
sysUserMapper
.
deleteByCode
(
teacher
.
getCode
());
sysUserMapper
.
deleteByCode
(
teacher
.
getCode
());
bTeacher
.
setDeleted
();
//
bTeacher.setDeleted();
int
line
=
bTeacherRepository
.
logicalDelete
(
bTeacher
);
int
line
=
bTeacherRepository
.
deleteByPrimaryKey
(
bTeacher
);
return
new
PersistModel
(
line
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
);
return
new
PersistModel
(
line
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
);
}
}
...
...
src/main/java/org/rcisoft/sys/role/service/impl/SysRoleServiceImpl.java
View file @
3856c8c6
...
@@ -68,7 +68,7 @@ public class SysRoleServiceImpl implements SysRoleService {
...
@@ -68,7 +68,7 @@ public class SysRoleServiceImpl implements SysRoleService {
int
userCount
=
sysUserMapper
.
countUserByRole
(
id
);
int
userCount
=
sysUserMapper
.
countUserByRole
(
id
);
//如果仍然有用户(如果用户被逻辑删除,则忽略此角色,但如果用于被停用,则依然被计算)是此角色,则该角色不可删除
//如果仍然有用户(如果用户被逻辑删除,则忽略此角色,但如果用于被停用,则依然被计算)是此角色,则该角色不可删除
if
(
userCount
>
0
){
if
(
userCount
>
0
){
throw
new
ServiceException
(
ResultServiceEnums
.
ROLE_HAS_USER
);
throw
new
ServiceException
(
ResultServiceEnums
.
DATA_HAS_USED
);
}
else
{
}
else
{
//删除该角色所有的关联信息
//删除该角色所有的关联信息
sysRoleRepository
.
deleteRoleMenuByRoleId
(
id
);
sysRoleRepository
.
deleteRoleMenuByRoleId
(
id
);
...
...
src/main/java/org/rcisoft/sys/user/service/impl/SysUserServiceImpl.java
View file @
3856c8c6
...
@@ -81,7 +81,7 @@ public class SysUserServiceImpl implements SysUserService {
...
@@ -81,7 +81,7 @@ public class SysUserServiceImpl implements SysUserService {
user
.
setDeleted
();
user
.
setDeleted
();
user
.
setStop
();
user
.
setStop
();
user
.
setBusinessId
(
id
);
user
.
setBusinessId
(
id
);
return
sysUserMapper
.
logicalDelete
(
user
);
return
sysUserMapper
.
deleteByPrimaryKey
(
user
);
}
}
@Override
@Override
...
...
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