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
47ba7c3f
Commit
47ba7c3f
authored
Jan 18, 2018
by
YangZhaoJun1
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
整理代码
parent
48e3d55e
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
46 additions
and
43 deletions
+46
-43
BSlServiceImpl.java
...org/rcisoft/business/bsl/service/impl/BSlServiceImpl.java
+1
-0
BStudentServiceImpl.java
...t/business/bstudent/service/impl/BStudentServiceImpl.java
+1
-0
BTeacher.java
...n/java/org/rcisoft/business/bteacher/entity/BTeacher.java
+2
-0
TQuestionController.java
...ft/business/tquestion/controller/TQuestionController.java
+6
-14
TQuestionRepository.java
...g/rcisoft/business/tquestion/dao/TQuestionRepository.java
+1
-1
TQuestion.java
...java/org/rcisoft/business/tquestion/entity/TQuestion.java
+2
-2
TQuestionService.java
.../rcisoft/business/tquestion/service/TQuestionService.java
+3
-3
TQuestionServiceImpl.java
...business/tquestion/service/impl/TQuestionServiceImpl.java
+16
-7
TQuestionMapper.xml
...rces/mapper/business/tquestion/mapper/TQuestionMapper.xml
+14
-16
No files found.
src/main/java/org/rcisoft/business/bsl/service/impl/BSlServiceImpl.java
View file @
47ba7c3f
...
@@ -282,6 +282,7 @@ public class BSlServiceImpl implements BSlService {
...
@@ -282,6 +282,7 @@ public class BSlServiceImpl implements BSlService {
BSl
bsl
=
new
BSl
();
BSl
bsl
=
new
BSl
();
bsl
.
setBusinessId
(
id
);
bsl
.
setBusinessId
(
id
);
UserUtil
.
setCurrentMergeOperation
(
bsl
);
UserUtil
.
setCurrentMergeOperation
(
bsl
);
bSl
.
setDeleted
();
int
line
=
bSlRepository
.
logicalDelete
(
bSl
);
int
line
=
bSlRepository
.
logicalDelete
(
bSl
);
//int line = bSlRepository.deleteByPrimaryKey(id);
//int line = bSlRepository.deleteByPrimaryKey(id);
return
new
PersistModel
(
line
);
return
new
PersistModel
(
line
);
...
...
src/main/java/org/rcisoft/business/bstudent/service/impl/BStudentServiceImpl.java
View file @
47ba7c3f
...
@@ -254,6 +254,7 @@ public class BStudentServiceImpl implements BStudentService {
...
@@ -254,6 +254,7 @@ public class BStudentServiceImpl implements BStudentService {
}
}
BStudent
bStudent
=
new
BStudent
();
BStudent
bStudent
=
new
BStudent
();
bStudent
.
setBusinessId
(
id
);
bStudent
.
setBusinessId
(
id
);
bStudent
.
setDeleted
();
UserUtil
.
setCurrentMergeOperation
(
bStudent
);
UserUtil
.
setCurrentMergeOperation
(
bStudent
);
BStudent
student
=
bStudentRepository
.
selectOne
(
bStudent
);
BStudent
student
=
bStudentRepository
.
selectOne
(
bStudent
);
sysUserMapper
.
deleteByCode
(
student
.
getCode
());
sysUserMapper
.
deleteByCode
(
student
.
getCode
());
...
...
src/main/java/org/rcisoft/business/bteacher/entity/BTeacher.java
View file @
47ba7c3f
...
@@ -3,6 +3,7 @@ package org.rcisoft.business.bteacher.entity;
...
@@ -3,6 +3,7 @@ package org.rcisoft.business.bteacher.entity;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
lombok.NoArgsConstructor
;
import
org.hibernate.validator.constraints.Length
;
import
org.rcisoft.core.entity.IdEntity
;
import
org.rcisoft.core.entity.IdEntity
;
import
javax.persistence.Entity
;
import
javax.persistence.Entity
;
...
@@ -40,6 +41,7 @@ public class BTeacher extends IdEntity<BTeacher> {
...
@@ -40,6 +41,7 @@ public class BTeacher extends IdEntity<BTeacher> {
private
String
recommendCourse
;
private
String
recommendCourse
;
@Transient
@Transient
@Length
(
min
=
1
,
max
=
200
,
message
=
"长度最小为1,最大为15"
)
private
String
name
;
private
String
name
;
@Transient
@Transient
...
...
src/main/java/org/rcisoft/business/tquestion/controller/TQuestionController.java
View file @
47ba7c3f
...
@@ -5,6 +5,7 @@ package org.rcisoft.business.tquestion.controller;
...
@@ -5,6 +5,7 @@ package org.rcisoft.business.tquestion.controller;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParam
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiImplicitParams
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.json.JSONArray
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.validation.BindingResult
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
@@ -30,7 +31,7 @@ import java.util.List;
...
@@ -30,7 +31,7 @@ import java.util.List;
* Created by yangzhaojun on 2018-1-15 19:49:07.
* Created by yangzhaojun on 2018-1-15 19:49:07.
*/
*/
@RestController
@RestController
@RequestMapping
(
"/t
/q
uestion"
)
@RequestMapping
(
"/t
Q
uestion"
)
public
class
TQuestionController
extends
PaginationController
<
TQuestion
>
{
public
class
TQuestionController
extends
PaginationController
<
TQuestion
>
{
@Autowired
@Autowired
...
@@ -40,14 +41,9 @@ public class TQuestionController extends PaginationController<TQuestion> {
...
@@ -40,14 +41,9 @@ public class TQuestionController extends PaginationController<TQuestion> {
@ApiOperation
(
value
=
"添加"
,
notes
=
"添加"
)
@ApiOperation
(
value
=
"添加"
,
notes
=
"添加"
)
//@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = false, dataType = "varchar")})
//@ApiImplicitParams({@ApiImplicitParam(name = "businessId", value = "businessId", required = false, dataType = "varchar")})
@PostMapping
@PostMapping
@PreAuthorize
(
"hasRole('ROLE_1001')"
)
@PreAuthorize
(
"hasRole('ROLE_1002')"
)
public
Result
add
(
@Valid
TQuestion
tQuestion
,
BindingResult
bindingResult
)
{
public
Result
add
(
@Valid
TQuestion
tQuestion
,
String
[]
questionOptions
)
{
if
(
bindingResult
.
hasErrors
())
{
PersistModel
data
=
tQuestionServiceImpl
.
save
(
tQuestion
,
questionOptions
);
throw
new
ServiceException
(
ResultServiceEnums
.
PARAMETER_ERROR
.
getCode
(),
bindingResult
.
getFieldError
().
getDefaultMessage
());
}
tQuestion
.
setToken
(
getToken
());
PersistModel
data
=
tQuestionServiceImpl
.
save
(
tQuestion
);
return
Result
.
builder
(
data
,
return
Result
.
builder
(
data
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
...
@@ -59,11 +55,7 @@ public class TQuestionController extends PaginationController<TQuestion> {
...
@@ -59,11 +55,7 @@ public class TQuestionController extends PaginationController<TQuestion> {
@PostMapping
(
"/remove"
)
@PostMapping
(
"/remove"
)
@PreAuthorize
(
"hasRole('ROLE_1001')"
)
@PreAuthorize
(
"hasRole('ROLE_1001')"
)
public
Result
delete
(
@PathVariable
String
id
)
{
public
Result
delete
(
@PathVariable
String
id
)
{
TQuestion
tQuestion
=
new
TQuestion
();
return
Result
.
builder
(
new
PersistModel
(
tQuestionServiceImpl
.
remove
(
id
,
getToken
())),
tQuestion
.
setBusinessId
(
id
);
tQuestion
.
setToken
(
getToken
());
PersistModel
data
=
tQuestionServiceImpl
.
remove
(
tQuestion
);
return
Result
.
builder
(
data
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
MessageConstant
.
MESSAGE_ALERT_ERROR
,
id
);
id
);
...
...
src/main/java/org/rcisoft/business/tquestion/dao/TQuestionRepository.java
View file @
47ba7c3f
...
@@ -43,7 +43,7 @@ public interface TQuestionRepository extends BaseMapper<TQuestion> {
...
@@ -43,7 +43,7 @@ public interface TQuestionRepository extends BaseMapper<TQuestion> {
+
"where 1=1"
+
"where 1=1"
+
"<if test=\"delFlag !=null and delFlag != '' \">and del_flag = #{delFlag} </if> "
+
"<if test=\"delFlag !=null and delFlag != '' \">and del_flag = #{delFlag} </if> "
+
"<if test=\"flag !=null and flag != '' \">and flag = #{flag} </if> "
+
"<if test=\"flag !=null and flag != '' \">and flag = #{flag} </if> "
+
"<if test=\"business_id != null and business_id != ''\">and business_id = #{business_id}</if>"
)
+
"<if test=\"business_id != null and business_id != ''\">and business_id = #{business_id}</if>
</script>
"
)
List
<
TQuestion
>
queryTQuestions
(
TQuestion
tQuestion
);
List
<
TQuestion
>
queryTQuestions
(
TQuestion
tQuestion
);
}
}
src/main/java/org/rcisoft/business/tquestion/entity/TQuestion.java
View file @
47ba7c3f
...
@@ -20,7 +20,7 @@ import java.util.List;
...
@@ -20,7 +20,7 @@ import java.util.List;
@Table
(
name
=
"t_question"
)
@Table
(
name
=
"t_question"
)
public
class
TQuestion
extends
IdEntity
<
TQuestion
>
{
public
class
TQuestion
extends
IdEntity
<
TQuestion
>
{
private
static
final
long
serialVersionUID
=
-
3700402045439337539L
;
private
String
slId
;
private
String
slId
;
...
@@ -39,7 +39,7 @@ public class TQuestion extends IdEntity<TQuestion> {
...
@@ -39,7 +39,7 @@ public class TQuestion extends IdEntity<TQuestion> {
@Transient
@Transient
private
String
alias
;
private
String
alias
;
@Transient
private
String
desc
;
private
String
desc
;
...
...
src/main/java/org/rcisoft/business/tquestion/service/TQuestionService.java
View file @
47ba7c3f
...
@@ -16,14 +16,14 @@ public interface TQuestionService {
...
@@ -16,14 +16,14 @@ public interface TQuestionService {
* @param tQuestion
* @param tQuestion
* @return
* @return
*/
*/
PersistModel
save
(
TQuestion
tQuestion
);
PersistModel
save
(
TQuestion
tQuestion
,
String
[]
questionOptions
);
/**
/**
* 逻辑删除
* 逻辑删除
* @param
tQuestion
* @param
id
* @return
* @return
*/
*/
PersistModel
remove
(
TQuestion
tQuestio
n
);
int
remove
(
String
id
,
String
toke
n
);
/**
/**
* 修改
* 修改
...
...
src/main/java/org/rcisoft/business/tquestion/service/impl/TQuestionServiceImpl.java
View file @
47ba7c3f
package
org
.
rcisoft
.
business
.
tquestion
.
service
.
impl
;
package
org
.
rcisoft
.
business
.
tquestion
.
service
.
impl
;
import
org.apache.commons.collections.MapUtils
;
import
org.json.JSONArray
;
import
org.rcisoft.business.tquestion.entity.TQuestionOptions
;
import
org.rcisoft.business.tquestion.entity.TQuestionOptions
;
import
org.rcisoft.core.constant.MessageConstant
;
import
org.rcisoft.core.constant.MessageConstant
;
import
org.rcisoft.core.util.UserUtil
;
import
org.rcisoft.core.util.UserUtil
;
...
@@ -17,7 +19,11 @@ import org.springframework.transaction.annotation.Propagation;
...
@@ -17,7 +19,11 @@ import org.springframework.transaction.annotation.Propagation;
import
org.springframework.transaction.annotation.Transactional
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.Arrays
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
lombok.extern.slf4j.Slf4j
;
import
lombok.extern.slf4j.Slf4j
;
/**
/**
...
@@ -39,9 +45,10 @@ public class TQuestionServiceImpl implements TQuestionService {
...
@@ -39,9 +45,10 @@ public class TQuestionServiceImpl implements TQuestionService {
*/
*/
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
@Override
@Override
public
PersistModel
save
(
TQuestion
tQuestion
){
public
PersistModel
save
(
TQuestion
tQuestion
,
String
[]
questionOptions
){
List
<
String
>
list
=
Arrays
.
asList
(
questionOptions
);
Map
map
=
MapUtils
.
putAll
(
new
HashMap
(),
questionOptions
);
TQuestionOptions
tQuestionOptions
=
new
TQuestionOptions
();
TQuestionOptions
tQuestionOptions
=
new
TQuestionOptions
();
tQuestion
.
setCommonBusinessId
();
//增加操作
//增加操作
UserUtil
.
setCurrentPersistOperation
(
tQuestion
);
UserUtil
.
setCurrentPersistOperation
(
tQuestion
);
int
line
=
tQuestionRepository
.
insertSelective
(
tQuestion
);
int
line
=
tQuestionRepository
.
insertSelective
(
tQuestion
);
...
@@ -57,17 +64,19 @@ public class TQuestionServiceImpl implements TQuestionService {
...
@@ -57,17 +64,19 @@ public class TQuestionServiceImpl implements TQuestionService {
/**
/**
* 逻辑删除
* 逻辑删除
* @param
tQuestion
* @param
id
* @return
* @return
*/
*/
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
@Transactional
(
propagation
=
Propagation
.
REQUIRED
,
isolation
=
Isolation
.
DEFAULT
)
@Override
@Override
public
PersistModel
remove
(
TQuestion
tQuestion
){
public
int
remove
(
String
id
,
String
token
){
TQuestion
tQuestion
=
new
TQuestion
();
tQuestion
.
setBusinessId
(
id
);
UserUtil
.
setCurrentMergeOperation
(
tQuestion
);
UserUtil
.
setCurrentMergeOperation
(
tQuestion
);
int
line
=
tQuestionRepository
.
logicalDelete
(
tQuestion
);
int
line
=
tQuestionRepository
.
logicalDelete
(
tQuestion
);
log
.
info
(
UserUtil
.
getUserInfoProp
(
t
Question
.
getToken
()
,
UserUtil
.
USER_USERNAME
)+
"逻辑删除了ID为"
+
log
.
info
(
UserUtil
.
getUserInfoProp
(
t
oken
,
UserUtil
.
USER_USERNAME
)+
"逻辑删除了ID为"
+
tQuestion
.
getBusinessId
()+
"的信息"
);
tQuestion
.
getBusinessId
()+
"的信息"
);
return
new
PersistModel
(
line
,
MessageConstant
.
MESSAGE_ALERT_SUCCESS
)
;
return
line
;
}
}
/**
/**
...
...
src/main/resources/mapper/business/tquestion/mapper/TQuestionMapper.xml
View file @
47ba7c3f
...
@@ -2,21 +2,19 @@
...
@@ -2,21 +2,19 @@
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"org.rcisoft.business.tquestion.dao.TQuestionRepository"
>
<mapper
namespace=
"org.rcisoft.business.tquestion.dao.TQuestionRepository"
>
<resultMap
id=
"BaseResultMap"
type=
"org.rcisoft.business.tquestion.entity.TQuestion"
>
<resultMap
id=
"BaseResultMap"
type=
"org.rcisoft.business.tquestion.entity.TQuestion"
>
<id
column=
"business_id"
jdbcType=
"VARCHAR"
property=
"businessId"
/>
<id
column=
"business_id"
jdbcType=
"VARCHAR"
property=
"businessId"
/>
<result
column=
"sl_id"
jdbcType=
"VARCHAR"
property=
"slId"
/>
<result
column=
"sl_id"
jdbcType=
"VARCHAR"
property=
"slId"
/>
<result
column=
"chap_id"
jdbcType=
"VARCHAR"
property=
"chapId"
/>
<result
column=
"chap_id"
jdbcType=
"VARCHAR"
property=
"chapId"
/>
<result
column=
"qtype"
jdbcType=
"VARCHAR"
property=
"qtype"
/>
<result
column=
"qtype"
jdbcType=
"VARCHAR"
property=
"qtype"
/>
<result
column=
"qtitle"
jdbcType=
"VARCHAR"
property=
"qtitle"
/>
<result
column=
"qtitle"
jdbcType=
"VARCHAR"
property=
"qtitle"
/>
<result
column=
"qdesc"
jdbcType=
"VARCHAR"
property=
"qdesc"
/>
<result
column=
"qdesc"
jdbcType=
"VARCHAR"
property=
"qdesc"
/>
<result
column=
"qanswer"
jdbcType=
"VARCHAR"
property=
"qanswer"
/>
<result
column=
"qanswer"
jdbcType=
"VARCHAR"
property=
"qanswer"
/>
<result
column=
"create_by"
jdbcType=
"VARCHAR"
property=
"createBy"
/>
<result
column=
"create_by"
jdbcType=
"VARCHAR"
property=
"createBy"
/>
<result
column=
"update_by"
jdbcType=
"VARCHAR"
property=
"updateBy"
/>
<result
column=
"update_by"
jdbcType=
"VARCHAR"
property=
"updateBy"
/>
<result
column=
"del_flag"
jdbcType=
"VARCHAR"
property=
"delFlag"
/>
<result
column=
"del_flag"
jdbcType=
"VARCHAR"
property=
"delFlag"
/>
<result
column=
"flag"
jdbcType=
"VARCHAR"
property=
"flag"
/>
<result
column=
"flag"
jdbcType=
"VARCHAR"
property=
"flag"
/>
<result
column=
"remarks"
jdbcType=
"VARCHAR"
property=
"remarks"
/>
<result
column=
"remarks"
jdbcType=
"VARCHAR"
property=
"remarks"
/>
<result
column=
"update_date"
jdbcType=
"TIMESTAMP"
property=
"updateDate"
/>
<result
column=
"update_date"
jdbcType=
"TIMESTAMP"
property=
"updateDate"
/>
<result
column=
"create_date"
jdbcType=
"TIMESTAMP"
property=
"createDate"
/>
<result
column=
"create_date"
jdbcType=
"TIMESTAMP"
property=
"createDate"
/>
</resultMap>
</resultMap>
<!--<cache type="${corePackag!}.util.RedisCache"/>-->
</mapper>
</mapper>
\ No newline at end of file
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