Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in / Register
Toggle navigation
G
gassafety-progress
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
耿迪迪
gassafety-progress
Commits
4a2ff26b
Commit
4a2ff26b
authored
Apr 25, 2023
by
耿迪迪
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
我的培训
parent
ebb358f3
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
118 additions
and
14 deletions
+118
-14
TTrainManageController.java
...ng/web/controller/trainmanage/TTrainManageController.java
+20
-0
SysUser.java
...in/java/com/zehong/common/core/domain/entity/SysUser.java
+10
-0
TTrainManage.java
.../src/main/java/com/zehong/system/domain/TTrainManage.java
+10
-0
TTrainManageMapper.java
...ain/java/com/zehong/system/mapper/TTrainManageMapper.java
+7
-0
ITTrainManageService.java
.../java/com/zehong/system/service/ITTrainManageService.java
+7
-0
TTrainManageServiceImpl.java
...m/zehong/system/service/impl/TTrainManageServiceImpl.java
+18
-0
SysUserMapper.xml
...system/src/main/resources/mapper/system/SysUserMapper.xml
+6
-0
TTrainManageMapper.xml
...m/src/main/resources/mapper/system/TTrainManageMapper.xml
+26
-0
TTrainPersonMapper.xml
...m/src/main/resources/mapper/system/TTrainPersonMapper.xml
+2
-2
TTrainStatMapper.xml
...tem/src/main/resources/mapper/system/TTrainStatMapper.xml
+12
-12
No files found.
gassafetyprogress-admin/src/main/java/com/zehong/web/controller/trainmanage/TTrainManageController.java
View file @
4a2ff26b
package
com
.
zehong
.
web
.
controller
.
trainmanage
;
import
java.util.List
;
import
com.zehong.common.core.domain.entity.SysUser
;
import
com.zehong.common.core.domain.model.LoginUser
;
import
com.zehong.common.utils.ServletUtils
;
import
com.zehong.framework.web.service.TokenService
;
import
org.springframework.security.access.prepost.PreAuthorize
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
...
...
@@ -33,6 +38,9 @@ public class TTrainManageController extends BaseController
@Autowired
private
ITTrainManageService
tTrainManageService
;
@Autowired
private
TokenService
tokenService
;
/**
* 查询培训管理列表
*/
...
...
@@ -100,4 +108,16 @@ public class TTrainManageController extends BaseController
{
return
toAjax
(
tTrainManageService
.
deleteTTrainManageByIds
(
trainManageIds
));
}
/**
* 根据培训人员查询培训课程
* @param trainPersonId 培训人员
* @return
*/
@RequestMapping
(
"/getTrainInfoByPersonId"
)
public
AjaxResult
getTrainInfoByPersonId
(){
LoginUser
loginUser
=
tokenService
.
getLoginUser
(
ServletUtils
.
getRequest
());
SysUser
user
=
loginUser
.
getUser
();
return
AjaxResult
.
success
(
tTrainManageService
.
getTrainInfoByPersonId
(
user
.
getUserId
()));
}
}
gassafetyprogress-common/src/main/java/com/zehong/common/core/domain/entity/SysUser.java
View file @
4a2ff26b
...
...
@@ -96,6 +96,16 @@ public class SysUser extends BaseEntity
/** 岗位组 */
private
Long
[]
postIds
;
private
String
enterpriseId
;
public
String
getEnterpriseId
()
{
return
enterpriseId
;
}
public
void
setEnterpriseId
(
String
enterpriseId
)
{
this
.
enterpriseId
=
enterpriseId
;
}
public
SysUser
()
{
...
...
gassafetyprogress-system/src/main/java/com/zehong/system/domain/TTrainManage.java
View file @
4a2ff26b
...
...
@@ -67,6 +67,8 @@ public class TTrainManage extends BaseEntity
/**培训人员*/
private
List
<
TTrainPerson
>
tTrainPersonList
;
private
String
isFinish
;
public
void
setTrainManageId
(
Long
trainManageId
)
{
this
.
trainManageId
=
trainManageId
;
...
...
@@ -175,6 +177,14 @@ public class TTrainManage extends BaseEntity
this
.
tTrainPersonList
=
tTrainPersonList
;
}
public
String
getIsFinish
()
{
return
isFinish
;
}
public
void
setIsFinish
(
String
isFinish
)
{
this
.
isFinish
=
isFinish
;
}
@Override
public
String
toString
()
{
return
new
ToStringBuilder
(
this
,
ToStringStyle
.
MULTI_LINE_STYLE
)
...
...
gassafetyprogress-system/src/main/java/com/zehong/system/mapper/TTrainManageMapper.java
View file @
4a2ff26b
...
...
@@ -58,4 +58,11 @@ public interface TTrainManageMapper
* @return 结果
*/
public
int
deleteTTrainManageByIds
(
Long
[]
trainManageIds
);
/**
* 根据培训人员查询培训课程
* @param trainPersonId 培训人员
* @return
*/
List
<
TTrainManage
>
getTrainInfoByPersonId
(
Long
trainPersonId
);
}
gassafetyprogress-system/src/main/java/com/zehong/system/service/ITTrainManageService.java
View file @
4a2ff26b
...
...
@@ -58,4 +58,11 @@ public interface ITTrainManageService
* @return 结果
*/
public
int
deleteTTrainManageById
(
Long
trainManageId
);
/**
* 根据培训人员查询培训课程
* @param trainPersonId 培训人员
* @return
*/
List
<
TTrainManage
>
getTrainInfoByPersonId
(
Long
trainPersonId
);
}
gassafetyprogress-system/src/main/java/com/zehong/system/service/impl/TTrainManageServiceImpl.java
View file @
4a2ff26b
...
...
@@ -109,8 +109,17 @@ public class TTrainManageServiceImpl implements ITTrainManageService
* @return 结果
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
int
deleteTTrainManageByIds
(
Long
[]
trainManageIds
)
{
for
(
Long
trainMangeId
:
trainManageIds
){
TTrainPerson
tTrainPerson
=
new
TTrainPerson
();
tTrainPerson
.
setTrainManageId
(
trainMangeId
);
List
<
TTrainPerson
>
personList
=
tTrainPersonMapper
.
selectTTrainPersonList
(
tTrainPerson
);
if
(
null
!=
personList
&&
personList
.
size
()>
0
){
tTrainPersonMapper
.
deleteTTrainPersonByTrainManageId
(
trainMangeId
);
}
}
return
tTrainManageMapper
.
deleteTTrainManageByIds
(
trainManageIds
);
}
...
...
@@ -124,5 +133,14 @@ public class TTrainManageServiceImpl implements ITTrainManageService
public
int
deleteTTrainManageById
(
Long
trainManageId
)
{
return
tTrainManageMapper
.
deleteTTrainManageById
(
trainManageId
);
}
/**
* 根据培训人员查询培训课程
* @param trainPersonId 培训人员
* @return
*/
public
List
<
TTrainManage
>
getTrainInfoByPersonId
(
Long
trainPersonId
){
return
tTrainManageMapper
.
getTrainInfoByPersonId
(
trainPersonId
);
}
}
gassafetyprogress-system/src/main/resources/mapper/system/SysUserMapper.xml
View file @
4a2ff26b
...
...
@@ -70,6 +70,12 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"phonenumber != null and phonenumber != ''"
>
AND u.phonenumber like concat('%', #{phonenumber}, '%')
</if>
<if
test=
"enterpriseId != null and enterpriseId != ''"
>
AND enter.enterprise_id = #{enterpriseId}
</if>
<if
test=
"nickName != null and nickName != ''"
>
AND u.nick_name like concat('%', #{nickName}, '%')
</if>
<if
test=
"params.beginTime != null and params.beginTime != ''"
>
<!-- 开始时间检索 -->
AND date_format(u.create_time,'%y%m%d')
>
= date_format(#{params.beginTime},'%y%m%d')
</if>
...
...
gassafetyprogress-system/src/main/resources/mapper/system/TTrainManageMapper.xml
View file @
4a2ff26b
...
...
@@ -19,6 +19,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<result
property=
"updateTime"
column=
"update_time"
/>
<result
property=
"remark"
column=
"remark"
/>
<result
property=
"isDel"
column=
"is_del"
/>
<result
property=
"isFinish"
column=
"is_finish"
/>
</resultMap>
<sql
id=
"selectTTrainManageVo"
>
...
...
@@ -110,4 +111,29 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
#{trainManageId}
</foreach>
</delete>
<select
id=
"getTrainInfoByPersonId"
parameterType=
"Long"
resultMap=
"TTrainManageResult"
>
SELECT
manage.train_manage_id,
manage.lesson_name,
manage.train_duration,
manage.train_start_time,
manage.train_end_time,
manage.lesson_content,
manage.video_url,
manage.annex_url,
manage.train_status,
manage.publish_time,
CASE WHEN manage.train_start_time >NOW() THEN '3'
WHEN now() > manage.train_end_time THEN '2'
ELSE person.is_finish END AS is_finish
FROM
t_train_manage manage
LEFT JOIN t_train_person person ON person.train_manage_id = manage.train_manage_id
<where>
manage.train_status = '1'
AND person.train_person_id = #{trainPersonId}
</where>
</select>
</mapper>
\ No newline at end of file
gassafetyprogress-system/src/main/resources/mapper/system/TTrainPersonMapper.xml
View file @
4a2ff26b
...
...
@@ -27,10 +27,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
person.update_time,
person.remark,
person.is_del,
people.employed_people
_name as trainPersonName
sysu.nick
_name as trainPersonName
FROM
t_train_person person
LEFT JOIN
t_employed_people_info people on people.employed_people
_id = person.train_person_id
LEFT JOIN
sys_user sysu on sysu.user
_id = person.train_person_id
</sql>
<select
id=
"selectTTrainPersonList"
parameterType=
"TTrainPerson"
resultMap=
"TTrainPersonResult"
>
...
...
gassafetyprogress-system/src/main/resources/mapper/system/TTrainStatMapper.xml
View file @
4a2ff26b
...
...
@@ -41,21 +41,21 @@
<select
id=
"trainStatDetail"
parameterType=
"Long"
resultMap=
"trainStatDetailResult"
>
SELECT
people.
employed_people_name,
enterprise.enterprise_name,
sysu.nick_name AS
employed_people_name,
enterprise.enterprise_name,
SEC_TO_TIME(person.reality_train_duration) AS reality_train_duration,
(
CASE person.is_finish
WHEN '0' THEN
'未完成'
WHEN '1' THEN
'完成'
END
(
CASE person.is_finish
WHEN '0' THEN
'未完成'
WHEN '1' THEN
'完成'
END
) AS isComplete
FROM
t_train_person person
LEFT JOIN
t_employed_people_info people ON people.employed_people
_id = person.train_person_id
LEFT JOIN t_enterprise_info enterprise ON enterprise.enterprise_id =
people.beyond_enterprise_id
t_train_person person
LEFT JOIN
sys_user sysu ON sysu.user
_id = person.train_person_id
LEFT JOIN t_enterprise_info enterprise ON enterprise.enterprise_id =
sysu.dept_id AND sysu.dept_id != '-2'
<where>
person.train_manage_id = #{trainManageId}
</where>
...
...
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