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
a38e06d8
Commit
a38e06d8
authored
Oct 22, 2020
by
竹天卫
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
http://111.203.232.171:8888/zhutianwei/tianjin-cement
parents
8570c775
0f2f4795
Show whitespace changes
Inline
Side-by-side
Showing
22 changed files
with
1298 additions
and
40 deletions
+1298
-40
NormProductionController.java
.../cement/business/controller/NormProductionController.java
+0
-1
PlanPeopleController.java
...e/sc/cement/business/controller/PlanPeopleController.java
+86
-0
PlanTrainingController.java
...sc/cement/business/controller/PlanTrainingController.java
+159
-0
PlanPeople.java
...in/java/cn/wise/sc/cement/business/entity/PlanPeople.java
+49
-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
EntrustMapper.xml
...a/cn/wise/sc/cement/business/mapper/xml/EntrustMapper.xml
+4
-19
NonStandardValueMapper.xml
.../sc/cement/business/mapper/xml/NonStandardValueMapper.xml
+5
-2
PlanPeopleMapper.xml
...n/wise/sc/cement/business/mapper/xml/PlanPeopleMapper.xml
+20
-0
PlanTrainingMapper.xml
...wise/sc/cement/business/mapper/xml/PlanTrainingMapper.xml
+60
-0
SampleHandleMapper.xml
...wise/sc/cement/business/mapper/xml/SampleHandleMapper.xml
+8
-6
PlanPeopleQuery.java
.../wise/sc/cement/business/model/query/PlanPeopleQuery.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
+27
-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
+58
-0
IPlanTrainingService.java
...wise/sc/cement/business/service/IPlanTrainingService.java
+87
-0
NormProductionServiceImpl.java
...ment/business/service/impl/NormProductionServiceImpl.java
+2
-6
PlanPeopleServiceImpl.java
...c/cement/business/service/impl/PlanPeopleServiceImpl.java
+141
-0
PlanTrainingServiceImpl.java
...cement/business/service/impl/PlanTrainingServiceImpl.java
+302
-0
QualityApplyServiceImpl.java
...cement/business/service/impl/QualityApplyServiceImpl.java
+0
-6
No files found.
cement-business/src/main/java/cn/wise/sc/cement/business/controller/NormProductionController.java
View file @
a38e06d8
...
@@ -184,7 +184,6 @@ public class NormProductionController {
...
@@ -184,7 +184,6 @@ public class NormProductionController {
return
BaseResponse
.
okData
(
PageUtil
.
listConvertToPage
(
rts
,
pageQuery
));
return
BaseResponse
.
okData
(
PageUtil
.
listConvertToPage
(
rts
,
pageQuery
));
}
}
@PostMapping
(
"/export/statistics"
)
@PostMapping
(
"/export/statistics"
)
@ApiOperation
(
"导出标准产值列表"
)
@ApiOperation
(
"导出标准产值列表"
)
public
void
exportNormProductionStatistics
(
String
start
,
String
end
,
String
name
,
Integer
groupId
,
HttpServletResponse
response
)
{
public
void
exportNormProductionStatistics
(
String
start
,
String
end
,
String
name
,
Integer
groupId
,
HttpServletResponse
response
)
{
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/controller/PlanPeopleController.java
0 → 100644
View file @
a38e06d8
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.model.query.PlanPeopleQuery
;
import
cn.wise.sc.cement.business.model.query.SampleDistributionEnclosureQuery
;
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.*
;
/**
* <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
,
Integer
planId
)
{
try
{
return
iPlanPeopleService
.
getPage
(
pageQuery
,
planId
);
}
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
(
"失败!"
);
}
@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
0 → 100644
View file @
a38e06d8
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.PlanTrainingQuery
;
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 @
a38e06d8
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.springframework.data.annotation.Id
;
import
java.io.Serializable
;
import
java.time.LocalDateTime
;
@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
;
@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/entity/PlanTraining.java
0 → 100644
View file @
a38e06d8
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 @
a38e06d8
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
,
@Param
(
"params"
)
Map
<
String
,
Object
>
params
);
}
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/PlanTrainingMapper.java
0 → 100644
View file @
a38e06d8
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/EntrustMapper.xml
View file @
a38e06d8
...
@@ -100,22 +100,6 @@
...
@@ -100,22 +100,6 @@
<select
id=
"getDetail"
resultType=
"cn.wise.sc.cement.business.model.vo.EntrustVo"
>
<select
id=
"getDetail"
resultType=
"cn.wise.sc.cement.business.model.vo.EntrustVo"
>
select e.*,
select e.*,
(
(
...
@@ -238,6 +222,7 @@
...
@@ -238,6 +222,7 @@
<include
refid=
"checkWhere"
/>
<include
refid=
"checkWhere"
/>
order by e.update_time desc
order by e.update_time desc
</select>
</select>
<select
id=
"getReportDetail"
resultType=
"cn.wise.sc.cement.business.entity.EntrustReport"
>
<select
id=
"getReportDetail"
resultType=
"cn.wise.sc.cement.business.entity.EntrustReport"
>
SELECT e.id,e.project_name,e.send_name,e.client_id,e.entrust_code,e.project_type,sscct.* FROM entrust e
SELECT e.id,e.project_name,e.send_name,e.client_id,e.entrust_code,e.project_type,sscct.* FROM entrust e
RIGHT JOIN
RIGHT JOIN
...
@@ -250,6 +235,7 @@
...
@@ -250,6 +235,7 @@
ON sct.check_id = sc.id ) scct
ON sct.check_id = sc.id ) scct
ON s.id = scct.sample_id) sscct
ON s.id = scct.sample_id) sscct
ON sscct.entrust_id = e.id
ON sscct.entrust_id = e.id
WHERE e.id IS NOT NULL
</select>
</select>
<select
id=
"getQualityDetail"
resultType=
"cn.wise.sc.cement.business.entity.QualityDetail"
>
<select
id=
"getQualityDetail"
resultType=
"cn.wise.sc.cement.business.entity.QualityDetail"
>
...
@@ -292,5 +278,4 @@
...
@@ -292,5 +278,4 @@
</where>
</where>
</sql>
</sql>
</mapper>
</mapper>
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/NonStandardValueMapper.xml
View file @
a38e06d8
...
@@ -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/PlanPeopleMapper.xml
0 → 100644
View file @
a38e06d8
<?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"
>
<sql
id=
"where"
>
<where>
<if
test=
"params.planId != null "
>
and pp.plan_id = #{params.planId}
</if>
</where>
</sql>
<select
id=
"getPage"
resultType=
"cn.wise.sc.cement.business.model.vo.PlanPeopleVo"
>
select pp.id,pp.name,pp.account,pp.status,pp.alias
from plan_people pp
<include
refid=
"where"
/>
order by pp.id asc
</select>
</mapper>
\ No newline at end of file
cement-business/src/main/java/cn/wise/sc/cement/business/mapper/xml/PlanTrainingMapper.xml
0 → 100644
View file @
a38e06d8
<?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/mapper/xml/SampleHandleMapper.xml
View file @
a38e06d8
...
@@ -77,12 +77,14 @@
...
@@ -77,12 +77,14 @@
</select>
</select>
<select
id=
"getEntrustSample"
resultType=
"cn.wise.sc.cement.business.entity.EntrustSample"
>
<select
id=
"getEntrustSample"
resultType=
"cn.wise.sc.cement.business.entity.EntrustSample"
>
SELECT e.project_name,e.entrust_code,g.distribution_id,g.entrust_id,g.`sample_name`,g.user_id,g.sample_id FROM entrust e
SELECT project_name,entrust_code,h.id,s.entrust_id,h.user_id,s.id as sample_id,e.status FROM entrust e
RIGHT JOIN
LEFT JOIN
(SELECT s.`name` as sample_name,d.distribution_id,s.entrust_id,d.user_id,s.id as sample_id FROM sample s
(SELECT * FROM sample) s
RIGHT JOIN
ON e.id = s.entrust_id
(SELECT user_id, id as distribution_id,sample_id FROM sample_handle ) d
LEFT JOIN
on s.id = d.sample_id ) g ON g.entrust_id = e.id
(SELECT * FROM sample_handle) h
ON h.sample_id = s.id
WHERE e.status > 4 AND h.id IS NOT NULL
</select>
</select>
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/model/query/PlanPeopleQuery.java
0 → 100644
View file @
a38e06d8
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
@ApiModel
(
"培训计划附件"
)
public
class
PlanPeopleQuery
{
@ApiModelProperty
(
"培训计划审批id"
)
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 @
a38e06d8
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 @
a38e06d8
package
cn
.
wise
.
sc
.
cement
.
business
.
model
.
vo
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
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
;
@ApiModelProperty
(
"文件名"
)
private
String
alias
;
}
cement-business/src/main/java/cn/wise/sc/cement/business/model/vo/PlanTrainingVo.java
0 → 100644
View file @
a38e06d8
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 @
a38e06d8
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.entity.SampleDistribution
;
import
cn.wise.sc.cement.business.model.BaseResponse
;
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.PlanTrainingVo
;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
org.springframework.transaction.annotation.Transactional
;
import
java.util.Date
;
import
java.util.List
;
public
interface
IPlanPeopleService
extends
IService
<
PlanPeople
>
{
/**
* 获取分页
* @param pageQuery 培训计划分页
* @return IPage<PlanTraining>
*/
BaseResponse
<
IPage
<
PlanPeopleVo
>>
getPage
(
PageQuery
pageQuery
,
Integer
planId
);
/**
* 获取指定时间内的培训计划
*
* @return List
*/
BaseResponse
<
List
<
PlanPeople
>>
getList
();
/**
* 更改状态信息,达到改变显示的效果
* 1:通过
*
* @param status 状态
* @param id id
* @return Boolean
*/
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
0 → 100644
View file @
a38e06d8
package
cn
.
wise
.
sc
.
cement
.
business
.
service
;
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.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
);
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/NormProductionServiceImpl.java
View file @
a38e06d8
...
@@ -594,7 +594,6 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
...
@@ -594,7 +594,6 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
@Override
@Override
public
List
<
WorkloadStatisticsVo
>
workloadStatistics
(
Date
startTime
,
Date
endTime
)
{
public
List
<
WorkloadStatisticsVo
>
workloadStatistics
(
Date
startTime
,
Date
endTime
)
{
long
start
=
getDefaultStart
(
startTime
==
null
?
0
:
startTime
.
getTime
());
long
start
=
getDefaultStart
(
startTime
==
null
?
0
:
startTime
.
getTime
());
long
end
=
getDefaultEnd
(
endTime
.
getTime
());
long
end
=
getDefaultEnd
(
endTime
.
getTime
());
Map
<
String
,
Integer
>
map1
=
initMonthMoneyMap
(
start
,
end
);
Map
<
String
,
Integer
>
map1
=
initMonthMoneyMap
(
start
,
end
);
...
@@ -608,7 +607,7 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
...
@@ -608,7 +607,7 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
qw
.
eq
(
"status"
,
2
);
qw
.
eq
(
"status"
,
2
);
List
<
SampleDistribution
>
sampleDistributions
=
iSampleDistributionService
.
list
(
qw
);
List
<
SampleDistribution
>
sampleDistributions
=
iSampleDistributionService
.
list
(
qw
);
//脾气比能力大 蠢货
QueryWrapper
<
NonStandardApply
>
qwA
=
new
QueryWrapper
<>();
QueryWrapper
<
NonStandardApply
>
qwA
=
new
QueryWrapper
<>();
if
(
startTime
!=
null
)
{
if
(
startTime
!=
null
)
{
qwA
.
ge
(
"start_time"
,
DateUtil
.
format
(
DateUtil
.
date
(
start
),
"yyyy-MM-dd"
));
qwA
.
ge
(
"start_time"
,
DateUtil
.
format
(
DateUtil
.
date
(
start
),
"yyyy-MM-dd"
));
...
@@ -617,7 +616,6 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
...
@@ -617,7 +616,6 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
qwA
.
eq
(
"status"
,
2
);
qwA
.
eq
(
"status"
,
2
);
List
<
NonStandardApply
>
nonStandardApplies
=
iNonStandardApplyService
.
list
(
qwA
);
List
<
NonStandardApply
>
nonStandardApplies
=
iNonStandardApplyService
.
list
(
qwA
);
for
(
SampleDistribution
sampleDistribution
:
sampleDistributions
)
{
for
(
SampleDistribution
sampleDistribution
:
sampleDistributions
)
{
addCount
(
sampleDistribution
.
getFinishTime
(),
map1
);
addCount
(
sampleDistribution
.
getFinishTime
(),
map1
);
}
}
...
@@ -641,13 +639,11 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
...
@@ -641,13 +639,11 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
private
void
addCount
(
LocalDateTime
date
,
Map
<
String
,
Integer
>
map
)
{
private
void
addCount
(
LocalDateTime
date
,
Map
<
String
,
Integer
>
map
)
{
Date
nextDate
=
DateUtil
.
endOfMonth
(
asDate
(
date
));
Date
nextDate
=
DateUtil
.
endOfMonth
(
asDate
(
date
));
map
.
put
(
nextDate
.
getMonth
()
+
1
+
""
,
map
.
get
(
nextDate
.
getMonth
()
+
1
+
""
)
+
1
);
map
.
put
(
nextDate
.
getMonth
()
+
1
+
""
,
map
.
get
(
nextDate
.
getMonth
()
+
1
+
""
)
+
1
);
}
}
private
void
addCount
(
LocalDate
date
,
Map
<
String
,
Integer
>
map
)
{
private
void
addCount
(
LocalDate
date
,
Map
<
String
,
Integer
>
map
)
{
Date
nextDate
=
DateUtil
.
endOfMonth
(
asDate
(
date
));
Date
nextDate
=
DateUtil
.
endOfMonth
(
asDate
(
date
));
map
.
put
(
nextDate
.
getMonth
()
+
1
+
""
,
map
.
get
(
nextDate
.
getMonth
()
+
1
+
""
)
+
1
);
map
.
put
(
nextDate
.
getMonth
()
+
1
+
""
,
map
.
get
(
nextDate
.
getMonth
()
+
1
+
""
)
+
1
);
}
}
private
static
Date
asDate
(
LocalDate
localDate
)
{
private
static
Date
asDate
(
LocalDate
localDate
)
{
...
@@ -907,7 +903,7 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
...
@@ -907,7 +903,7 @@ public class NormProductionServiceImpl extends ServiceImpl<NormProductionMapper,
}
}
/**
/**
* 计算标准产值的工时标准系数
* 计算标准产值的工时标准系数
plan
* 额定工日*建议系数/报出对应分析结果*考核工值*分析占比
* 额定工日*建议系数/报出对应分析结果*考核工值*分析占比
*
*
* @param normProduction 标准产值配置对象 如:六元素
* @param normProduction 标准产值配置对象 如:六元素
...
...
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/PlanPeopleServiceImpl.java
0 → 100644
View file @
a38e06d8
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.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.PlanTrainingMapper
;
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.query.PlanPeopleQuery
;
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.IHistoryArchivesService
;
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.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
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.transaction.annotation.Transactional
;
import
javax.annotation.Resource
;
import
java.time.LocalDateTime
;
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
;
@Resource
private
PlanTrainingMapper
planTrainingMapper
;
@Resource
private
HistoryArchivesMapper
historyArchivesMapper
;
@Autowired
private
ISysUserService
userService
;
@Autowired
private
IHistoryArchivesService
iHistoryArchivesService
;
@Override
public
BaseResponse
<
IPage
<
PlanPeopleVo
>>
getPage
(
PageQuery
pageQuery
,
Integer
planId
)
{
Map
<
String
,
Object
>
params
=
new
HashMap
<>();
params
.
put
(
"planId"
,
planId
);
Page
<
PlanPeopleVo
>
page
=
new
Page
<>(
pageQuery
.
getPageNo
(),
pageQuery
.
getPageSize
());
IPage
<
PlanPeopleVo
>
pages
=
planPeopleMapper
.
getPage
(
page
,
params
);
// 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
);
}
@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
0 → 100644
View file @
a38e06d8
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
;
@Autowired
private
IPlanTrainingService
iPlanTrainingService
;
@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
);
cama
.
setPlanObject
(
""
);
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
);
cama
.
setPlanObject
(
cama
.
getPlanObject
()+
user
.
getName
()+
"、"
);
}
//传的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
);
String
substring
=
cama
.
getPlanObject
().
substring
(
0
,
cama
.
getPlanObject
().
length
()
-
1
);
cama
.
setPlanObject
(
substring
);
iPlanTrainingService
.
updateById
(
cama
);
}
return
BaseResponse
.
okData
(
cama
);
}
@Override
public
BaseResponse
<
PlanTraining
>
update
(
PlanTrainingQuery
planTrainingQuery
)
{
PlanTraining
update
=
new
PlanTraining
();
BeanUtils
.
copyProperties
(
planTrainingQuery
,
update
);
update
.
setId
(
planTrainingQuery
.
getId
());
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
);
}
// @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);
// }
}
cement-business/src/main/java/cn/wise/sc/cement/business/service/impl/QualityApplyServiceImpl.java
View file @
a38e06d8
...
@@ -12,12 +12,7 @@ import cn.wise.sc.cement.business.util.RedisUtil;
...
@@ -12,12 +12,7 @@ import cn.wise.sc.cement.business.util.RedisUtil;
import
com.alibaba.fastjson.JSON
;
import
com.alibaba.fastjson.JSON
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
lombok.Data
;
import
org.apache.poi.ss.usermodel.Header
;
import
org.apache.poi.ss.usermodel.Workbook
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.stereotype.Service
;
import
org.springframework.stereotype.Service
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
java.util.ArrayList
;
import
java.util.ArrayList
;
import
java.util.Date
;
import
java.util.Date
;
...
@@ -117,7 +112,6 @@ public class QualityApplyServiceImpl extends ServiceImpl<QualityApplyMapper, Qua
...
@@ -117,7 +112,6 @@ public class QualityApplyServiceImpl extends ServiceImpl<QualityApplyMapper, Qua
return
;
return
;
}
}
for
(
Integer
projectId
:
projectIds
)
{
for
(
Integer
projectId
:
projectIds
)
{
//找到每个项目的检测组 以检测组归类
//找到每个项目的检测组 以检测组归类
Set
<
Integer
>
teamIds
=
list
.
stream
()
Set
<
Integer
>
teamIds
=
list
.
stream
()
...
...
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