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
460f091b
Commit
460f091b
authored
May 24, 2018
by
李博今
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
修改教室的数据库存储
parent
b4b04873
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
55 additions
and
1 deletion
+55
-1
BRoomsRepository.java
...ava/org/rcisoft/business/brooms/dao/BRoomsRepository.java
+2
-0
BRooms.java
src/main/java/org/rcisoft/business/brooms/entity/BRooms.java
+24
-0
BRoomsServiceImpl.java
...isoft/business/brooms/service/impl/BRoomsServiceImpl.java
+19
-0
ResultServiceEnums.java
...main/java/org/rcisoft/core/result/ResultServiceEnums.java
+9
-1
BRoomsMapper.xml
.../resources/mapper/business/brooms/mapper/BRoomsMapper.xml
+1
-0
No files found.
src/main/java/org/rcisoft/business/brooms/dao/BRoomsRepository.java
View file @
460f091b
...
@@ -37,6 +37,8 @@ public interface BRoomsRepository extends BaseMapper<BRooms> {
...
@@ -37,6 +37,8 @@ public interface BRoomsRepository extends BaseMapper<BRooms> {
@Select
(
"<script>select count(*) from b_rooms where code = #{code} </script>"
)
@Select
(
"<script>select count(*) from b_rooms where code = #{code} </script>"
)
int
avoidRepeatCode
(
String
code
);
int
avoidRepeatCode
(
String
code
);
@Select
(
"<script>select count(*) from b_rooms where classroom_name = #{classroomName} </script>"
)
int
avoidRepeatCode2
(
String
classroomName
);
int
addExcel
(
List
<
BRooms
>
list
);
int
addExcel
(
List
<
BRooms
>
list
);
}
}
...
...
src/main/java/org/rcisoft/business/brooms/entity/BRooms.java
View file @
460f091b
...
@@ -69,6 +69,9 @@ public class BRooms extends IdEntity<BRooms> {
...
@@ -69,6 +69,9 @@ public class BRooms extends IdEntity<BRooms> {
@Transient
@Transient
private
String
transitCategory
;
private
String
transitCategory
;
@Transient
private
String
transitBuilding
;
@Transient
@Transient
private
String
condition
;
//模糊查询条件
private
String
condition
;
//模糊查询条件
...
@@ -91,6 +94,27 @@ public class BRooms extends IdEntity<BRooms> {
...
@@ -91,6 +94,27 @@ public class BRooms extends IdEntity<BRooms> {
return
this
.
transitCampus
;
return
this
.
transitCampus
;
}
}
public
String
getTransitBuilding
(){
if
(
this
.
building
!=
null
&&
!
this
.
building
.
equals
(
""
)){
switch
(
this
.
building
)
{
case
"0"
:
this
.
transitBuilding
=
"A区"
;
break
;
case
"1"
:
this
.
transitBuilding
=
"B区"
;
break
;
case
"2"
:
this
.
transitBuilding
=
"C区"
;
break
;
case
"3"
:
this
.
transitBuilding
=
"D区"
;
break
;
}
}
return
this
.
transitBuilding
;
}
public
String
getTransitCategory
(){
public
String
getTransitCategory
(){
if
(
this
.
transitCategory
!=
null
&&
!
this
.
transitCategory
.
equals
(
""
)){
if
(
this
.
transitCategory
!=
null
&&
!
this
.
transitCategory
.
equals
(
""
)){
switch
(
this
.
transitCategory
)
{
switch
(
this
.
transitCategory
)
{
...
...
src/main/java/org/rcisoft/business/brooms/service/impl/BRoomsServiceImpl.java
View file @
460f091b
...
@@ -50,6 +50,8 @@ public class BRoomsServiceImpl implements BRoomsService {
...
@@ -50,6 +50,8 @@ public class BRoomsServiceImpl implements BRoomsService {
//判断是否存在重复编码
//判断是否存在重复编码
if
(
bRoomsRepository
.
avoidRepeatCode
(
bRooms
.
getCode
())
!=
0
){
if
(
bRoomsRepository
.
avoidRepeatCode
(
bRooms
.
getCode
())
!=
0
){
throw
new
ServiceException
(
ResultServiceEnums
.
EXISE_ROOM_CODE
);
throw
new
ServiceException
(
ResultServiceEnums
.
EXISE_ROOM_CODE
);
}
else
if
(
bRoomsRepository
.
avoidRepeatCode2
(
bRooms
.
getClassroomName
())
!=
0
){
throw
new
ServiceException
(
ResultServiceEnums
.
EXISE_ROOM_NAME
);
}
else
{
}
else
{
bRooms
.
setCommonBusinessId
();
bRooms
.
setCommonBusinessId
();
//增加操作
//增加操作
...
@@ -88,6 +90,15 @@ public class BRoomsServiceImpl implements BRoomsService {
...
@@ -88,6 +90,15 @@ public class BRoomsServiceImpl implements BRoomsService {
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
@Override
@Override
public
PersistModel
merge
(
BRooms
bRooms
){
public
PersistModel
merge
(
BRooms
bRooms
){
// if((bRooms.getCode() != null && !bRooms.getCode().equals("")) && bRooms.getCode().length() > 50){
// throw new ServiceException(ResultServiceEnums.ROOM_CODE_TOO_LONG);
// }
// if((bRooms.getClassroomNo() != null && !bRooms.getClassroomNo().equals("")) && bRooms.getClassroomNo().length() > 5){
// throw new ServiceException(ResultServiceEnums.ROOM_BUILDINGNO_TOO_LONG);
// }
// if((bRooms.getClassSeat() != null && bRooms.getClassSeat() > 10000)){
// throw new ServiceException(ResultServiceEnums.ROOM_SEAT_TOO_MANY);
// }
UserUtil
.
setCurrentMergeOperation
(
bRooms
);
UserUtil
.
setCurrentMergeOperation
(
bRooms
);
int
line
=
bRoomsRepository
.
updateByPrimaryKeySelective
(
bRooms
);
int
line
=
bRoomsRepository
.
updateByPrimaryKeySelective
(
bRooms
);
log
.
info
(
UserUtil
.
getUserInfoProp
(
bRooms
.
getToken
(),
UserUtil
.
USER_USERNAME
)+
"修改了ID为"
+
log
.
info
(
UserUtil
.
getUserInfoProp
(
bRooms
.
getToken
(),
UserUtil
.
USER_USERNAME
)+
"修改了ID为"
+
...
@@ -144,6 +155,14 @@ public class BRoomsServiceImpl implements BRoomsService {
...
@@ -144,6 +155,14 @@ public class BRoomsServiceImpl implements BRoomsService {
result
+=
"表中第 "
+
index
+
" 行,编号 "
+
value
[
1
]
+
" 在表中重复 \n"
;
result
+=
"表中第 "
+
index
+
" 行,编号 "
+
value
[
1
]
+
" 在表中重复 \n"
;
continue
;
continue
;
}
}
// if(value[1].length() > 50){
// result += "表中第 " + index + " 行,编号 " + value[1] + " 太长 \n";
// continue;
// }
// if(value[3].length() > 50){
// result += "表中第 " + index + " 行,编号 " + value[3] + " 太长 \n";
// continue;
// }
//Int最大值为2147483648,所以不能超过9位数
//Int最大值为2147483648,所以不能超过9位数
if
(
value
[
5
].
length
()
>=
9
){
if
(
value
[
5
].
length
()
>=
9
){
result
+=
"表中第 "
+
index
+
" 行,编号 "
+
value
[
1
]
+
" 的数据座位数不合法 \n"
;
result
+=
"表中第 "
+
index
+
" 行,编号 "
+
value
[
1
]
+
" 的数据座位数不合法 \n"
;
...
...
src/main/java/org/rcisoft/core/result/ResultServiceEnums.java
View file @
460f091b
...
@@ -190,7 +190,15 @@ public enum ResultServiceEnums {
...
@@ -190,7 +190,15 @@ public enum ResultServiceEnums {
CAN_NOT_OVERLAP
(
101
,
"时间区间不可重叠"
),
CAN_NOT_OVERLAP
(
101
,
"时间区间不可重叠"
),
ROLE_HAS_USED
(
102
,
"当前角色被使用,不可删除"
)
ROLE_HAS_USED
(
102
,
"当前角色被使用,不可删除"
),
EXISE_ROOM_NAME
(
103
,
"当前教室名已存在"
),
ROOM_CODE_TOO_LONG
(
104
,
"编号长度过长"
),
ROOM_BUILDINGNO_TOO_LONG
(
105
,
"教室号长度过长"
),
ROOM_SEAT_TOO_MANY
(
106
,
"人数过多"
)
;
;
private
Integer
code
;
private
Integer
code
;
...
...
src/main/resources/mapper/business/brooms/mapper/BRoomsMapper.xml
View file @
460f091b
...
@@ -6,6 +6,7 @@
...
@@ -6,6 +6,7 @@
<result
column=
"campus"
jdbcType=
"VARCHAR"
property=
"campus"
/>
<result
column=
"campus"
jdbcType=
"VARCHAR"
property=
"campus"
/>
<result
column=
"campus"
jdbcType=
"VARCHAR"
property=
"transitCampus"
/>
<result
column=
"campus"
jdbcType=
"VARCHAR"
property=
"transitCampus"
/>
<result
column=
"building"
jdbcType=
"VARCHAR"
property=
"building"
/>
<result
column=
"building"
jdbcType=
"VARCHAR"
property=
"building"
/>
<result
column=
"building"
jdbcType=
"VARCHAR"
property=
"transitBuilding"
/>
<result
column=
"classroom_no"
jdbcType=
"VARCHAR"
property=
"classroomNo"
/>
<result
column=
"classroom_no"
jdbcType=
"VARCHAR"
property=
"classroomNo"
/>
<result
column=
"classroom_name"
jdbcType=
"VARCHAR"
property=
"classroomName"
/>
<result
column=
"classroom_name"
jdbcType=
"VARCHAR"
property=
"classroomName"
/>
<result
column=
"category"
jdbcType=
"VARCHAR"
property=
"category"
/>
<result
column=
"category"
jdbcType=
"VARCHAR"
property=
"category"
/>
...
...
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