Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in / Register
Toggle navigation
T
tianjin-cement
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
竹天卫
tianjin-cement
Commits
4d16adfe
Commit
4d16adfe
authored
Oct 21, 2020
by
mengbali153
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
培训计划
parent
1d3887b3
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
1089 additions
and
2 deletions
+1089
-2
PlanPeopleController.java
...e/sc/cement/business/controller/PlanPeopleController.java
+65
-0
PlanTrainingController.java
...sc/cement/business/controller/PlanTrainingController.java
+161
-0
PlanPeople.java
...in/java/cn/wise/sc/cement/business/entity/PlanPeople.java
+35
-0
PlanTraining.java
.../java/cn/wise/sc/cement/business/entity/PlanTraining.java
+81
-0
PlanPeopleMapper.java
...a/cn/wise/sc/cement/business/mapper/PlanPeopleMapper.java
+24
-0
PlanTrainingMapper.java
...cn/wise/sc/cement/business/mapper/PlanTrainingMapper.java
+31
-0
NonStandardValueMapper.xml
.../sc/cement/business/mapper/xml/NonStandardValueMapper.xml
+5
-2
PlanPopeleMapper.xml
...n/wise/sc/cement/business/mapper/xml/PlanPopeleMapper.xml
+6
-0
PlanTrainingMapper.xml
...wise/sc/cement/business/mapper/xml/PlanTrainingMapper.xml
+60
-0
PlanTrainingFJ.java
...n/wise/sc/cement/business/model/query/PlanTrainingFJ.java
+27
-0
PlanTrainingQuery.java
...ise/sc/cement/business/model/query/PlanTrainingQuery.java
+69
-0
PlanPeopleVo.java
...ava/cn/wise/sc/cement/business/model/vo/PlanPeopleVo.java
+23
-0
PlanTrainingVo.java
...a/cn/wise/sc/cement/business/model/vo/PlanTrainingVo.java
+58
-0
IPlanPeopleService.java
...n/wise/sc/cement/business/service/IPlanPeopleService.java
+38
-0
IPlanTrainingService.java
...wise/sc/cement/business/service/IPlanTrainingService.java
+95
-0
PlanPeopleServiceImpl.java
...c/cement/business/service/impl/PlanPeopleServiceImpl.java
+72
-0
PlanTrainingServiceImpl.java
...cement/business/service/impl/PlanTrainingServiceImpl.java
+239
-0
No files found.
cement-business/src/main/java/cn/wise/sc/cement/business/controller/PlanPeopleController.java
0 → 100644
View file @
4d16adfe
package
cn
.
wise
.
sc
.
cement
.
business
.
controller
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.service.IPlanPeopleService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
* <p>
* 前端控制器
* </p>
*
* @author wlb
* @since 2020-10-19
*/
@Api
(
tags
=
"计划管理-培训计划审批"
)
@RestController
@RequestMapping
(
"/tcdri/plan_people"
)
public
class
PlanPeopleController
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
"PlanPeopleController"
);
@Autowired
private
IPlanPeopleService
iPlanPeopleService
;
@ApiOperation
(
value
=
"培训计划审批分页"
)
@GetMapping
(
"/getPage"
)
public
BaseResponse
getPage
(
PageQuery
pageQuery
)
{
try
{
return
iPlanPeopleService
.
getPage
(
pageQuery
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"培训计划分页{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"获取所有的培训计划审批"
)
@GetMapping
(
"/getList"
)
public
BaseResponse
getList
()
{
try
{
return
iPlanPeopleService
.
getList
();
}
catch
(
Exception
e
)
{
log
.
debug
(
"获取指定时间内的培训计划{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"考核结果"
)
@PostMapping
(
"/status"
)
public
BaseResponse
status
(
Integer
status
,
Integer
id
){
try
{
return
iPlanPeopleService
.
status
(
status
,
id
);
}
catch
(
Exception
e
){
log
.
debug
(
"审批操作实现{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/controller/PlanTrainingController.java
0 → 100644
View file @
4d16adfe
package
cn
.
wise
.
sc
.
cement
.
business
.
controller
;
import
cn.hutool.core.date.DateUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.query.PlanTrainingFJ
;
import
cn.wise.sc.cement.business.model.query.PlanTrainingQuery
;
import
cn.wise.sc.cement.business.model.query.SampleDistributionEnclosureQuery
;
import
cn.wise.sc.cement.business.model.vo.PlanTrainingVo
;
import
cn.wise.sc.cement.business.service.IPlanTrainingService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.Date
;
import
java.util.List
;
/**
* <p>
* 前端控制器
* </p>
*
* @author wlb
* @since 2020-10-19
*/
@Api
(
tags
=
"计划管理-培训计划"
)
@RestController
@RequestMapping
(
"/tcdri/plan_training"
)
public
class
PlanTrainingController
{
private
static
final
Logger
log
=
LoggerFactory
.
getLogger
(
"PlanTrainingController"
);
@Autowired
private
IPlanTrainingService
iplanTrainingService
;
@ApiOperation
(
value
=
"培训计划分页"
)
@GetMapping
(
"/getPage"
)
public
BaseResponse
getPage
(
PageQuery
pageQuery
)
{
try
{
return
iplanTrainingService
.
getPage
(
pageQuery
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"培训计划分页{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"获取指定时间内的培训计划"
)
@GetMapping
(
"/getList"
)
public
BaseResponse
getList
(
String
start
,
String
end
)
{
Date
startParse
=
null
;
if
(
StrUtil
.
isNotBlank
(
start
))
{
startParse
=
DateUtil
.
parse
(
start
);
}
Date
endParse
=
null
;
if
(
StrUtil
.
isNotBlank
(
end
))
{
endParse
=
DateUtil
.
parse
(
end
);
}
try
{
return
iplanTrainingService
.
getList
(
startParse
,
endParse
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"获取指定时间内的培训计划{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"根据id查询指定培训计划"
)
@GetMapping
(
"/{id}"
)
public
BaseResponse
getById
(
@PathVariable
Integer
id
){
try
{
BaseResponse
<
List
<
PlanTrainingVo
>>
e
=
iplanTrainingService
.
getById
(
id
);
if
(
e
==
null
){
return
BaseResponse
.
errorMsg
(
"信息错误!"
);
}
return
BaseResponse
.
okData
(
e
);
}
catch
(
Exception
e
){
log
.
debug
(
"通过id查询培训计划{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"添加培训"
)
@PostMapping
(
"/create"
)
public
BaseResponse
create
(
@RequestBody
PlanTrainingQuery
query
){
if
(
query
.
getRemind
()==
0
&&
query
.
getRemindTime
()!=
null
){
return
BaseResponse
.
errorMsg
(
"没有确认提醒"
);
}
if
(
query
.
getRemind
()==
1
&&
query
.
getRemindTime
()==
null
){
return
BaseResponse
.
errorMsg
(
"请选择提醒时间"
);
}
try
{
return
iplanTrainingService
.
create
(
query
);
}
catch
(
Exception
e
){
log
.
debug
(
"添加培训{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"修改培训计划"
)
@PostMapping
(
"/update"
)
public
BaseResponse
update
(
@RequestBody
PlanTrainingQuery
planTrainingQuery
){
if
(
planTrainingQuery
.
getRemind
()==
0
&&
planTrainingQuery
.
getRemindTime
()!=
null
){
return
BaseResponse
.
errorMsg
(
"没有确认提醒"
);
}
if
(
planTrainingQuery
.
getRemind
()==
1
&&
planTrainingQuery
.
getRemindTime
()==
null
){
return
BaseResponse
.
errorMsg
(
"请选择提醒时间"
);
}
try
{
return
iplanTrainingService
.
update
(
planTrainingQuery
);
}
catch
(
Exception
e
){
log
.
debug
(
"修改培训计划{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
// @ApiOperation(value = "考核结果")
// @PostMapping("/status")
// public BaseResponse status(Integer status, Integer id){
// try {
// return iplanTrainingService.status(status, id);
// }catch (Exception e){
// log.debug("审批操作实现{}",e);
// }
// return BaseResponse.errorMsg("失败!");
// }
@ApiOperation
(
value
=
"删除培训信息"
)
@PostMapping
(
"/delete/{id}"
)
public
BaseResponse
delete
(
@PathVariable
Integer
id
){
try
{
return
iplanTrainingService
.
delete
(
id
);
}
catch
(
Exception
e
){
log
.
debug
(
"删除培训信息{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
"培训计划导出"
)
@PostMapping
(
"/exportList"
)
public
void
exportList
(
String
filename
,
String
objective
,
HttpServletResponse
response
)
{
try
{
iplanTrainingService
.
exportList
(
filename
,
objective
,
response
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"培训计划导出{}"
,
e
);
}
}
// @ApiOperation(value = "上传培训计划附件")
// @GetMapping("/uploadPlanTrainListPT")
// public BaseResponse uploadPlanTrainListPT(PlanTrainingFJ query) {
// try {
// return iplanTrainingService.uploadPlanTrainListPT(query);
// } catch (Exception e) {
// log.debug("接受检测项目任务{}", e);
// }
// return BaseResponse.errorMsg("失败!");
// }
}
cement-business/src/main/java/cn/wise/sc/cement/business/entity/PlanPeople.java
0 → 100644
View file @
4d16adfe
package
cn
.
wise
.
sc
.
cement
.
business
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
org.springframework.data.annotation.Id
;
import
java.io.Serializable
;
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
@Accessors
(
chain
=
true
)
@TableName
(
value
=
"plan_people"
)
public
class
PlanPeople
implements
Serializable
{
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Integer
id
;
private
static
final
long
serialVersionUID
=
42L
;
private
Integer
userId
;
private
String
name
;
private
Integer
planId
;
private
Integer
status
;
private
Integer
groupId
;
private
String
account
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/entity/PlanTraining.java
0 → 100644
View file @
4d16adfe
package
cn
.
wise
.
sc
.
cement
.
business
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
org.apache.tomcat.jni.Local
;
import
java.io.Serializable
;
import
java.time.LocalDate
;
/**
* <p>
*
* </p>
*
* @author wlb
* @since 2020-10-19
*/
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
@Accessors
(
chain
=
true
)
@TableName
(
value
=
"plan_training"
)
public
class
PlanTraining
implements
Serializable
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 主键
*/
@TableId
(
value
=
"id"
,
type
=
IdType
.
AUTO
)
private
Integer
id
;
@ApiModelProperty
(
"培训目的/名称"
)
private
String
objective
;
@ApiModelProperty
(
"培训内容/类别"
)
private
String
content
;
@ApiModelProperty
(
"培训方式"
)
private
String
mode
;
@ApiModelProperty
(
"培训对象"
)
private
String
planObject
;
@ApiModelProperty
(
"培训人"
)
private
String
people
;
@ApiModelProperty
(
"考核人"
)
private
String
assessment
;
@ApiModelProperty
(
"培训地点"
)
private
String
place
;
@ApiModelProperty
(
"考核要求"
)
private
String
requirement
;
@ApiModelProperty
(
"联系电话"
)
private
String
phone
;
@ApiModelProperty
(
"开始时间"
)
private
LocalDate
startTime
;
@ApiModelProperty
(
"结束时间"
)
private
LocalDate
endTime
;
@ApiModelProperty
(
"是否提醒(0:不提醒 1:提醒)"
)
private
Integer
remind
;
@ApiModelProperty
(
"提醒时间"
)
private
LocalDate
remindTime
;
@ApiModelProperty
(
"部门id"
)
private
String
groupIds
;
@ApiModelProperty
(
"用户id"
)
private
String
userIds
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/PlanPeopleMapper.java
0 → 100644
View file @
4d16adfe
package
cn
.
wise
.
sc
.
cement
.
business
.
mapper
;
import
cn.wise.sc.cement.business.entity.PlanPeople
;
import
cn.wise.sc.cement.business.model.vo.PlanPeopleVo
;
import
cn.wise.sc.cement.business.model.vo.PlanTrainingVo
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
/**
* <p>
* Mapper 接口
* </p>
*
* @author wlb
* @since 2020-10-20
*/
public
interface
PlanPeopleMapper
extends
BaseMapper
<
PlanPeople
>
{
// IPage<PlanPeopleVo> getPage(@Param("page") Page page);
}
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/PlanTrainingMapper.java
0 → 100644
View file @
4d16adfe
package
cn
.
wise
.
sc
.
cement
.
business
.
mapper
;
import
cn.wise.sc.cement.business.entity.PlanTraining
;
import
cn.wise.sc.cement.business.model.vo.NonStandardValueVo
;
import
cn.wise.sc.cement.business.model.vo.PlanStandardPurchaseVo
;
import
cn.wise.sc.cement.business.model.vo.PlanTrainingVo
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
import
java.util.Map
;
/**
* <p>
* Mapper 接口
* </p>
*
* @author wlb
* @since 2020-10-19
*/
public
interface
PlanTrainingMapper
extends
BaseMapper
<
PlanTraining
>
{
IPage
<
PlanTrainingVo
>
getPage
(
@Param
(
"page"
)
Page
page
,
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
List
<
Map
<
String
,
Object
>>
exportList
(
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
List
<
PlanTrainingVo
>
getList
(
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
List
<
PlanTrainingVo
>
getById
(
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
}
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/NonStandardValueMapper.xml
View file @
4d16adfe
...
@@ -13,8 +13,11 @@
...
@@ -13,8 +13,11 @@
<if
test=
"params.userId != null "
>
<if
test=
"params.userId != null "
>
and na.user_id = #{params.userId}
and na.user_id = #{params.userId}
</if>
</if>
<if
test=
"params.startTime !=null"
>
<if
test=
"params.start !=null"
>
and na.start_time = #{params.startTime}
and na.start_time
<![CDATA[>=]]>
#{params.start}
</if>
<if
test=
"params.end !=null"
>
and na.end_time
<![CDATA[<=]]>
#{params.end}
</if>
</if>
<if
test=
"params.groups !=null"
>
<if
test=
"params.groups !=null"
>
and su.group_id = #{params.groups}
and su.group_id = #{params.groups}
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/PlanPopeleMapper.xml
0 → 100644
View file @
4d16adfe
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.wise.sc.cement.business.mapper.PlanPeopleMapper"
>
</mapper>
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/PlanTrainingMapper.xml
0 → 100644
View file @
4d16adfe
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"cn.wise.sc.cement.business.mapper.PlanTrainingMapper"
>
<sql
id=
"where"
>
<where>
<if
test=
"params.id != null "
>
and pt.id = #{params.id}
</if>
<if
test=
"params.start !=null"
>
and pt.start_time
<![CDATA[>=]]>
#{params.start}
</if>
<if
test=
"params.end !=null"
>
and pt.end_time
<![CDATA[<=]]>
#{params.end}
</if>
<if
test=
"params.objective != null and params.objective != ''"
>
and pt.objective like concat('%', #{params.objective}, '%')
</if>
</where>
</sql>
<select
id=
"getPage"
resultType=
"cn.wise.sc.cement.business.model.vo.PlanTrainingVo"
>
select
pt.*
from plan_training pt
<include
refid=
"where"
/>
order by pt.id asc
</select>
<select
id=
"getById"
resultType=
"cn.wise.sc.cement.business.model.vo.PlanTrainingVo"
>
select
pt.*
from plan_training pt
<include
refid=
"where"
/>
order by pt.id asc
</select>
<select
id=
"getList"
resultType=
"cn.wise.sc.cement.business.model.vo.PlanTrainingVo"
>
select
pt.*
from plan_training pt
<include
refid=
"where"
/>
order by pt.id asc
</select>
<select
id=
"exportList"
resultType=
"java.util.HashMap"
>
SELECT
pt.id as 序号,
pt.objective as 培训目的,
pt.content as 培训内容,
pt.mode as 培训方式,
pt.start_time as 培训时间,
pt.plan_object as 培训对象,
pt.people as 培训人,
pt.assessment as 考核人
from plan_training pt
<include
refid=
"where"
/>
ORDER BY pt.id ASC
</select>
</mapper>
cement-business/src/main/java/cn/wise/sc/cement/business/model/query/PlanTrainingFJ.java
0 → 100644
View file @
4d16adfe
package
cn
.
wise
.
sc
.
cement
.
business
.
model
.
query
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.RequiredArgsConstructor
;
/**
* @description: 培训计划
* @author: wlb
* @create: 2020-10-19
**/
@Data
@RequiredArgsConstructor
@ApiModel
(
"培训计划附件"
)
public
class
PlanTrainingFJ
{
private
Integer
id
;
@ApiModelProperty
(
"文件名"
)
private
String
alias
;
@ApiModelProperty
(
"扩展名"
)
private
String
extName
;
@ApiModelProperty
(
"路径"
)
private
String
enclosureUrl
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/model/query/PlanTrainingQuery.java
0 → 100644
View file @
4d16adfe
package
cn
.
wise
.
sc
.
cement
.
business
.
model
.
query
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.RequiredArgsConstructor
;
import
java.time.LocalDate
;
/**
* @description: 培训计划
* @author: wlb
* @create: 2020-10-19
**/
@Data
@RequiredArgsConstructor
@ApiModel
(
"培训计划"
)
public
class
PlanTrainingQuery
{
private
Integer
id
;
@ApiModelProperty
(
name
=
"objective"
,
value
=
"培训目的/名称"
)
private
String
objective
;
@ApiModelProperty
(
"培训内容/类别"
)
private
String
content
;
@ApiModelProperty
(
"培训方式"
)
private
String
mode
;
// @ApiModelProperty("培训对象")
// private String planObject;
@ApiModelProperty
(
"培训人"
)
private
String
people
;
@ApiModelProperty
(
"考核人"
)
private
String
assessment
;
@ApiModelProperty
(
"培训地点"
)
private
String
place
;
@ApiModelProperty
(
"考核要求"
)
private
String
requirement
;
@ApiModelProperty
(
"联系电话"
)
private
String
phone
;
@ApiModelProperty
(
"开始时间"
)
private
LocalDate
startTime
;
@ApiModelProperty
(
"结束时间"
)
private
LocalDate
endTime
;
@ApiModelProperty
(
"是否提醒(0:不提醒 1:提醒)"
)
private
Integer
remind
;
@ApiModelProperty
(
"提醒时间"
)
private
LocalDate
remindTime
;
/**
*多个参加人员id"、"分割 如:"1、2、3"
*/
private
String
userIds
;
/**
* 如果是部门"、"分割 如:"12、13"
*/
private
String
groupIds
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/model/vo/PlanPeopleVo.java
0 → 100644
View file @
4d16adfe
package
cn
.
wise
.
sc
.
cement
.
business
.
model
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
lombok.Data
;
import
java.io.Serializable
;
/**
* @description:
* @author: wlb
* @create: 2020-10-19
**/
@Data
@ApiModel
(
"培训计划Vo"
)
public
class
PlanPeopleVo
implements
Serializable
{
private
Integer
id
;
private
String
name
;
private
String
account
;
private
Integer
status
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/model/vo/PlanTrainingVo.java
0 → 100644
View file @
4d16adfe
package
cn
.
wise
.
sc
.
cement
.
business
.
model
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
java.time.LocalDate
;
/**
* @description:
* @author: wlb
* @create: 2020-10-19
**/
@Data
@ApiModel
(
"培训计划Vo"
)
public
class
PlanTrainingVo
{
private
Integer
id
;
@ApiModelProperty
(
"培训目的/名称"
)
private
String
objective
;
@ApiModelProperty
(
"培训内容/类别"
)
private
String
content
;
@ApiModelProperty
(
"培训方式"
)
private
String
mode
;
@ApiModelProperty
(
"培训对象"
)
private
String
planObject
;
@ApiModelProperty
(
"培训人"
)
private
String
people
;
@ApiModelProperty
(
"考核人"
)
private
String
assessment
;
@ApiModelProperty
(
"培训地点"
)
private
String
place
;
@ApiModelProperty
(
"考核要求"
)
private
String
requirement
;
@ApiModelProperty
(
"联系电话"
)
private
String
phone
;
@ApiModelProperty
(
"开始时间"
)
private
LocalDate
startTime
;
@ApiModelProperty
(
"结束时间"
)
private
LocalDate
endTime
;
@ApiModelProperty
(
"是否提醒(0:不提醒 1:提醒)"
)
private
Integer
remind
;
@ApiModelProperty
(
"提醒时间"
)
private
LocalDate
remindTime
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/IPlanPeopleService.java
0 → 100644
View file @
4d16adfe
package
cn
.
wise
.
sc
.
cement
.
business
.
service
;
import
cn.wise.sc.cement.business.entity.PlanPeople
;
import
cn.wise.sc.cement.business.entity.PlanTraining
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.vo.PlanPeopleVo
;
import
cn.wise.sc.cement.business.model.vo.PlanTrainingVo
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
java.util.Date
;
import
java.util.List
;
public
interface
IPlanPeopleService
extends
IService
<
PlanPeople
>
{
/**
* 获取分页
* @param pageQuery 培训计划分页
* @return IPage<PlanTraining>
*/
BaseResponse
<
IPage
<
PlanPeople
>>
getPage
(
PageQuery
pageQuery
);
/**
* 获取指定时间内的培训计划
*
* @return List
*/
BaseResponse
<
List
<
PlanPeople
>>
getList
();
/**
* 更改状态信息,达到改变显示的效果
* 1:通过
*
* @param status 状态
* @param id id
* @return Boolean
*/
BaseResponse
<
String
>
status
(
Integer
status
,
Integer
id
);
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/IPlanTrainingService.java
0 → 100644
View file @
4d16adfe
package
cn
.
wise
.
sc
.
cement
.
business
.
service
;
import
cn.wise.sc.cement.business.entity.NonStandardApply
;
import
cn.wise.sc.cement.business.entity.PlanTraining
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.query.PlanTrainingFJ
;
import
cn.wise.sc.cement.business.model.query.PlanTrainingQuery
;
import
cn.wise.sc.cement.business.model.vo.PlanTrainingVo
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.Date
;
import
java.util.List
;
/**
* <p>
* 服务类
* </p>
*
* @author wlb
* @since 2020-10-19
*/
public
interface
IPlanTrainingService
extends
IService
<
PlanTraining
>
{
/**
* 获取分页
* @param pageQuery 培训计划分页
* @return IPage<PlanTraining>
*/
BaseResponse
<
IPage
<
PlanTrainingVo
>>
getPage
(
PageQuery
pageQuery
);
/**
* 获取指定时间内的培训计划
*
* @return List
*/
BaseResponse
<
List
<
PlanTrainingVo
>>
getList
(
Date
start
,
Date
end
);
/**
* 通过id查询指定培训计划
*
* @return List
*/
BaseResponse
<
List
<
PlanTrainingVo
>>
getById
(
Integer
id
);
/**
* 添加培训
*
* @param query
* @return PlanTrainingVo
*/
BaseResponse
<
PlanTraining
>
create
(
PlanTrainingQuery
query
);
/**
* 编辑培训计划
*
* @param planTrainingQuery
* @return PlanTrainingVo
*/
BaseResponse
<
PlanTraining
>
update
(
PlanTrainingQuery
planTrainingQuery
);
/**
* 更改状态信息,达到改变显示的效果
* 1:未通过
*
* @param status 状态
* @param id id
* @return Boolean
*/
// BaseResponse<String> status(Integer status, Integer id);
/**
* 通过id删除指定培训计划
*
* @param id
* @return PlanTrainingVo
*/
BaseResponse
delete
(
Integer
id
);
/**
* 培训计划导出
* @param objective 培训目的
* @param filename 文件名
* @param response
*/
void
exportList
(
String
filename
,
String
objective
,
HttpServletResponse
response
);
// /**
// * 上传附件
// *
// * @param query
// */
// BaseResponse<PlanTraining> uploadPlanTrainListPT(PlanTrainingFJ query);
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/PlanPeopleServiceImpl.java
0 → 100644
View file @
4d16adfe
package
cn
.
wise
.
sc
.
cement
.
business
.
service
.
impl
;
import
cn.wise.sc.cement.business.entity.HistoryArchives
;
import
cn.wise.sc.cement.business.entity.PlanPeople
;
import
cn.wise.sc.cement.business.entity.PlanTraining
;
import
cn.wise.sc.cement.business.mapper.PlanPeopleMapper
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.vo.HistoryArchivesVo
;
import
cn.wise.sc.cement.business.model.vo.PlanPeopleVo
;
import
cn.wise.sc.cement.business.model.vo.PlanTrainingVo
;
import
cn.wise.sc.cement.business.service.IPlanPeopleService
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.springframework.stereotype.Service
;
import
javax.annotation.Resource
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.Map
;
/**
* <p>
* 服务实现类
* </p>
*
* @author wlb
* @since 2020-10-19
*/
@Service
public
class
PlanPeopleServiceImpl
extends
ServiceImpl
<
PlanPeopleMapper
,
PlanPeople
>
implements
IPlanPeopleService
{
@Resource
private
PlanPeopleMapper
planPeopleMapper
;
@Override
public
BaseResponse
<
IPage
<
PlanPeople
>>
getPage
(
PageQuery
pageQuery
)
{
// Page<PlanPeopleVo> page = new Page<>(pageQuery.getPageNo(), pageQuery.getPageSize());
IPage
<
PlanPeople
>
iPage
=
new
Page
<>(
pageQuery
.
getPageNo
(),
pageQuery
.
getPageSize
());
IPage
<
PlanPeople
>
pages
=
this
.
page
(
iPage
);
return
BaseResponse
.
okData
(
pages
);
}
@Override
public
BaseResponse
<
List
<
PlanPeople
>>
getList
()
{
QueryWrapper
<
PlanPeople
>
qw
=
new
QueryWrapper
<>();
qw
.
ne
(
"id"
,
0
);
List
<
PlanPeople
>
list
=
this
.
list
(
qw
);
return
BaseResponse
.
okData
(
list
);
}
@Override
public
BaseResponse
<
String
>
status
(
Integer
status
,
Integer
id
)
{
if
(
status
==
null
||
id
==
null
){
return
BaseResponse
.
errorMsg
(
"参数错误!"
);
}
PlanPeople
planPeople
=
planPeopleMapper
.
selectById
(
id
);
if
(
planPeople
==
null
){
return
BaseResponse
.
errorMsg
(
"数据错误!"
);
}
planPeople
.
setStatus
(
status
);
planPeopleMapper
.
updateById
(
planPeople
);
String
result
=
""
;
if
(
planPeople
.
getStatus
()
==
1
){
result
=
"通过"
;
}
else
{
result
=
"未通过"
;
}
return
BaseResponse
.
okData
(
result
);
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/PlanTrainingServiceImpl.java
0 → 100644
View file @
4d16adfe
package
cn
.
wise
.
sc
.
cement
.
business
.
service
.
impl
;
import
cn.wise.sc.cement.business.entity.*
;
import
cn.wise.sc.cement.business.mapper.PlanTrainingMapper
;
import
cn.wise.sc.cement.business.mapper.PlanPeopleMapper
;
import
cn.wise.sc.cement.business.mapper.SysGroupMapper
;
import
cn.wise.sc.cement.business.mapper.SysUserMapper
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.query.PlanTrainingQuery
;
import
cn.wise.sc.cement.business.model.vo.PlanTrainingVo
;
import
cn.wise.sc.cement.business.model.vo.UserVo
;
import
cn.wise.sc.cement.business.service.IPlanTrainingService
;
import
cn.wise.sc.cement.business.service.IPlanPeopleService
;
import
cn.wise.sc.cement.business.service.ISysUserService
;
import
cn.wise.sc.cement.business.util.ExcelUtil
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.toolkit.CollectionUtils
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.springframework.beans.BeanUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.*
;
/**
* <p>
* 服务实现类
* </p>
*
* @author wlb
* @since 2020-10-19
*/
@Service
public
class
PlanTrainingServiceImpl
extends
ServiceImpl
<
PlanTrainingMapper
,
PlanTraining
>
implements
IPlanTrainingService
{
@Resource
private
PlanTrainingMapper
planTrainingMapper
;
@Resource
private
SysGroupMapper
sysGroupMapper
;
@Resource
private
SysUserMapper
sysUserMapper
;
@Autowired
private
ISysUserService
userService
;
@Autowired
private
IPlanPeopleService
iPlantPeopleService
;
@Resource
private
PlanPeopleMapper
plantPeopleMapper
;
@Override
public
BaseResponse
<
IPage
<
PlanTrainingVo
>>
getPage
(
PageQuery
pageQuery
)
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
Page
<
PlanTrainingVo
>
page
=
new
Page
<>(
pageQuery
.
getPageNo
(),
pageQuery
.
getPageSize
());
IPage
<
PlanTrainingVo
>
pages
=
planTrainingMapper
.
getPage
(
page
,
params
);
return
BaseResponse
.
okData
(
pages
);
}
@Override
public
BaseResponse
<
List
<
PlanTrainingVo
>>
getList
(
Date
start
,
Date
end
)
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"start"
,
start
);
params
.
put
(
"end"
,
end
);
List
<
PlanTrainingVo
>
list
=
planTrainingMapper
.
getList
(
params
);
return
BaseResponse
.
okData
(
list
);
}
@Override
public
BaseResponse
<
List
<
PlanTrainingVo
>>
getById
(
Integer
id
)
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"id"
,
id
);
List
<
PlanTrainingVo
>
list
=
planTrainingMapper
.
getById
(
params
);
return
BaseResponse
.
okData
(
list
);
}
@Override
@Transactional
public
BaseResponse
<
PlanTraining
>
create
(
PlanTrainingQuery
query
)
{
PlanTraining
cama
=
new
PlanTraining
();
BeanUtils
.
copyProperties
(
query
,
cama
);
boolean
save
=
this
.
save
(
cama
);
if
(
save
){
Integer
planId
=
cama
.
getId
();
//todo 培训关联表对象 ==>plant + 基本用户信息
//拆分用户id
String
userIds
=
query
.
getUserIds
();
String
[]
split
=
userIds
.
split
(
"、"
);
List
<
PlanPeople
>
batchAdd
=
new
ArrayList
<>();
//为每个用户id创建关联表信息s
for
(
String
userId:
split
)
{
Integer
id
=
Integer
.
parseInt
(
userId
);
UserVo
user
=
sysUserMapper
.
getById
(
id
);
PlanPeople
planPeople
=
new
PlanPeople
();
planPeople
.
setPlanId
(
planId
);
planPeople
.
setUserId
(
user
.
getId
());
planPeople
.
setName
(
user
.
getName
());
planPeople
.
setAccount
(
user
.
getUsername
());
planPeople
.
setGroupId
(
user
.
getGroupId
());
batchAdd
.
add
(
planPeople
);
}
//传的GroupIds
String
groupIds
=
query
.
getGroupIds
();
String
[]
split1
=
groupIds
.
split
(
"、"
);
List
<
PlanPeople
>
batchAdd1
=
new
ArrayList
<>();
for
(
String
groupId:
split1
){
int
gpId
=
Integer
.
parseInt
(
groupId
);
QueryWrapper
<
SysUser
>
qw
=
new
QueryWrapper
<>();
qw
.
eq
(
"group_id"
,
gpId
);
List
<
SysUser
>
sysUsers
=
sysUserMapper
.
selectList
(
qw
);
for
(
SysUser
user
:
sysUsers
){
PlanPeople
planPeople
=
new
PlanPeople
();
planPeople
.
setPlanId
(
planId
);
planPeople
.
setUserId
(
user
.
getId
());
planPeople
.
setName
(
user
.
getName
());
planPeople
.
setAccount
(
user
.
getUsername
());
planPeople
.
setGroupId
(
user
.
getGroupId
());
batchAdd
.
add
(
planPeople
);
}
}
iPlantPeopleService
.
saveBatch
(
batchAdd
);
}
return
BaseResponse
.
okData
(
cama
);
}
@Override
public
BaseResponse
<
PlanTraining
>
update
(
PlanTrainingQuery
planTrainingQuery
)
{
PlanTraining
update
=
new
PlanTraining
();
BeanUtils
.
copyProperties
(
planTrainingQuery
,
update
);
update
.
setId
(
planTrainingQuery
.
getId
());
planTrainingMapper
.
updateById
(
update
);
return
BaseResponse
.
okData
(
update
);
}
// @Override
// @Transactional
// public BaseResponse<String> status(Integer status, Integer id) {
// if(status == null || id == null){
// return BaseResponse.errorMsg("参数错误!");
// }
// PlanTraining planTraining = planTrainingMapper.selectById(id);
// if(planTraining == null){
// return BaseResponse.errorMsg("数据错误!");
// }
// planTraining.setStatus(status);
// planTrainingMapper.updateById(planTraining);
// String result = "";
// if(planTraining.getStatus() == 1){
// result = "未通过";
// }else{
// result = "通过";
// }
// return BaseResponse.okData(result);
// }
@Override
public
BaseResponse
delete
(
Integer
id
)
{
PlanTraining
nsa
=
planTrainingMapper
.
selectById
(
id
);
if
(
nsa
==
null
){
return
BaseResponse
.
errorMsg
(
"为找到指定信息"
);
}
planTrainingMapper
.
deleteById
(
id
);
return
BaseResponse
.
okData
(
"删除成功"
);
}
@Override
public
void
exportList
(
String
filename
,
String
objective
,
HttpServletResponse
response
)
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"objective"
,
objective
);
List
<
Map
<
String
,
Object
>>
list
=
planTrainingMapper
.
exportList
(
params
);
if
(!
CollectionUtils
.
isEmpty
(
list
))
{
Map
<
String
,
Object
>
map
=
list
.
get
(
0
);
String
[]
headers
=
new
String
[
map
.
size
()];
headers
[
0
]
=
"序号"
;
headers
[
1
]
=
"培训目的"
;
headers
[
2
]
=
"培训内容"
;
headers
[
3
]
=
"培训方式"
;
headers
[
4
]
=
"培训时间"
;
headers
[
5
]
=
"培训对象"
;
headers
[
6
]
=
"培训人"
;
headers
[
7
]
=
"考核人"
;
List
<
Object
[]>
datas
=
new
ArrayList
<>(
list
.
size
());
for
(
Map
<
String
,
Object
>
m
:
list
)
{
Object
[]
objects
=
new
Object
[
headers
.
length
];
for
(
int
j
=
0
;
j
<
headers
.
length
;
j
++)
{
String
obj
=
m
.
get
(
headers
[
j
])==
null
?
""
:
m
.
get
(
headers
[
j
]).
toString
();
if
(
j
==
0
&&
obj
!=
null
){
obj
=
obj
.
split
(
"\\."
)[
0
];
}
objects
[
j
]
=
obj
;
}
datas
.
add
(
objects
);
}
ExcelUtil
.
excelExport
(
filename
==
null
||
filename
.
trim
().
length
()
<=
0
?
"培训计划"
:
filename
,
headers
,
datas
,
response
);
}
}
/**
* 培训计划上传附件
*
* @param query
* @return
*/
// @Transactional
// @Override
// public BaseResponse<PlanTraining> uploadPlanTrainListPT(PlanTrainingFJ query) {
// LoginUser loginUser = userService.getLoginUser();
// if (loginUser == null) {
// return BaseResponse.errorMsg("请登录账号");
// }
// if (query == null || query.getId() == null) {
// return BaseResponse.errorMsg("参数错误");
// }
// PlanTraining planTraining = planTrainingMapper.selectById(query.getId());
// if (planTraining == null) {
// return BaseResponse.errorMsg("数据错误");
// }
// planTraining.setEnclosureUrl(query.getEnclosureUrl())
// .setExtName(query.getExtName())
// .setAlias(query.getAlias());
// planTrainingMapper.updateById(planTraining);
// return BaseResponse.okData(planTraining);
// }
}
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