Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
Z
zhengyuan-danger-chemistry-manage
Project
Project
Details
Activity
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
耿迪迪
zhengyuan-danger-chemistry-manage
Commits
ce82bcd4
Commit
ce82bcd4
authored
Dec 20, 2022
by
耿迪迪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
考试接口 gengdidi
parent
e2d335e7
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
132 additions
and
18 deletions
+132
-18
TTrainCourseController.java
...m/zehong/web/controller/train/TTrainCourseController.java
+10
-0
TTrainCourse.java
.../src/main/java/com/zehong/system/domain/TTrainCourse.java
+58
-6
ITTrainCourseService.java
.../java/com/zehong/system/service/ITTrainCourseService.java
+7
-0
TTrainCourseServiceImpl.java
...m/zehong/system/service/impl/TTrainCourseServiceImpl.java
+25
-9
TTrainCourseMapper.xml
...m/src/main/resources/mapper/system/TTrainCourseMapper.xml
+23
-3
lessonsProgram.js
...er-manage-web/src/api/educationPlanExam/lessonsProgram.js
+9
-0
No files found.
danger-manage-admin/src/main/java/com/zehong/web/controller/train/TTrainCourseController.java
View file @
ce82bcd4
...
...
@@ -137,4 +137,14 @@ public class TTrainCourseController extends BaseController
tTrainCourse
.
setIsDel
(
1
);
return
toAjax
(
tTrainCourseService
.
updateTTrainCourse
(
tTrainCourse
));
}
/**
* 考试发布
* @param tTrainCourse
* @return
*/
@PostMapping
(
value
=
"testPublish"
)
public
AjaxResult
testPublish
(
@RequestBody
TTrainCourse
tTrainCourse
){
return
toAjax
(
tTrainCourseService
.
testPublish
(
tTrainCourse
));
}
}
danger-manage-system/src/main/java/com/zehong/system/domain/TTrainCourse.java
View file @
ce82bcd4
package
com
.
zehong
.
system
.
domain
;
import
java.util.Date
;
import
java.util.List
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
...
...
@@ -67,13 +69,23 @@ public class TTrainCourse extends BaseEntity
@Excel
(
name
=
"0未删除 1已删除"
)
private
Integer
isDel
;
public
String
getPlanName
()
{
return
planName
;
}
/** 数据类型:0 培训,1 考试 */
@Excel
(
name
=
"数据类型:0 培训,1 考试"
)
private
String
dataKind
;
public
void
setPlanName
(
String
planName
)
{
this
.
planName
=
planName
;
}
/** 考试开始时间 */
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@Excel
(
name
=
"考试开始时间"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
testStartTime
;
/** 考试结束时间 */
@JsonFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@Excel
(
name
=
"考试结束时间"
,
width
=
30
,
dateFormat
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
testEndTime
;
/** 考试人员 */
@Excel
(
name
=
"考试人员"
)
private
String
testPersons
;
public
void
setCourseId
(
Long
courseId
)
{
...
...
@@ -183,6 +195,42 @@ public class TTrainCourse extends BaseEntity
{
return
isDel
;
}
public
void
setDataKind
(
String
dataKind
)
{
this
.
dataKind
=
dataKind
;
}
public
String
getDataKind
()
{
return
dataKind
;
}
public
void
setTestStartTime
(
Date
testStartTime
)
{
this
.
testStartTime
=
testStartTime
;
}
public
Date
getTestStartTime
()
{
return
testStartTime
;
}
public
void
setTestEndTime
(
Date
testEndTime
)
{
this
.
testEndTime
=
testEndTime
;
}
public
Date
getTestEndTime
()
{
return
testEndTime
;
}
public
void
setTestPersons
(
String
testPersons
)
{
this
.
testPersons
=
testPersons
;
}
public
String
getTestPersons
()
{
return
testPersons
;
}
@Override
public
String
toString
()
{
...
...
@@ -200,6 +248,10 @@ public class TTrainCourse extends BaseEntity
.
append
(
"createTime"
,
getCreateTime
())
.
append
(
"createUser"
,
getCreateUser
())
.
append
(
"isDel"
,
getIsDel
())
.
append
(
"dataKind"
,
getDataKind
())
.
append
(
"testStartTime"
,
getTestStartTime
())
.
append
(
"testEndTime"
,
getTestEndTime
())
.
append
(
"testPersons"
,
getTestPersons
())
.
toString
();
}
}
danger-manage-system/src/main/java/com/zehong/system/service/ITTrainCourseService.java
View file @
ce82bcd4
...
...
@@ -79,5 +79,12 @@ public interface ITTrainCourseService
* 考试
*/
public
Map
<
String
,
Object
>
examination
(
Long
userCourseId
,
String
[]
answers
);
/**
* 考试发布
* @param tTrainCourse 考试实体
* @return int
*/
int
testPublish
(
TTrainCourse
tTrainCourse
);
}
danger-manage-system/src/main/java/com/zehong/system/service/impl/TTrainCourseServiceImpl.java
View file @
ce82bcd4
package
com
.
zehong
.
system
.
service
.
impl
;
import
java.util.Date
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
import
com.zehong.common.utils.DateUtils
;
import
com.zehong.system.domain.TTrainCourse
;
import
com.zehong.system.domain.TTrainCourseTopic
;
import
com.zehong.system.domain.TTrainPlan
;
import
com.zehong.system.domain.TTrainUserCourse
;
import
com.zehong.system.domain.vo.UserCourseVo
;
import
com.zehong.system.mapper.TTrainCourseMapper
;
import
com.zehong.system.mapper.TTrainCourseTopicMapper
;
import
com.zehong.system.mapper.TTrainPlanMapper
;
import
com.zehong.system.mapper.TTrainUserCourseMapper
;
import
com.zehong.system.service.ITTrainCourseService
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
com.zehong.system.mapper.TTrainCourseMapper
;
import
com.zehong.system.domain.TTrainCourse
;
import
com.zehong.system.service.ITTrainCourseService
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.*
;
/**
* 培训课程Service业务层处理
*
...
...
@@ -173,4 +169,24 @@ public class TTrainCourseServiceImpl implements ITTrainCourseService
map
.
put
(
"topicNum"
,
list
.
size
());
return
map
;
}
/**
* 考试发布
* @param tTrainCourse 考试实体
* @return int
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
int
testPublish
(
TTrainCourse
tTrainCourse
){
//查询考试人员信息
TTrainCourse
course
=
tTrainCourseMapper
.
selectTTrainCourseById
(
tTrainCourse
.
getCourseId
());
if
(
course
==
null
){
return
0
;
}
//新增考试人员
tTrainCourseMapper
.
insertUserCourse
(
tTrainCourse
.
getCourseId
(),
Arrays
.
asList
(
course
.
getTestPersons
()));
tTrainCourse
.
setStatus
(
1
);
tTrainCourse
.
setReleaseTime
(
new
Date
());
return
tTrainCourseMapper
.
updateTTrainCourse
(
tTrainCourse
);
}
}
danger-manage-system/src/main/resources/mapper/system/TTrainCourseMapper.xml
View file @
ce82bcd4
...
...
@@ -19,10 +19,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result
property=
"createTime"
column=
"create_time"
/>
<result
property=
"createUser"
column=
"create_user"
/>
<result
property=
"isDel"
column=
"is_del"
/>
<result
property=
"dataKind"
column=
"data_kind"
/>
<result
property=
"testStartTime"
column=
"test_start_time"
/>
<result
property=
"testEndTime"
column=
"test_end_time"
/>
<result
property=
"testPersons"
column=
"test_persons"
/>
</resultMap>
<sql
id=
"selectTTrainCourseVo"
>
select course_id, course_name, course_type, course_conent, status,
release_time, enclosure, video, qualified_num, topic_num, create_time, create_user, is_del
from t_train_course
select course_id, course_name, course_type, course_conent, status,
release_time, enclosure, video, qualified_num, topic_num, create_time, create_user, is_del, data_kind, test_start_time, test_end_time, test_persons
from t_train_course
</sql>
<select
id=
"selectTTrainCourseList"
parameterType=
"TTrainCourse"
resultMap=
"TTrainCourseResult"
>
...
...
@@ -40,6 +44,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"topicNum != null "
>
and c.topic_num = #{topicNum}
</if>
<if
test=
"createUser != null and createUser != ''"
>
and c.create_user = #{createUser}
</if>
<if
test=
"isDel != null "
>
and c.is_del = #{isDel}
</if>
<if
test=
"dataKind != null and dataKind != ''"
>
and data_kind = #{dataKind}
</if>
<if
test=
"testStartTime != null "
>
and test_start_time = #{testStartTime}
</if>
<if
test=
"testEndTime != null "
>
and test_end_time = #{testEndTime}
</if>
<if
test=
"testPersons != null and testPersons != ''"
>
and test_persons = #{testPersons}
</if>
</where>
</select>
...
...
@@ -63,6 +71,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"createTime != null"
>
create_time,
</if>
<if
test=
"createUser != null"
>
create_user,
</if>
<if
test=
"isDel != null"
>
is_del,
</if>
<if
test=
"dataKind != null"
>
data_kind,
</if>
<if
test=
"testStartTime != null"
>
test_start_time,
</if>
<if
test=
"testEndTime != null"
>
test_end_time,
</if>
<if
test=
"testPersons != null"
>
test_persons,
</if>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"courseName != null"
>
#{courseName},
</if>
...
...
@@ -77,6 +89,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"createTime != null"
>
#{createTime},
</if>
<if
test=
"createUser != null"
>
#{createUser},
</if>
<if
test=
"isDel != null"
>
#{isDel},
</if>
<if
test=
"dataKind != null"
>
#{dataKind},
</if>
<if
test=
"testStartTime != null"
>
#{testStartTime},
</if>
<if
test=
"testEndTime != null"
>
#{testEndTime},
</if>
<if
test=
"testPersons != null"
>
#{testPersons},
</if>
</trim>
</insert>
...
...
@@ -95,6 +111,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"createTime != null"
>
create_time = #{createTime},
</if>
<if
test=
"createUser != null"
>
create_user = #{createUser},
</if>
<if
test=
"isDel != null"
>
is_del = #{isDel},
</if>
<if
test=
"dataKind != null"
>
data_kind = #{dataKind},
</if>
<if
test=
"testStartTime != null"
>
test_start_time = #{testStartTime},
</if>
<if
test=
"testEndTime != null"
>
test_end_time = #{testEndTime},
</if>
<if
test=
"testPersons != null"
>
test_persons = #{testPersons},
</if>
</trim>
where course_id = #{courseId}
</update>
...
...
danger-manage-web/src/api/educationPlanExam/lessonsProgram.js
View file @
ce82bcd4
...
...
@@ -67,6 +67,15 @@ export function deleteLesson(query) {
})
}
//考试发布
export
function
testPublish
(
data
)
{
return
request
({
url
:
'/system/course/testPublish'
,
method
:
'put'
,
data
:
data
})
}
...
...
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