Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
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
8060cfe6
Commit
8060cfe6
authored
Oct 21, 2020
by
mengbali153
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
培训计划
parent
0366eb59
Hide whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
197 additions
and
19 deletions
+197
-19
PlanPeopleController.java
...e/sc/cement/business/controller/PlanPeopleController.java
+25
-4
PlanTrainingController.java
...sc/cement/business/controller/PlanTrainingController.java
+0
-2
PlanPeople.java
...in/java/cn/wise/sc/cement/business/entity/PlanPeople.java
+14
-0
PlanPeopleQuery.java
.../wise/sc/cement/business/model/query/PlanPeopleQuery.java
+2
-2
PlanTrainingQuery.java
...ise/sc/cement/business/model/query/PlanTrainingQuery.java
+2
-2
PlanPeopleVo.java
...ava/cn/wise/sc/cement/business/model/vo/PlanPeopleVo.java
+4
-0
IPlanPeopleService.java
...n/wise/sc/cement/business/service/IPlanPeopleService.java
+20
-0
IPlanTrainingService.java
...wise/sc/cement/business/service/IPlanTrainingService.java
+0
-8
PlanPeopleServiceImpl.java
...c/cement/business/service/impl/PlanPeopleServiceImpl.java
+66
-0
PlanTrainingServiceImpl.java
...cement/business/service/impl/PlanTrainingServiceImpl.java
+64
-1
No files found.
cement-business/src/main/java/cn/wise/sc/cement/business/controller/PlanPeopleController.java
View file @
8060cfe6
...
@@ -2,16 +2,15 @@ package cn.wise.sc.cement.business.controller;
...
@@ -2,16 +2,15 @@ package cn.wise.sc.cement.business.controller;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.query.PlanPeopleQuery
;
import
cn.wise.sc.cement.business.model.query.SampleDistributionEnclosureQuery
;
import
cn.wise.sc.cement.business.service.IPlanPeopleService
;
import
cn.wise.sc.cement.business.service.IPlanPeopleService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
io.swagger.annotations.ApiOperation
;
import
org.slf4j.Logger
;
import
org.slf4j.Logger
;
import
org.slf4j.LoggerFactory
;
import
org.slf4j.LoggerFactory
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.*
;
import
org.springframework.web.bind.annotation.PostMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
/**
/**
* <p>
* <p>
...
@@ -62,4 +61,26 @@ public class PlanPeopleController {
...
@@ -62,4 +61,26 @@ public class PlanPeopleController {
}
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
}
@ApiOperation
(
value
=
"培训计划上传附件"
)
@PostMapping
(
"/uploadPlanPF"
)
public
BaseResponse
uploadPlanPF
(
PlanPeopleQuery
query
)
{
try
{
return
iPlanPeopleService
.
uploadPlanPF
(
query
);
}
catch
(
Exception
e
)
{
log
.
debug
(
"培训计划上传附件{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
@ApiOperation
(
value
=
"同步历史档案"
)
@PostMapping
(
"/synchronization/{id}"
)
public
BaseResponse
synchronization
(
@PathVariable
Integer
id
){
try
{
return
iPlanPeopleService
.
synchronization
(
id
);
}
catch
(
Exception
e
){
log
.
debug
(
"同步历史档案{}"
,
e
);
}
return
BaseResponse
.
errorMsg
(
"失败!"
);
}
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/controller/PlanTrainingController.java
View file @
8060cfe6
...
@@ -4,9 +4,7 @@ import cn.hutool.core.date.DateUtil;
...
@@ -4,9 +4,7 @@ import cn.hutool.core.date.DateUtil;
import
cn.hutool.core.util.StrUtil
;
import
cn.hutool.core.util.StrUtil
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
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.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.model.vo.PlanTrainingVo
;
import
cn.wise.sc.cement.business.service.IPlanTrainingService
;
import
cn.wise.sc.cement.business.service.IPlanTrainingService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/entity/PlanPeople.java
View file @
8060cfe6
...
@@ -3,12 +3,14 @@ package cn.wise.sc.cement.business.entity;
...
@@ -3,12 +3,14 @@ package cn.wise.sc.cement.business.entity;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.EqualsAndHashCode
;
import
lombok.experimental.Accessors
;
import
lombok.experimental.Accessors
;
import
org.springframework.data.annotation.Id
;
import
org.springframework.data.annotation.Id
;
import
java.io.Serializable
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
@Data
@Data
@EqualsAndHashCode
(
callSuper
=
false
)
@EqualsAndHashCode
(
callSuper
=
false
)
...
@@ -32,4 +34,16 @@ public class PlanPeople implements Serializable {
...
@@ -32,4 +34,16 @@ public class PlanPeople implements Serializable {
private
String
account
;
private
String
account
;
@ApiModelProperty
(
"附件地址"
)
private
String
enclosureUrl
;
@ApiModelProperty
(
"状态(0未上传,1成功,2上传失败)"
)
private
Integer
FlStatus
;
@ApiModelProperty
(
"文件名"
)
private
String
alias
;
@ApiModelProperty
(
"扩展名"
)
private
String
extName
;
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/model/query/Plan
TrainingFJ
.java
→
cement-business/src/main/java/cn/wise/sc/cement/business/model/query/Plan
PeopleQuery
.java
View file @
8060cfe6
...
@@ -11,9 +11,9 @@ import lombok.RequiredArgsConstructor;
...
@@ -11,9 +11,9 @@ import lombok.RequiredArgsConstructor;
* @create: 2020-10-19
* @create: 2020-10-19
**/
**/
@Data
@Data
@RequiredArgsConstructor
@ApiModel
(
"培训计划附件"
)
@ApiModel
(
"培训计划附件"
)
public
class
PlanTrainingFJ
{
public
class
PlanPeopleQuery
{
@ApiModelProperty
(
"培训计划审批id"
)
private
Integer
id
;
private
Integer
id
;
@ApiModelProperty
(
"文件名"
)
@ApiModelProperty
(
"文件名"
)
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/model/query/PlanTrainingQuery.java
View file @
8060cfe6
...
@@ -27,8 +27,8 @@ public class PlanTrainingQuery {
...
@@ -27,8 +27,8 @@ public class PlanTrainingQuery {
@ApiModelProperty
(
"培训方式"
)
@ApiModelProperty
(
"培训方式"
)
private
String
mode
;
private
String
mode
;
//
@ApiModelProperty("培训对象")
@ApiModelProperty
(
"培训对象"
)
//
private String planObject;
private
String
planObject
;
@ApiModelProperty
(
"培训人"
)
@ApiModelProperty
(
"培训人"
)
private
String
people
;
private
String
people
;
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/model/vo/PlanPeopleVo.java
View file @
8060cfe6
package
cn
.
wise
.
sc
.
cement
.
business
.
model
.
vo
;
package
cn
.
wise
.
sc
.
cement
.
business
.
model
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.Data
;
import
java.io.Serializable
;
import
java.io.Serializable
;
...
@@ -20,4 +21,7 @@ public class PlanPeopleVo implements Serializable {
...
@@ -20,4 +21,7 @@ public class PlanPeopleVo implements Serializable {
private
String
account
;
private
String
account
;
private
Integer
status
;
private
Integer
status
;
@ApiModelProperty
(
"文件名"
)
private
String
alias
;
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/IPlanPeopleService.java
View file @
8060cfe6
...
@@ -2,12 +2,16 @@ package cn.wise.sc.cement.business.service;
...
@@ -2,12 +2,16 @@ package cn.wise.sc.cement.business.service;
import
cn.wise.sc.cement.business.entity.PlanPeople
;
import
cn.wise.sc.cement.business.entity.PlanPeople
;
import
cn.wise.sc.cement.business.entity.PlanTraining
;
import
cn.wise.sc.cement.business.entity.PlanTraining
;
import
cn.wise.sc.cement.business.entity.SampleDistribution
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.query.PlanPeopleQuery
;
import
cn.wise.sc.cement.business.model.query.SampleDistributionEnclosureQuery
;
import
cn.wise.sc.cement.business.model.vo.PlanPeopleVo
;
import
cn.wise.sc.cement.business.model.vo.PlanPeopleVo
;
import
cn.wise.sc.cement.business.model.vo.PlanTrainingVo
;
import
cn.wise.sc.cement.business.model.vo.PlanTrainingVo
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.Date
;
import
java.util.Date
;
import
java.util.List
;
import
java.util.List
;
...
@@ -35,4 +39,20 @@ public interface IPlanPeopleService extends IService<PlanPeople> {
...
@@ -35,4 +39,20 @@ public interface IPlanPeopleService extends IService<PlanPeople> {
* @return Boolean
* @return Boolean
*/
*/
BaseResponse
<
String
>
status
(
Integer
status
,
Integer
id
);
BaseResponse
<
String
>
status
(
Integer
status
,
Integer
id
);
/**
* 培训计划上传附件
*
* @param query
* @return
*/
BaseResponse
<
PlanPeople
>
uploadPlanPF
(
PlanPeopleQuery
query
);
/**
* 同步历史档案
*
* @param id
* @return
*/
BaseResponse
synchronization
(
Integer
id
);
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/IPlanTrainingService.java
View file @
8060cfe6
package
cn
.
wise
.
sc
.
cement
.
business
.
service
;
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.entity.PlanTraining
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.PageQuery
;
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.PlanTrainingQuery
;
import
cn.wise.sc.cement.business.model.vo.PlanTrainingVo
;
import
cn.wise.sc.cement.business.model.vo.PlanTrainingVo
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
...
@@ -86,10 +84,4 @@ public interface IPlanTrainingService extends IService<PlanTraining> {
...
@@ -86,10 +84,4 @@ public interface IPlanTrainingService extends IService<PlanTraining> {
*/
*/
void
exportList
(
String
filename
,
String
objective
,
HttpServletResponse
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
View file @
8060cfe6
...
@@ -3,20 +3,31 @@ package cn.wise.sc.cement.business.service.impl;
...
@@ -3,20 +3,31 @@ package cn.wise.sc.cement.business.service.impl;
import
cn.wise.sc.cement.business.entity.HistoryArchives
;
import
cn.wise.sc.cement.business.entity.HistoryArchives
;
import
cn.wise.sc.cement.business.entity.PlanPeople
;
import
cn.wise.sc.cement.business.entity.PlanPeople
;
import
cn.wise.sc.cement.business.entity.PlanTraining
;
import
cn.wise.sc.cement.business.entity.PlanTraining
;
import
cn.wise.sc.cement.business.entity.SampleDistribution
;
import
cn.wise.sc.cement.business.mapper.HistoryArchivesMapper
;
import
cn.wise.sc.cement.business.mapper.PlanPeopleMapper
;
import
cn.wise.sc.cement.business.mapper.PlanPeopleMapper
;
import
cn.wise.sc.cement.business.mapper.PlanTrainingMapper
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
import
cn.wise.sc.cement.business.model.LoginUser
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.PageQuery
;
import
cn.wise.sc.cement.business.model.query.PlanPeopleQuery
;
import
cn.wise.sc.cement.business.model.vo.HistoryArchivesVo
;
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.PlanPeopleVo
;
import
cn.wise.sc.cement.business.model.vo.PlanTrainingVo
;
import
cn.wise.sc.cement.business.model.vo.PlanTrainingVo
;
import
cn.wise.sc.cement.business.service.IHistoryArchivesService
;
import
cn.wise.sc.cement.business.service.IPlanPeopleService
;
import
cn.wise.sc.cement.business.service.IPlanPeopleService
;
import
cn.wise.sc.cement.business.service.ISysUserService
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
org.apache.commons.lang3.StringUtils
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
javax.annotation.Resource
;
import
java.time.LocalDateTime
;
import
java.util.HashMap
;
import
java.util.HashMap
;
import
java.util.List
;
import
java.util.List
;
import
java.util.Map
;
import
java.util.Map
;
...
@@ -34,6 +45,19 @@ public class PlanPeopleServiceImpl extends ServiceImpl<PlanPeopleMapper, PlanPeo
...
@@ -34,6 +45,19 @@ public class PlanPeopleServiceImpl extends ServiceImpl<PlanPeopleMapper, PlanPeo
@Resource
@Resource
private
PlanPeopleMapper
planPeopleMapper
;
private
PlanPeopleMapper
planPeopleMapper
;
@Resource
private
PlanTrainingMapper
planTrainingMapper
;
@Resource
private
HistoryArchivesMapper
historyArchivesMapper
;
@Autowired
private
ISysUserService
userService
;
@Autowired
private
IHistoryArchivesService
iHistoryArchivesService
;
@Override
@Override
public
BaseResponse
<
IPage
<
PlanPeople
>>
getPage
(
PageQuery
pageQuery
)
{
public
BaseResponse
<
IPage
<
PlanPeople
>>
getPage
(
PageQuery
pageQuery
)
{
// Page<PlanPeopleVo> page = new Page<>(pageQuery.getPageNo(), pageQuery.getPageSize());
// Page<PlanPeopleVo> page = new Page<>(pageQuery.getPageNo(), pageQuery.getPageSize());
...
@@ -69,4 +93,46 @@ public class PlanPeopleServiceImpl extends ServiceImpl<PlanPeopleMapper, PlanPeo
...
@@ -69,4 +93,46 @@ public class PlanPeopleServiceImpl extends ServiceImpl<PlanPeopleMapper, PlanPeo
}
}
return
BaseResponse
.
okData
(
result
);
return
BaseResponse
.
okData
(
result
);
}
}
@Override
@Transactional
public
BaseResponse
<
PlanPeople
>
uploadPlanPF
(
PlanPeopleQuery
query
)
{
LoginUser
loginUser
=
userService
.
getLoginUser
();
if
(
loginUser
==
null
)
{
return
BaseResponse
.
errorMsg
(
"请登录账号"
);
}
if
(
query
==
null
||
query
.
getId
()
==
null
)
{
return
BaseResponse
.
errorMsg
(
"参数错误"
);
}
PlanPeople
planPeople
=
planPeopleMapper
.
selectById
(
query
.
getId
());
if
(
planPeople
==
null
)
{
return
BaseResponse
.
errorMsg
(
"数据错误"
);
}
planPeople
.
setEnclosureUrl
(
query
.
getEnclosureUrl
())
.
setExtName
(
query
.
getExtName
())
.
setAlias
(
query
.
getAlias
())
.
setStatus
(
1
);
if
(
StringUtils
.
isEmpty
(
query
.
getEnclosureUrl
()))
{
planPeople
.
setStatus
(
2
);
}
planPeopleMapper
.
updateById
(
planPeople
);
return
BaseResponse
.
okData
(
planPeople
);
}
@Override
public
BaseResponse
synchronization
(
Integer
id
)
{
PlanPeople
planPeople
=
planPeopleMapper
.
selectById
(
id
);
Integer
planId
=
planPeople
.
getPlanId
();
PlanTraining
planTraining
=
planTrainingMapper
.
selectById
(
planId
);
HistoryArchives
historyArchives
=
new
HistoryArchives
();
historyArchives
.
setCreateTime
(
LocalDateTime
.
now
())
.
setTime
(
planTraining
.
getStartTime
())
.
setType
(
planTraining
.
getContent
())
.
setContent
(
planTraining
.
getObjective
())
.
setUserId
(
planPeople
.
getUserId
());
historyArchivesMapper
.
insert
(
historyArchives
);
return
BaseResponse
.
okData
(
"同步成功"
);
}
}
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/PlanTrainingServiceImpl.java
View file @
8060cfe6
...
@@ -53,6 +53,9 @@ public class PlanTrainingServiceImpl extends ServiceImpl<PlanTrainingMapper, Pla
...
@@ -53,6 +53,9 @@ public class PlanTrainingServiceImpl extends ServiceImpl<PlanTrainingMapper, Pla
@Autowired
@Autowired
private
IPlanPeopleService
iPlantPeopleService
;
private
IPlanPeopleService
iPlantPeopleService
;
@Autowired
private
IPlanTrainingService
iPlanTrainingService
;
@Resource
@Resource
private
PlanPeopleMapper
plantPeopleMapper
;
private
PlanPeopleMapper
plantPeopleMapper
;
...
@@ -86,6 +89,7 @@ public class PlanTrainingServiceImpl extends ServiceImpl<PlanTrainingMapper, Pla
...
@@ -86,6 +89,7 @@ public class PlanTrainingServiceImpl extends ServiceImpl<PlanTrainingMapper, Pla
public
BaseResponse
<
PlanTraining
>
create
(
PlanTrainingQuery
query
)
{
public
BaseResponse
<
PlanTraining
>
create
(
PlanTrainingQuery
query
)
{
PlanTraining
cama
=
new
PlanTraining
();
PlanTraining
cama
=
new
PlanTraining
();
BeanUtils
.
copyProperties
(
query
,
cama
);
BeanUtils
.
copyProperties
(
query
,
cama
);
cama
.
setPlanObject
(
""
);
boolean
save
=
this
.
save
(
cama
);
boolean
save
=
this
.
save
(
cama
);
if
(
save
){
if
(
save
){
Integer
planId
=
cama
.
getId
();
Integer
planId
=
cama
.
getId
();
...
@@ -106,8 +110,10 @@ public class PlanTrainingServiceImpl extends ServiceImpl<PlanTrainingMapper, Pla
...
@@ -106,8 +110,10 @@ public class PlanTrainingServiceImpl extends ServiceImpl<PlanTrainingMapper, Pla
planPeople
.
setGroupId
(
user
.
getGroupId
());
planPeople
.
setGroupId
(
user
.
getGroupId
());
batchAdd
.
add
(
planPeople
);
batchAdd
.
add
(
planPeople
);
cama
.
setPlanObject
(
cama
.
getPlanObject
()+
user
.
getName
()+
"、"
);
}
}
//传的GroupIds
//传的GroupIds
String
groupIds
=
query
.
getGroupIds
();
String
groupIds
=
query
.
getGroupIds
();
String
[]
split1
=
groupIds
.
split
(
"、"
);
String
[]
split1
=
groupIds
.
split
(
"、"
);
...
@@ -129,6 +135,9 @@ public class PlanTrainingServiceImpl extends ServiceImpl<PlanTrainingMapper, Pla
...
@@ -129,6 +135,9 @@ public class PlanTrainingServiceImpl extends ServiceImpl<PlanTrainingMapper, Pla
}
}
}
}
iPlantPeopleService
.
saveBatch
(
batchAdd
);
iPlantPeopleService
.
saveBatch
(
batchAdd
);
String
substring
=
cama
.
getPlanObject
().
substring
(
0
,
cama
.
getPlanObject
().
length
()
-
1
);
cama
.
setPlanObject
(
substring
);
iPlanTrainingService
.
updateById
(
cama
);
}
}
return
BaseResponse
.
okData
(
cama
);
return
BaseResponse
.
okData
(
cama
);
}
}
...
@@ -138,7 +147,61 @@ public class PlanTrainingServiceImpl extends ServiceImpl<PlanTrainingMapper, Pla
...
@@ -138,7 +147,61 @@ public class PlanTrainingServiceImpl extends ServiceImpl<PlanTrainingMapper, Pla
PlanTraining
update
=
new
PlanTraining
();
PlanTraining
update
=
new
PlanTraining
();
BeanUtils
.
copyProperties
(
planTrainingQuery
,
update
);
BeanUtils
.
copyProperties
(
planTrainingQuery
,
update
);
update
.
setId
(
planTrainingQuery
.
getId
());
update
.
setId
(
planTrainingQuery
.
getId
());
planTrainingMapper
.
updateById
(
update
);
QueryWrapper
<
PlanPeople
>
qw
=
new
QueryWrapper
<>();
qw
.
eq
(
"plan_id"
,
update
.
getId
());
update
.
setPlanObject
(
""
);
boolean
remove
=
iPlantPeopleService
.
remove
(
qw
);
if
(
remove
){
Integer
planId
=
update
.
getId
();
//todo 培训关联表对象 ==>plant + 基本用户信息
//拆分用户id
String
userIds
=
planTrainingQuery
.
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
);
update
.
setPlanObject
(
update
.
getPlanObject
()+
user
.
getName
()+
"、"
);
}
//传的GroupIds
String
groupIds
=
planTrainingQuery
.
getGroupIds
();
String
[]
split1
=
groupIds
.
split
(
"、"
);
List
<
PlanPeople
>
batchAdd1
=
new
ArrayList
<>();
for
(
String
groupId:
split1
){
int
gpId
=
Integer
.
parseInt
(
groupId
);
QueryWrapper
<
SysUser
>
qw1
=
new
QueryWrapper
<>();
qw1
.
eq
(
"group_id"
,
gpId
);
List
<
SysUser
>
sysUsers
=
sysUserMapper
.
selectList
(
qw1
);
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
);
String
substring
=
update
.
getPlanObject
().
substring
(
0
,
update
.
getPlanObject
().
length
()
-
1
);
update
.
setPlanObject
(
substring
);
iPlanTrainingService
.
updateById
(
update
);
}
return
BaseResponse
.
okData
(
update
);
return
BaseResponse
.
okData
(
update
);
}
}
...
...
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