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
2ade57d6
Commit
2ade57d6
authored
Dec 11, 2017
by
YangZhaoJun1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
接口调整
parent
cd7bbdf0
Changes
24
Hide whitespace changes
Inline
Side-by-side
Showing
24 changed files
with
95 additions
and
64 deletions
+95
-64
BCarouselController.java
...ft/business/bcarousel/controller/BCarouselController.java
+5
-1
BChapterController.java
...soft/business/bchapter/controller/BChapterController.java
+5
-1
BClassController.java
.../rcisoft/business/bclass/controller/BClassController.java
+2
-2
BClassRepository.java
...ava/org/rcisoft/business/bclass/dao/BClassRepository.java
+2
-2
BClassServiceImpl.java
...isoft/business/bclass/service/impl/BClassServiceImpl.java
+9
-6
BLessonController.java
...cisoft/business/blesson/controller/BLessonController.java
+6
-2
BLessonServiceImpl.java
...oft/business/blesson/service/impl/BLessonServiceImpl.java
+7
-3
BSlController.java
...va/org/rcisoft/business/bsl/controller/BSlController.java
+5
-1
BStudentController.java
...soft/business/bstudent/controller/BStudentController.java
+1
-1
BStudentServiceImpl.java
...t/business/bstudent/service/impl/BStudentServiceImpl.java
+6
-5
BTeacherController.java
...soft/business/bteacher/controller/BTeacherController.java
+1
-1
BTeacherServiceImpl.java
...t/business/bteacher/service/impl/BTeacherServiceImpl.java
+6
-5
BTermController.java
...rg/rcisoft/business/bterm/controller/BTermController.java
+1
-1
BTermServiceImpl.java
...rcisoft/business/bterm/service/impl/BTermServiceImpl.java
+6
-3
MvcConfig.java
src/main/java/org/rcisoft/config/MvcConfig.java
+2
-2
SecurityConfig.java
src/main/java/org/rcisoft/config/SecurityConfig.java
+1
-0
DataEntity.java
src/main/java/org/rcisoft/core/entity/DataEntity.java
+2
-2
ResultCode.java
src/main/java/org/rcisoft/core/result/ResultCode.java
+1
-0
UploadUtil.java
src/main/java/org/rcisoft/core/util/UploadUtil.java
+4
-6
UserUtil.java
src/main/java/org/rcisoft/core/util/UserUtil.java
+0
-2
ExcelDownloadController.java
...n/java/org/rcisoft/sys/excel/ExcelDownloadController.java
+14
-11
spring-devtools.properties
src/main/resources/META-INF/spring-devtools.properties
+2
-0
application-dev.yml
src/main/resources/application-dev.yml
+2
-2
BClassMapper.xml
.../resources/mapper/business/bclass/mapper/BClassMapper.xml
+5
-5
No files found.
src/main/java/org/rcisoft/business/bcarousel/controller/BCarouselController.java
View file @
2ade57d6
...
...
@@ -124,7 +124,11 @@ public class BCarouselController extends PaginationController<BCarousel> {
public
Result
upload
(
MultipartFile
file
){
String
path
=
global
.
getBASE_UPLOAD_SERVER_LOCATION
();
String
sl_logo_path
=
global
.
getIMAGE_LOCATION
()+
global
.
getIMAGES_LOCATION
();
Map
<
String
,
Object
>
uploadResult
=
UploadUtil
.
picImport
(
path
,
sl_logo_path
,
file
);
boolean
type
=
false
;
if
((
global
.
getSERVER_LINUX
()).
equals
(
global
.
getIS_SERVER_LINUX
())){
type
=
true
;
}
Map
<
String
,
Object
>
uploadResult
=
UploadUtil
.
picImport
(
path
,
sl_logo_path
,
file
,
type
);
if
((
boolean
)
uploadResult
.
get
(
UploadUtil
.
IS_SUCCESSS
))
{
String
url
=
(
String
)
uploadResult
.
get
(
UploadUtil
.
URL
);
return
Result
.
builder
(
new
PersistModel
(
1
),
...
...
src/main/java/org/rcisoft/business/bchapter/controller/BChapterController.java
View file @
2ade57d6
...
...
@@ -118,7 +118,11 @@ public class BChapterController extends PaginationController<BChapter> {
public
Map
<
String
,
Object
>
uploadMdFile
(
@RequestParam
(
name
=
"editormd-image-file"
)
MultipartFile
image
)
{
String
path
=
global
.
getMD_FILE_LOCATION
();
String
basePath
=
global
.
getBASE_UPLOAD_SERVER_LOCATION
();
Map
<
String
,
Object
>
pic
=
UploadUtil
.
picImport
(
basePath
,
path
,
image
);
boolean
type
=
false
;
if
((
global
.
getSERVER_LINUX
()).
equals
(
global
.
getIS_SERVER_LINUX
())){
type
=
true
;
}
Map
<
String
,
Object
>
pic
=
UploadUtil
.
picImport
(
basePath
,
path
,
image
,
type
);
Map
<
String
,
Object
>
result
=
new
HashMap
<>();
if
(!(
boolean
)
pic
.
get
(
UploadUtil
.
IS_SUCCESSS
))
{
result
.
put
(
"success"
,
0
);
...
...
src/main/java/org/rcisoft/business/bclass/controller/BClassController.java
View file @
2ade57d6
...
...
@@ -68,7 +68,7 @@ public class BClassController extends PaginationController<BClass> {
public
Result
remove
(
String
id
)
{
PersistModel
data
=
bClassService
.
removeBClass
(
id
);
return
Result
.
builder
(
data
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
data
.
getInfluenceReason
()
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
id
);
}
...
...
@@ -110,7 +110,7 @@ public class BClassController extends PaginationController<BClass> {
return
gridModel
;
}
@ApiOperation
(
value
=
"根据条件查询班级"
,
notes
=
"根据URL中的参数
分页
查询全部班级"
)
@ApiOperation
(
value
=
"根据条件查询班级"
,
notes
=
"根据URL中的参数查询全部班级"
)
@ApiImplicitParams
({
@ApiImplicitParam
(
name
=
"businessId"
,
value
=
"businessId"
,
required
=
true
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"code"
,
value
=
"班级编号"
,
required
=
false
,
dataType
=
"varchar"
),
@ApiImplicitParam
(
name
=
"className"
,
value
=
"班级名称"
,
required
=
false
,
dataType
=
"varchar"
),
...
...
src/main/java/org/rcisoft/business/bclass/dao/BClassRepository.java
View file @
2ade57d6
...
...
@@ -16,7 +16,7 @@ public interface BClassRepository extends BaseMapper<BClass> {
/**
* 根据条件查找
* @param
param
* @param
bClass
* @return
*/
// @Select("<script>select * from b_class b where b.del_flag != 1" +
...
...
@@ -24,7 +24,7 @@ public interface BClassRepository extends BaseMapper<BClass> {
// "<if test=\"num!=null\">and b.`student_num` = #{num}</if></script>)")
// @Select("select * from b_class")
// @ResultMap(value = "BaseResultMap" )
List
<
BClass
>
queryBClasss
(
Map
<
String
,
Object
>
param
);
List
<
BClass
>
queryBClasss
(
BClass
bClass
);
/**
* 更新班级人数
...
...
src/main/java/org/rcisoft/business/bclass/service/impl/BClassServiceImpl.java
View file @
2ade57d6
...
...
@@ -7,6 +7,7 @@ import org.rcisoft.business.bclass.entity.BClass;
import
org.rcisoft.business.bclass.service.BClassService
;
import
org.rcisoft.business.brclassstudent.dao.BRClassStudentRepository
;
import
org.rcisoft.core.aop.PageUtil
;
import
org.rcisoft.core.constant.MessageConstant
;
import
org.rcisoft.core.exception.ServiceException
;
import
org.rcisoft.core.model.PersistModel
;
import
org.rcisoft.core.result.ResultServiceEnums
;
...
...
@@ -42,12 +43,12 @@ public class BClassServiceImpl implements BClassService {
@Override
public
List
<
BClass
>
queryBClasssByPagination
(
PageUtil
pageUtil
,
BClass
model
)
{
return
bClassRepository
.
queryBClasss
(
queryParamHandler
(
model
)
);
return
bClassRepository
.
queryBClasss
(
model
);
}
@Override
public
List
<
BClass
>
queryBClasss
(
BClass
model
)
{
return
bClassRepository
.
queryBClasss
(
queryParamHandler
(
model
)
);
return
bClassRepository
.
queryBClasss
(
model
);
}
...
...
@@ -70,10 +71,12 @@ public class BClassServiceImpl implements BClassService {
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
@Override
public
PersistModel
removeBClass
(
String
id
)
{
if
(
brClassStudentRepository
.
selectStuentNumByClassId
(
id
)>
0
)
throw
new
ServiceException
(
ResultServiceEnums
.
CLASS_HAS_STUDENTS
);
if
(
brClassStudentRepository
.
selectStuentNumByClassId
(
id
)>
0
)
{
//throw new ServiceException(ResultServiceEnums.CLASS_HAS_STUDENTS);
return
new
PersistModel
(
1
,
(
ResultServiceEnums
.
CLASS_HAS_STUDENTS
).
getMessage
());
}
int
line
=
bClassRepository
.
deleteByPrimaryKey
(
id
);
return
new
PersistModel
(
line
);
return
new
PersistModel
(
line
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
);
}
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
...
...
@@ -120,7 +123,7 @@ public class BClassServiceImpl implements BClassService {
private
Map
<
String
,
Object
>
queryParamHandler
(
BClass
model
){
Map
param
=
new
HashMap
<
String
,
Object
>();
if
(
model
.
getClassName
()!=
null
)
if
(
!
model
.
getClassName
().
equals
(
""
)&&
model
.
getClassName
()!=
""
)
param
.
put
(
"name"
,
"%"
+
model
.
getClassName
()+
"%"
);
else
param
.
put
(
"name"
,
"%%"
);
...
...
src/main/java/org/rcisoft/business/blesson/controller/BLessonController.java
View file @
2ade57d6
...
...
@@ -74,7 +74,7 @@ public class BLessonController extends PaginationController<BLesson> {
public
Result
remove
(
String
id
)
{
PersistModel
data
=
bLessonService
.
removeBLesson
(
id
);
return
Result
.
builder
(
data
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
data
.
getInfluenceReason
()
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
id
);
}
...
...
@@ -99,7 +99,11 @@ public class BLessonController extends PaginationController<BLesson> {
public
Result
picImport
(
MultipartFile
importFile
,
String
code
)
throws
Exception
{
String
path
=
global
.
getBASE_UPLOAD_SERVER_LOCATION
();
String
course_logo_path
=
global
.
getIMAGE_LOCATION
()+
global
.
getCOURCE_LOGO_LOCATION
();
Map
<
String
,
Object
>
map
=
UploadUtil
.
picImport
(
path
,
course_logo_path
,
importFile
);
boolean
type
=
false
;
if
((
global
.
getSERVER_LINUX
()).
equals
(
global
.
getIS_SERVER_LINUX
())){
type
=
true
;
}
Map
<
String
,
Object
>
map
=
UploadUtil
.
picImport
(
path
,
course_logo_path
,
importFile
,
type
);
if
(
map
.
get
(
UploadUtil
.
IS_SUCCESSS
).
equals
(
true
))
{
BLesson
bL
=
new
BLesson
();
...
...
src/main/java/org/rcisoft/business/blesson/service/impl/BLessonServiceImpl.java
View file @
2ade57d6
...
...
@@ -8,6 +8,7 @@ import org.rcisoft.business.blesson.service.BLessonService;
import
org.rcisoft.business.bsl.dao.BSlRepository
;
import
org.rcisoft.common.component.Global
;
import
org.rcisoft.core.aop.PageUtil
;
import
org.rcisoft.core.constant.MessageConstant
;
import
org.rcisoft.core.exception.ServiceException
;
import
org.rcisoft.core.model.PersistModel
;
import
org.rcisoft.core.result.ResultServiceEnums
;
...
...
@@ -164,10 +165,13 @@ public class BLessonServiceImpl implements BLessonService {
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
@Override
public
PersistModel
removeBLesson
(
String
id
)
{
if
(
bSlRepository
.
selectslNumByLesson
(
id
)>
0
)
throw
new
ServiceException
(
ResultServiceEnums
.
LESSON_HAS_SL
);
if
(
bSlRepository
.
selectslNumByLesson
(
id
)>
0
)
{
//throw new ServiceException(ResultServiceEnums.LESSON_HAS_SL);
return
new
PersistModel
(
1
,
(
ResultServiceEnums
.
LESSON_HAS_SL
).
getMessage
());
}
int
line
=
bLessonRepository
.
deleteByPrimaryKey
(
id
);
return
new
PersistModel
(
line
);
return
new
PersistModel
(
line
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
);
}
private
Map
<
String
,
Object
>
queryParamHandler
(
BLesson
model
){
...
...
src/main/java/org/rcisoft/business/bsl/controller/BSlController.java
View file @
2ade57d6
...
...
@@ -192,7 +192,11 @@ public class BSlController extends PaginationController<BSl> {
@RequestParam
(
"id"
)
String
id
)
{
String
path
=
global
.
getBASE_UPLOAD_SERVER_LOCATION
();
String
sl_logo_path
=
global
.
getIMAGE_LOCATION
()
+
global
.
getLANCH_LOGO_LOCATION
();
Map
<
String
,
Object
>
uploadResult
=
UploadUtil
.
picImport
(
path
,
sl_logo_path
,
cover
);
boolean
type
=
false
;
if
((
global
.
getSERVER_LINUX
()).
equals
(
global
.
getIS_SERVER_LINUX
())){
type
=
true
;
}
Map
<
String
,
Object
>
uploadResult
=
UploadUtil
.
picImport
(
path
,
sl_logo_path
,
cover
,
type
);
if
((
boolean
)
uploadResult
.
get
(
UploadUtil
.
IS_SUCCESSS
))
{
String
url
=
(
String
)
uploadResult
.
get
(
UploadUtil
.
URL
);
BSl
bSl
=
new
BSl
();
...
...
src/main/java/org/rcisoft/business/bstudent/controller/BStudentController.java
View file @
2ade57d6
...
...
@@ -127,7 +127,7 @@ public class BStudentController extends PaginationController<BStudent> {
public
Result
remove
(
String
id
)
{
PersistModel
data
=
bStudentService
.
removeBBStudent
(
id
);
return
Result
.
builder
(
data
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
data
.
getInfluenceReason
()
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
id
);
}
...
...
src/main/java/org/rcisoft/business/bstudent/service/impl/BStudentServiceImpl.java
View file @
2ade57d6
...
...
@@ -8,6 +8,7 @@ import org.rcisoft.business.bstudent.entity.BStudent;
import
org.rcisoft.business.bstudent.service.BStudentService
;
import
org.rcisoft.common.component.Global
;
import
org.rcisoft.core.aop.PageUtil
;
import
org.rcisoft.core.constant.MessageConstant
;
import
org.rcisoft.core.entity.DataEntity
;
import
org.rcisoft.core.exception.ServiceException
;
import
org.rcisoft.core.model.PersistModel
;
...
...
@@ -243,12 +244,12 @@ public class BStudentServiceImpl implements BStudentService {
@Override
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
PersistModel
removeBBStudent
(
String
id
)
{
if
(
brSlStudentRepository
.
selectSlNumByStuId
(
id
)>
0
)
throw
new
ServiceException
(
ResultServiceEnums
.
STUDENT_HAS_SL
);
/*User user = userRepository.selectUserByStuOrTeaId(id,"b_student"
);
userService.removeUser(user);*/
if
(
brSlStudentRepository
.
selectSlNumByStuId
(
id
)>
0
)
{
return
new
PersistModel
(
1
,
(
ResultServiceEnums
.
STUDENT_HAS_SL
).
getMessage
()
);
//throw new ServiceException(ResultServiceEnums.STUDENT_HAS_SL
);
}
int
line
=
bStudentRepository
.
deleteByPrimaryKey
(
id
);
return
new
PersistModel
(
line
);
return
new
PersistModel
(
line
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
);
}
@Override
...
...
src/main/java/org/rcisoft/business/bteacher/controller/BTeacherController.java
View file @
2ade57d6
...
...
@@ -66,7 +66,7 @@ public class BTeacherController extends PaginationController<BTeacher> {
public
Result
remove
(
String
id
)
{
PersistModel
data
=
bTeacherService
.
removeBTeacher
(
id
);
return
Result
.
builder
(
data
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
data
.
getInfluenceReason
()
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
id
);
}
...
...
src/main/java/org/rcisoft/business/bteacher/service/impl/BTeacherServiceImpl.java
View file @
2ade57d6
...
...
@@ -8,6 +8,7 @@ import org.rcisoft.business.bteacher.entity.BTeacher;
import
org.rcisoft.business.bteacher.service.BTeacherService
;
import
org.rcisoft.common.component.Global
;
import
org.rcisoft.core.aop.PageUtil
;
import
org.rcisoft.core.constant.MessageConstant
;
import
org.rcisoft.core.entity.DataEntity
;
import
org.rcisoft.core.exception.ServiceException
;
import
org.rcisoft.core.model.PersistModel
;
...
...
@@ -190,12 +191,12 @@ public class BTeacherServiceImpl implements BTeacherService {
@Override
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
PersistModel
removeBTeacher
(
String
id
)
{
if
(
bSlRepository
.
selectSlNumByStuent
(
id
)>
0
)
throw
new
ServiceException
(
ResultServiceEnums
.
TEACHER_HAS_SL
);
/*User user =userRepository.selectUserByStuOrTeaId(id,"b_teacher"
);
userService.removeUser(user);*/
if
(
bSlRepository
.
selectSlNumByStuent
(
id
)>
0
)
{
//
throw new ServiceException(ResultServiceEnums.TEACHER_HAS_SL);
return
new
PersistModel
(
1
,
(
ResultServiceEnums
.
TEACHER_HAS_SL
).
getMessage
()
);
}
int
line
=
bTeacherRepository
.
deleteByPrimaryKey
(
id
);
return
new
PersistModel
(
line
);
return
new
PersistModel
(
line
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
);
}
@Override
...
...
src/main/java/org/rcisoft/business/bterm/controller/BTermController.java
View file @
2ade57d6
...
...
@@ -116,7 +116,7 @@ public class BTermController extends PaginationController<BTerm> {
public
Result
remove
(
String
id
)
{
PersistModel
data
=
bTermService
.
removeBTerm
(
id
);
return
Result
.
builder
(
data
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
data
.
getInfluenceReason
()
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
id
);
}
...
...
src/main/java/org/rcisoft/business/bterm/service/impl/BTermServiceImpl.java
View file @
2ade57d6
...
...
@@ -6,6 +6,7 @@ import org.rcisoft.business.bterm.entity.BTerm;
import
org.rcisoft.business.bterm.enums.BTermEnum
;
import
org.rcisoft.business.bterm.service.BTermService
;
import
org.rcisoft.core.aop.PageUtil
;
import
org.rcisoft.core.constant.MessageConstant
;
import
org.rcisoft.core.exception.ServiceException
;
import
org.rcisoft.core.model.PersistModel
;
import
org.rcisoft.core.result.ResultServiceEnums
;
...
...
@@ -69,10 +70,12 @@ public class BTermServiceImpl implements BTermService {
@Override
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
readOnly
=
false
)
public
PersistModel
removeBTerm
(
String
id
)
{
if
(
bSlRepository
.
selectslNumByTermId
(
id
)>
0
)
throw
new
ServiceException
(
ResultServiceEnums
.
TERM_HAS_SL
);
if
(
bSlRepository
.
selectslNumByTermId
(
id
)>
0
)
{
return
new
PersistModel
(
1
,
(
ResultServiceEnums
.
TERM_HAS_SL
).
getMessage
());
//throw new ServiceException(ResultServiceEnums.TERM_HAS_SL);
}
int
line
=
bTermRepository
.
deleteByPrimaryKey
(
id
);
return
new
PersistModel
(
line
);
return
new
PersistModel
(
line
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
);
}
...
...
src/main/java/org/rcisoft/config/MvcConfig.java
View file @
2ade57d6
...
...
@@ -90,8 +90,8 @@ public class MvcConfig extends WebMvcConfigurerAdapter {
else
result
.
setCode
(
ResultCode
.
UNAUTHORIZED
).
setMessage
(
e
.
getMessage
());
}
else
if
(
e
instanceof
AccessDeniedException
)
{
log
.
info
(
e
.
getMessage
());
result
.
setCode
(
ResultCode
.
UNAUTHORIZED
).
setMessage
(
""
);
//无权限 @PreAuthorize("hasRole('ROLE_1001')")
result
.
setCode
(
ResultCode
.
UNAUTHORIZED
).
setMessage
(
"
无访问权限
"
);
}
else
{
result
.
setCode
(
ResultCode
.
INTERNAL_SERVER_ERROR
).
setMessage
(
"接口 ["
+
request
.
getRequestURI
()
+
"] 内部错误,请联系管理员"
);
String
message
=
String
.
format
(
"接口 [%s] 出现异常,方法:%s.%s,异常摘要:%s"
,
...
...
src/main/java/org/rcisoft/config/SecurityConfig.java
View file @
2ade57d6
...
...
@@ -78,6 +78,7 @@ public class SecurityConfig extends WebSecurityConfigurerAdapter {
.
antMatchers
(
"/api-docs/**"
).
permitAll
()
.
antMatchers
(
"/auth/**"
).
permitAll
()
//登录注册等请求过滤
.
antMatchers
(
"/code/**"
).
permitAll
()
//登录注册等请求过滤
.
antMatchers
(
"/excelUtil/**"
).
permitAll
()
//excel类
.
antMatchers
(
"/"
,
"/*.html"
,
...
...
src/main/java/org/rcisoft/core/entity/DataEntity.java
View file @
2ade57d6
...
...
@@ -61,14 +61,14 @@ public abstract class DataEntity<T> implements Serializable {
* 设置启用
*/
public
void
setStart
(){
this
.
set
Del
Flag
(
FlagStatus
.
NORMAL
.
getStatus
());
this
.
setFlag
(
FlagStatus
.
NORMAL
.
getStatus
());
}
/**
* 设置停用
*/
public
void
setStop
(){
this
.
set
Del
Flag
(
FlagStatus
.
ABNORMAL
.
getStatus
());
this
.
setFlag
(
FlagStatus
.
ABNORMAL
.
getStatus
());
}
}
src/main/java/org/rcisoft/core/result/ResultCode.java
View file @
2ade57d6
...
...
@@ -10,6 +10,7 @@ public enum ResultCode {
NOT_FOUND
(
404
),
//接口不存在
INTERNAL_SERVER_ERROR
(
500
);
//服务器内部错误
public
int
code
;
ResultCode
(
int
code
)
{
...
...
src/main/java/org/rcisoft/core/util/UploadUtil.java
View file @
2ade57d6
...
...
@@ -27,9 +27,8 @@ public class UploadUtil {
* @param multipartFile 上传的文件
* @return
*/
public
static
Map
<
String
,
Object
>
picImport
(
String
basePath
,
String
uploadPath
,
MultipartFile
multipartFile
)
{
public
static
Map
<
String
,
Object
>
picImport
(
String
basePath
,
String
uploadPath
,
MultipartFile
multipartFile
,
boolean
type
)
{
Map
<
String
,
Object
>
map
=
new
HashMap
<
String
,
Object
>();
Global
global
=
new
Global
();
try
{
UUID
uuid
=
UUID
.
randomUUID
();
Calendar
calendar
=
Calendar
.
getInstance
();
...
...
@@ -56,10 +55,9 @@ public class UploadUtil {
String
fileurl
=
realPath
+
filename
;
multipartFile
.
transferTo
(
new
File
(
fileurl
));
//上传到服务器,在服务器上新建一个文件夹,放图片,
// 图片是multipartFile中包含的,也就是说,实际上传给我的参数中,multipartFile就是图片的代表。
System
.
out
.
println
(
global
.
getSERVER_LINUX
());
System
.
out
.
println
(
global
.
getIS_SERVER_LINUX
());
if
((
global
.
getSERVER_LINUX
()).
equals
(
global
.
getIS_SERVER_LINUX
()))
Runtime
.
getRuntime
().
exec
(
"chmod -R 755 "
+
basePath
);
if
(
type
)
{
Runtime
.
getRuntime
().
exec
(
"chmod -R 755 "
+
basePath
);
}
map
.
put
(
IS_SUCCESSS
,
true
);
map
.
put
(
URL
,
userPath
.
substring
(
1
,
userPath
.
length
())
+
filename
);
//url中是图片的路径,应该是服务器上图片
//的路径,我在controller中调用这个方法时间,直接看返回值,如果isSuccess是true,则取出url,然后将其存入数据库,如果
...
...
src/main/java/org/rcisoft/core/util/UserUtil.java
View file @
2ade57d6
...
...
@@ -51,7 +51,6 @@ public class UserUtil {
/**
* 增加实体
* @param entity
* @param token
*/
public
static
void
setCurrentPersistOperation
(
IdEntity
entity
)
{
entity
.
setCreateBy
(
UserUtil
.
getAuthenBusinessId
());
...
...
@@ -66,7 +65,6 @@ public class UserUtil {
/**
* 修改实体
* @param entity
* @param token
*/
public
static
void
setCurrentMergeOperation
(
IdEntity
entity
)
{
entity
.
setUpdateBy
(
UserUtil
.
getAuthenBusinessId
());
...
...
src/main/java/org/rcisoft/sys/excel/ExcelDownloadController.java
View file @
2ade57d6
...
...
@@ -6,6 +6,8 @@ import org.rcisoft.common.component.Global;
import
org.rcisoft.core.exception.ServiceException
;
import
org.rcisoft.core.result.ResultServiceEnums
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.util.ResourceUtils
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletRequest
;
...
...
@@ -16,7 +18,9 @@ import java.net.URLEncoder;
/**
* Created by gaowenfeng on 2017/8/2.
*/
@RestController
@RequestMapping
(
"/excelUtil"
)
public
class
ExcelDownloadController
{
private
static
final
String
STUDNET_FILE_NAME
=
"student.xls"
;
private
static
final
String
TEACHER_FILE_NAME
=
"teacher.xls"
;
...
...
@@ -31,15 +35,14 @@ public class ExcelDownloadController {
@ApiOperation
(
value
=
"下载excel模板"
,
notes
=
"下载excel模板"
)
@ApiImplicitParam
(
name
=
"type"
,
value
=
"模板类型"
,
required
=
false
,
dataType
=
"varchar"
)
@
Pos
tMapping
(
"excelWithoutAuth"
)
@
Ge
tMapping
(
"excelWithoutAuth"
)
public
void
excelDownLoad
(
HttpServletRequest
request
,
HttpServletResponse
response
,
@RequestParam
(
"type"
)
String
type
)
throws
Exception
{
String
path
=
request
.
getServletContext
().
getRealPath
(
global
.
getEXCEL_TEMPLATE_LOCATION
());
InputStream
in
=
null
;
OutputStream
out
=
null
;
File
file
=
getDownLoadFile
(
type
,
path
);
File
file
=
getDownLoadFile
(
type
);
if
(
file
==
null
)
throw
new
ServiceException
(
ResultServiceEnums
.
TEMPLAGE_NOT_EXISTS
);
in
=
new
BufferedInputStream
(
new
FileInputStream
(
file
));
...
...
@@ -60,29 +63,29 @@ public class ExcelDownloadController {
excelDownLoad
(
request
,
response
,
type
);
}
private
File
getDownLoadFile
(
String
type
,
String
path
)
{
private
File
getDownLoadFile
(
String
type
)
throws
Exception
{
File
file
=
null
;
switch
(
type
)
{
case
"1"
:
file
=
new
File
(
path
+
STUDNET_FILE_NAME
);
file
=
ResourceUtils
.
getFile
(
"classpath:"
+
global
.
getEXCEL_TEMPLATE_LOCATION
()+
STUDNET_FILE_NAME
);
break
;
case
"2"
:
file
=
new
File
(
path
+
TEACHER_FILE_NAME
);
file
=
ResourceUtils
.
getFile
(
"classpath:"
+
global
.
getEXCEL_TEMPLATE_LOCATION
()+
TEACHER_FILE_NAME
);
break
;
case
"3"
:
file
=
new
File
(
path
+
CLASS_FILE_NAME
);
file
=
ResourceUtils
.
getFile
(
"classpath:"
+
global
.
getEXCEL_TEMPLATE_LOCATION
()+
CLASS_FILE_NAME
);
break
;
case
"4"
:
file
=
new
File
(
path
+
STUDENT_CLASS_FILE_NAME
);
file
=
ResourceUtils
.
getFile
(
"classpath:"
+
global
.
getEXCEL_TEMPLATE_LOCATION
()+
STUDENT_CLASS_FILE_NAME
);
break
;
case
"5"
:
file
=
new
File
(
path
+
STUDNET_SL_FILE_NAME
);
file
=
ResourceUtils
.
getFile
(
"classpath:"
+
global
.
getEXCEL_TEMPLATE_LOCATION
()+
STUDNET_SL_FILE_NAME
);
break
;
case
"6"
:
file
=
new
File
(
path
+
LESSON_FILE_NAME
);
file
=
ResourceUtils
.
getFile
(
"classpath:"
+
global
.
getEXCEL_TEMPLATE_LOCATION
()+
LESSON_FILE_NAME
);
break
;
case
"7"
:
file
=
new
File
(
path
+
SL_FILE_NAME
);
file
=
ResourceUtils
.
getFile
(
"classpath:"
+
global
.
getEXCEL_TEMPLATE_LOCATION
()+
SL_FILE_NAME
);
break
;
}
return
file
;
...
...
src/main/resources/META-INF/spring-devtools.properties
0 → 100644
View file @
2ade57d6
#没有此配置文件查询方法会报相同实体类无法转换问题 ----- entity cannot be cast to entity
restart.include.companycommonlibs
=
tk/mybatis.*
\ No newline at end of file
src/main/resources/application-dev.yml
View file @
2ade57d6
...
...
@@ -106,7 +106,7 @@ global:
video_location
:
/video
temp_location
:
/temp
file_location
:
/file
excel_template_location
:
/WEB-INF/classes/
excel-template/
excel_template_location
:
excel-template/
cource_logo_location
:
/course/logo
images_location
:
/images
lanch_logo_location
:
/lanch/logo
...
...
@@ -117,7 +117,7 @@ global:
server_url
:
http://gwf.natapp.cc/eduServer
server_linux
:
1
login_secert_key
:
"
base64EncodedSecretKey"
is_server_linux
:
1
is_server_linux
:
5
max_code_length
:
15
session_admin_header_value
:
pYez25-y7nqPfm9seY2S
code
:
...
...
src/main/resources/mapper/business/bclass/mapper/BClassMapper.xml
View file @
2ade57d6
...
...
@@ -17,12 +17,12 @@
<select
id=
"queryBClasss"
resultMap=
"BaseResultMap"
>
SELECT * FROM b_class b
WHERE b.del_flag
= 1
<if
test=
"
name!=null
"
>
AND b.class_name LIKE
#{name} OR b.code LIKE #{name}
WHERE b.del_flag
!= '1'
<if
test=
"
className!=null and className != ''
"
>
AND b.class_name LIKE
CONCAT('%',#{className},'%') OR b.code LIKE CONCAT('%',#{className},'%')
</if>
<if
test=
"
num!=null
"
>
AND b.student_num = #{
n
um}
<if
test=
"
studentNum!=null and studentNum != ''
"
>
AND b.student_num = #{
studentN
um}
</if>
</select>
...
...
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