Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
Z
zlmy-cloud
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
zlmy
zlmy-cloud
Commits
9a718b4b
Commit
9a718b4b
authored
Nov 13, 2025
by
鲁鸿波
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
教育培训补考开发
危险作业撤回开发,监护人签字开发
parent
9bb9b634
Show whitespace changes
Inline
Side-by-side
Showing
36 changed files
with
1121 additions
and
29 deletions
+1121
-29
上线说明.md
zlmy-modules/zlmy-boot/doc/国产化/上线说明.md
+55
-0
THazardWorkPlanController.java
...r/module/hazard/controller/THazardWorkPlanController.java
+18
-0
TrainExaminationManageRetakeController.java
...rd/controller/TrainExaminationManageRetakeController.java
+78
-0
THazardWorkPlanDao.java
...java/com/testor/module/hazard/dao/THazardWorkPlanDao.java
+8
-0
TrainExaminationManageRetakeDao.java
...or/module/hazard/dao/TrainExaminationManageRetakeDao.java
+32
-0
THazardWorkPlan.java
...om/testor/module/hazard/model/domain/THazardWorkPlan.java
+12
-0
TrainExaminationManageRetake.java
...ule/hazard/model/domain/TrainExaminationManageRetake.java
+99
-0
TrainExaminationManageRetakeParam.java
...e/hazard/model/dto/TrainExaminationManageRetakeParam.java
+27
-0
TransferDTO.java
.../java/com/testor/module/hazard/model/dto/TransferDTO.java
+28
-0
THazardWorkPlanService.java
.../testor/module/hazard/service/THazardWorkPlanService.java
+14
-0
TrainExaminationManageRetakeService.java
...e/hazard/service/TrainExaminationManageRetakeService.java
+29
-0
THazardWorkPlanServiceImpl.java
...odule/hazard/service/impl/THazardWorkPlanServiceImpl.java
+90
-4
TrainExaminationManageRetakeServiceImpl.java
...service/impl/TrainExaminationManageRetakeServiceImpl.java
+55
-0
TTrainExaminationManageController.java
...nManage/controller/TTrainExaminationManageController.java
+30
-0
TTrainExaminationManageDao.java
...ain/examinationManage/dao/TTrainExaminationManageDao.java
+9
-0
TTrainExaminationManage.java
...aminationManage/model/domain/TTrainExaminationManage.java
+9
-0
TTrainExaminationManageParam.java
...inationManage/model/dto/TTrainExaminationManageParam.java
+1
-0
TTrainExaminationManageService.java
...inationManage/service/TTrainExaminationManageService.java
+9
-0
TTrainExaminationManageServiceImpl.java
...nage/service/impl/TTrainExaminationManageServiceImpl.java
+5
-0
TTrainMyManagementController.java
...myManagement/controller/TTrainMyManagementController.java
+117
-2
TTrainMyManagementDao.java
.../module/train/myManagement/dao/TTrainMyManagementDao.java
+4
-0
TTrainTestQuestionsExerciseDao.java
...rain/myManagement/dao/TTrainTestQuestionsExerciseDao.java
+17
-0
TTrainMyManagement.java
...e/train/myManagement/model/domain/TTrainMyManagement.java
+5
-0
TTrainTestQuestionsExerciseService.java
...anagement/service/TTrainTestQuestionsExerciseService.java
+29
-0
TTrainTestQuestionsExerciseServiceImpl.java
.../service/impl/TTrainTestQuestionsExerciseServiceImpl.java
+253
-21
TTrainPaperDao.java
...ava/com/testor/module/train/paper/dao/TTrainPaperDao.java
+14
-0
TTrainPaperService.java
...testor/module/train/paper/service/TTrainPaperService.java
+4
-0
TTrainPaperServiceImpl.java
...dule/train/paper/service/impl/TTrainPaperServiceImpl.java
+5
-0
TTrainProject.java
...stor/module/train/project/model/domain/TTrainProject.java
+4
-0
TTrainProjectParam.java
...or/module/train/project/model/dto/TTrainProjectParam.java
+2
-0
TTrainProjectServiceImpl.java
.../train/project/service/impl/TTrainProjectServiceImpl.java
+2
-1
THazardWorkPlan.xml
...boot/src/main/resources/mapper/hazard/THazardWorkPlan.xml
+2
-0
TrainExaminationManageRetakeDao.xml
...sources/mapper/hazard/TrainExaminationManageRetakeDao.xml
+27
-0
TTrainExaminationManage.xml
...apper/train/examinationManage/TTrainExaminationManage.xml
+6
-0
TTrainTestQuestionsExercise.xml
...mapper/train/myManagement/TTrainTestQuestionsExercise.xml
+15
-0
TTrainProject.xml
...src/main/resources/mapper/train/project/TTrainProject.xml
+7
-1
No files found.
zlmy-modules/zlmy-boot/doc/国产化/上线说明.md
View file @
9a718b4b
...
...
@@ -365,3 +365,57 @@ COMMENT ON TABLE public.t_hazard_work_plan_monitoring_record_project IS '危险
COMMENT ON COLUMN public.t_hazard_work_plan_monitoring_record_project.project_name IS '项目名称';
COMMENT ON COLUMN public.t_hazard_work_plan_monitoring_record_project.project_value IS '项目值';
COMMENT ON COLUMN public.t_hazard_work_plan_monitoring_record_project.hazard_work_plan_monitoring_record_id IS '危险作业监测记录表id';
#20251116上线需求
新增表: t_train_examination_manage_retake
ALTER TABLE t_hazard_work_plan ADD revoke_opinion varchar(255) NULL;
COMMENT ON COLUMN t_hazard_work_plan.revoke_opinion IS '作业撤回原因';
ALTER TABLE t_hazard_work_plan ADD guardian_signature varchar(255) NULL;
COMMENT ON COLUMN t_hazard_work_plan.guardian_signature IS '监护人签字';
ALTER TABLE t_train_examination_manage ADD makeup_exam_options varchar(100);
COMMENT ON COLUMN t_train_examination_manage.makeup_exam_options IS '是 否';
ALTER TABLE t_train_project ADD makeup_exam_options varchar(100);
COMMENT ON COLUMN t_train_project.makeup_exam_options IS '是 否';
INSERT INTO "" ("resource_id", "parent_id", "parent_ids", "resource_name", "resource_sort", "resource_level", "resource_type", "is_show", "resource_url", "photo_url", "permission", "status", "create_by", "create_date", "update_by", "update_date", "remarks", "router_mapping", "resource_auth_type") VALUES ('87ce9cacd78b46db95b922efc953e275', '7a3fc3e6d4994eafad5ab08d19ea9b96', '0,ee541d94eceb447691a097a621156463,7a3fc3e6d4994eafad5ab08d19ea9b96,', '补考', '1', '3', '3', '0', 'Training:examinationManage:retake', NULL, 'Training:examinationManage:retake', '0', '9cc5808e84d94064b062526c7e341ba6', '2025-11-12 16:49:16', '9cc5808e84d94064b062526c7e341ba6', '2025-11-12 16:49:16', NULL, NULL, '2');
CREATE TABLE t_train_examination_manage_retake (
id varchar(64) NOT NULL,
exam_start_time datetime,
exam_end_time datetime,
train_examination_manage_id varchar(64),
exam_duration varchar(64),
exam_name varchar(64),
pass_score int(4),
status varchar(1) NULL DEFAULT '0'::varchar,
create_by varchar(64) NULL,
create_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
update_by varchar(64) NULL,
update_date timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP
);
COMMENT ON TABLE t_train_examination_manage_retake IS '考试管理—安全培训教育补考表';
COMMENT ON COLUMN t_train_examination_manage_retake.exam_start_time IS '补考开始时间';
COMMENT ON COLUMN t_train_examination_manage_retake.exam_end_time IS '补考结束时间';
COMMENT ON COLUMN t_train_examination_manage_retake.train_examination_manage_id IS '考试管理—安全培训教育id';
COMMENT ON COLUMN t_train_examination_manage_retake.exam_duration IS '考试时长';
COMMENT ON COLUMN t_train_examination_manage_retake.exam_name IS '考试名称';
COMMENT ON COLUMN t_train_examination_manage_retake.pass_score IS '及格分数';
\ No newline at end of file
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/hazard/controller/THazardWorkPlanController.java
View file @
9a718b4b
...
...
@@ -316,5 +316,23 @@ public class THazardWorkPlanController extends SuperController
}
@ApiOperation
(
value
=
"任务转签"
,
notes
=
"任务转签"
)
@GetMapping
(
value
=
"/transferTask"
)
public
BaseResponse
transferTask
(
TransferDTO
transferDTO
)
throws
BusinessException
{
BaseResponse
<
BizGeneralResponse
>
baseResponse
=
new
BaseResponse
<>();
transferDTO
.
setCurrentUserId
(
getUserId
());
tHazardWorkPlanService
.
transferTask
(
transferDTO
);
baseResponse
.
setMsg
(
"任务转签成功"
);
return
baseResponse
;
}
@ApiOperation
(
value
=
"任务撤回"
,
notes
=
"任务撤回"
)
@PostMapping
(
value
=
"/recallProcess"
)
public
BaseResponse
<
BizGeneralResponse
>
recallProcess
(
@RequestBody
@Valid
CompleteTask
completeTask
){
BaseResponse
<
BizGeneralResponse
>
baseResponse
=
new
BaseResponse
<>();
tHazardWorkPlanService
.
recallProcess
(
completeTask
);
return
baseResponse
;
}
}
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/hazard/controller/TrainExaminationManageRetakeController.java
0 → 100644
View file @
9a718b4b
package
com
.
testor
.
module
.
hazard
.
controller
;
import
com.testor.module.hazard.model.domain.THazardWorkPlan
;
import
com.testor.module.hazard.model.domain.TrainExaminationManageRetake
;
import
com.testor.module.hazard.model.dto.THazardWorkPlanDTO
;
import
com.testor.module.hazard.service.THazardWorkPlanService
;
import
com.testor.module.hazard.service.TrainExaminationManageRetakeService
;
import
com.testor.module.train.paper.model.domain.TTrainPaper
;
import
com.testor.module.train.paper.service.TTrainPaperService
;
import
com.tongtech.tfw.backend.common.biz.models.BaseResponse
;
import
com.tongtech.tfw.backend.core.helper.ObjectHelper
;
import
com.tongtech.tfw.backend.core.helper.StringHelper
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.*
;
import
java.util.List
;
@RestController
@RequestMapping
(
"/manage/retake"
)
@Api
(
value
=
"TrainExaminationManageRetake"
,
tags
=
"考试管理—安全培训教育补考"
)
@Slf4j
public
class
TrainExaminationManageRetakeController
{
@Autowired
private
TrainExaminationManageRetakeService
trainExaminationManageRetakeService
;
@Autowired
private
TTrainPaperService
tTrainPaperService
;
@ApiOperation
(
value
=
"新增 考试管理—安全培训教育补考"
,
notes
=
"Add TrainExaminationManageRetake"
)
@PostMapping
(
value
=
"/insertTrainExaminationManageRetake"
)
public
BaseResponse
<
TrainExaminationManageRetake
>
insertTrainExaminationManageRetake
(
@RequestBody
TrainExaminationManageRetake
addRequest
)
{
BaseResponse
<
TrainExaminationManageRetake
>
baseResponse
=
new
BaseResponse
<>();
if
(
ObjectHelper
.
isNotEmpty
(
addRequest
)){
trainExaminationManageRetakeService
.
insertTrainExaminationManageRetake
(
addRequest
);
}
return
baseResponse
;
}
@ApiOperation
(
value
=
"获取 考试管理—安全培训教育补考 "
,
notes
=
"Get TrainExaminationManageRetake By Id"
)
@GetMapping
(
value
=
"/getByTrainExaminationManageId"
)
public
BaseResponse
<
TrainExaminationManageRetake
>
getByTrainExaminationManageId
(
String
id
){
BaseResponse
<
TrainExaminationManageRetake
>
baseResponse
=
new
BaseResponse
<>();
if
(
StringHelper
.
isNotEmpty
(
id
)){
// TODO 按需求添加业务异常判断
TrainExaminationManageRetake
data
=
trainExaminationManageRetakeService
.
getByTrainExaminationManageId
(
id
);
baseResponse
.
setData
(
data
);
}
return
baseResponse
;
}
@ApiOperation
(
value
=
"修改 考试管理—安全培训教育补考 "
,
notes
=
"Update TrainExaminationManageRetake By Id"
)
@PutMapping
(
value
=
"/update"
)
public
BaseResponse
<
TrainExaminationManageRetake
>
updateEntity
(
@RequestBody
TrainExaminationManageRetake
updateRequest
){
BaseResponse
<
TrainExaminationManageRetake
>
baseResponse
=
new
BaseResponse
<>();
if
(
ObjectHelper
.
isNotEmpty
(
updateRequest
)&&
StringHelper
.
isNotEmpty
(
updateRequest
.
getId
())){
// TODO 按需求添加数据去重,特殊值设定,业务异常
trainExaminationManageRetakeService
.
updateTrainExaminationManageRetake
(
updateRequest
);
}
return
baseResponse
;
}
@ApiOperation
(
value
=
"获取 考试管理—试卷分数 "
,
notes
=
"Get TrainExaminationManageRetake By Id"
)
@GetMapping
(
value
=
"/selectByExaminationManageId"
)
public
BaseResponse
<
List
<
TTrainPaper
>>
selectByExaminationManageId
(
String
id
){
BaseResponse
<
List
<
TTrainPaper
>>
baseResponse
=
new
BaseResponse
<>();
if
(
StringHelper
.
isNotEmpty
(
id
)){
// TODO 按需求添加业务异常判断
baseResponse
.
setData
(
tTrainPaperService
.
selectByExaminationManageId
(
id
));
}
return
baseResponse
;
}
}
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/hazard/dao/THazardWorkPlanDao.java
View file @
9a718b4b
...
...
@@ -7,6 +7,7 @@ import com.tongtech.tfw.backend.common.models.supers.SuperDao;
import
com.tongtech.tfw.workflow.apis.task.model.dto.TodoTask
;
import
com.tongtech.tfw.workflow.apis.task.model.dto.TodoTaskSqlParam
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
import
org.apache.ibatis.annotations.Update
;
/**
...
...
@@ -21,4 +22,11 @@ public interface THazardWorkPlanDao extends SuperDao<THazardWorkPlan>
@Update
(
"UPDATE t_hazard_work_plan SET actual_start_time = NOW() WHERE id = #{id}"
)
void
updateActualStartTime
(
@Param
(
"id"
)
String
id
);
@Update
(
"UPDATE t_hazard_work_plan SET work_status = 1 WHERE code = #{code}"
)
void
updateWorkStatus
(
@Param
(
"code"
)
String
code
);
@Select
(
"SELECT * FROM t_hazard_work_plan WHERE code = #{code} and status = 0"
)
THazardWorkPlan
selectByCode
(
@Param
(
"code"
)
String
code
);
}
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/hazard/dao/TrainExaminationManageRetakeDao.java
0 → 100644
View file @
9a718b4b
package
com
.
testor
.
module
.
hazard
.
dao
;
import
com.testor.module.hazard.model.domain.TrainExaminationManageRetake
;
import
com.tongtech.tfw.backend.common.models.supers.SuperDao
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
import
java.util.List
;
/**
* 考试管理—安全培训教育补考表Mapper接口
*
* @author testor-framework
*/
public
interface
TrainExaminationManageRetakeDao
extends
SuperDao
<
TrainExaminationManageRetake
>
{
/**
* 根据考试管理ID查询考试管理—安全培训教育补考表
* @param trainExaminationManageId
* @return
*/
@Select
(
"SELECT * FROM t_train_examination_manage_retake WHERE train_examination_manage_id = #{trainExaminationManageId}"
)
TrainExaminationManageRetake
getByTrainExaminationManageId
(
@Param
(
"trainExaminationManageId"
)
String
trainExaminationManageId
);
@Select
(
"select * from t_train_examination_manage_retake\n"
+
"where train_examination_manage_id in(\n"
+
"select id from t_train_examination_manage\n"
+
"where paper_id =#{paperId}\n"
+
")"
)
List
<
TrainExaminationManageRetake
>
getByPaperId
(
@Param
(
"paperId"
)
String
paperId
);
}
\ No newline at end of file
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/hazard/model/domain/THazardWorkPlan.java
View file @
9a718b4b
...
...
@@ -298,6 +298,18 @@ public class THazardWorkPlan extends SuperModel
@ApiModelProperty
(
value
=
"作业取消审核意见"
)
@TableField
(
"cancel_opinion"
)
private
String
cancelOpinion
;
/**
* 作业撤回审核意见
*/
@ApiModelProperty
(
value
=
"作业撤回审核意见"
)
@TableField
(
"revoke_opinion"
)
private
String
revokeOpinion
;
@ApiModelProperty
(
value
=
"监护人签字"
)
@TableField
(
"guardian_signature"
)
private
String
guardianSignature
;
public
static
final
String
ID
=
"id"
;
public
static
final
String
WORK_TYPE
=
"work_type"
;
...
...
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/hazard/model/domain/TrainExaminationManageRetake.java
0 → 100644
View file @
9a718b4b
package
com
.
testor
.
module
.
hazard
.
model
.
domain
;
import
java.util.Date
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
import
lombok.NoArgsConstructor
;
import
lombok.experimental.Accessors
;
import
lombok.experimental.SuperBuilder
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.tongtech.tfw.backend.common.models.supers.SuperModel
;
import
org.springframework.format.annotation.DateTimeFormat
;
/**
* 考试管理—安全培训教育补考表对象 t_train_examination_manage_retake
*
* @author testor-framework
*/
@Data
@EqualsAndHashCode
(
callSuper
=
true
)
@Accessors
(
chain
=
true
)
@TableName
(
"t_train_examination_manage_retake"
)
@ApiModel
(
value
=
"TrainExaminationManageRetake对象"
,
description
=
"考试管理—安全培训教育补考表"
)
@SuperBuilder
@AllArgsConstructor
@NoArgsConstructor
public
class
TrainExaminationManageRetake
extends
SuperModel
{
private
static
final
long
serialVersionUID
=
1L
;
/**
* 主键ID
*/
@ApiModelProperty
(
value
=
"主键ID"
)
@TableId
(
"id"
)
private
String
id
;
/**
* 补考开始时间
*/
@ApiModelProperty
(
value
=
"补考开始时间"
)
@TableField
(
"exam_start_time"
)
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
examStartTime
;
/**
* 补考结束时间
*/
@ApiModelProperty
(
value
=
"补考结束时间"
)
@TableField
(
"exam_end_time"
)
@JsonFormat
(
timezone
=
"GMT+8"
,
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
@DateTimeFormat
(
pattern
=
"yyyy-MM-dd HH:mm:ss"
)
private
Date
examEndTime
;
/**
* 考试管理—安全培训教育id
*/
@ApiModelProperty
(
value
=
"考试管理—安全培训教育id"
)
@TableField
(
"train_examination_manage_id"
)
private
String
trainExaminationManageId
;
/**
* 考试时长
*/
@ApiModelProperty
(
value
=
"考试时长"
)
@TableField
(
"exam_duration"
)
private
String
examDuration
;
/**
* 考试名称
*/
@ApiModelProperty
(
value
=
"考试名称"
)
@TableField
(
"exam_name"
)
private
String
examName
;
/**
* 及格分数
*/
@ApiModelProperty
(
value
=
"及格分数"
)
@TableField
(
"pass_score"
)
private
Integer
passScore
;
// 以下字段继承自SuperModel,无需重复定义
// status, create_by, create_date, update_by, update_date
public
static
final
String
ID
=
"id"
;
public
static
final
String
EXAM_START_TIME
=
"exam_start_time"
;
public
static
final
String
EXAM_END_TIME
=
"exam_end_time"
;
public
static
final
String
TRAIN_EXAMINATION_MANAGE_ID
=
"train_examination_manage_id"
;
public
static
final
String
EXAM_DURATION
=
"exam_duration"
;
public
static
final
String
EXAM_NAME
=
"exam_name"
;
public
static
final
String
PASS_SCORE
=
"pass_score"
;
}
\ No newline at end of file
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/hazard/model/dto/TrainExaminationManageRetakeParam.java
0 → 100644
View file @
9a718b4b
package
com
.
testor
.
module
.
hazard
.
model
.
dto
;
import
com.testor.module.hazard.model.domain.TrainExaminationManageRetake
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
import
lombok.EqualsAndHashCode
;
@Data
@ApiModel
(
value
=
"TrainExaminationManageRetakeParam 列表查询参数对象"
)
@EqualsAndHashCode
(
callSuper
=
true
)
public
class
TrainExaminationManageRetakeParam
extends
TrainExaminationManageRetake
{
private
static
final
long
serialVersionUID
=
1L
;
@ApiModelProperty
(
value
=
"每页数量"
)
private
String
limit
;
@ApiModelProperty
(
value
=
"当前页数"
)
private
String
page
;
@ApiModelProperty
(
value
=
"排序字段"
)
private
String
orderBy
;
@ApiModelProperty
(
value
=
"排序方式"
)
private
String
orderType
;
}
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/hazard/model/dto/TransferDTO.java
0 → 100644
View file @
9a718b4b
package
com
.
testor
.
module
.
hazard
.
model
.
dto
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
public
class
TransferDTO
{
@ApiModelProperty
(
value
=
"任务id"
)
private
String
taskId
;
@ApiModelProperty
(
value
=
"新的负责人"
)
private
String
newAssignee
;
@ApiModelProperty
(
value
=
"转移原因"
)
private
String
reason
;
@ApiModelProperty
(
value
=
"当前用户id"
)
private
String
currentUserId
;
@ApiModelProperty
(
value
=
"操作人"
)
private
String
operator
;
@ApiModelProperty
(
value
=
"危险作业计划编码"
)
private
String
code
;
}
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/hazard/service/THazardWorkPlanService.java
View file @
9a718b4b
...
...
@@ -102,4 +102,18 @@ public interface THazardWorkPlanService extends SuperService<THazardWorkPlan> {
*/
String
validateOperation
(
String
workType
,
String
workLevel
,
String
scheduledStartTime
,
String
scheduledEndTime
);
/**
* 任务转签
* @param transferDTO
*/
public
void
transferTask
(
TransferDTO
transferDTO
);
/**
* 任务撤回
* @param processInstanceId 流程实例id
* @param operator 操作人
* @param targetActivityId 目标节点id
*/
public
void
recallProcess
(
CompleteTask
completeTask
);
}
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/hazard/service/TrainExaminationManageRetakeService.java
0 → 100644
View file @
9a718b4b
package
com
.
testor
.
module
.
hazard
.
service
;
import
com.testor.module.hazard.model.domain.THazardWorkPlan
;
import
com.testor.module.hazard.model.domain.TrainExaminationManageRetake
;
import
com.tongtech.tfw.backend.common.models.supers.SuperService
;
public
interface
TrainExaminationManageRetakeService
extends
SuperService
<
TrainExaminationManageRetake
>
{
/**
* 更新考试管理—安全培训教育补考表
* @param trainExaminationManageRetake
*/
void
updateTrainExaminationManageRetake
(
TrainExaminationManageRetake
trainExaminationManageRetake
);
/**
* 新增考试管理—安全培训教育补考表
* @param trainExaminationManageRetake
*/
void
insertTrainExaminationManageRetake
(
TrainExaminationManageRetake
trainExaminationManageRetake
);
/**
* 根据考试管理ID查询考试管理—安全培训教育补考表
* @param trainExaminationManageId
* @return
*/
TrainExaminationManageRetake
getByTrainExaminationManageId
(
String
trainExaminationManageId
);
}
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/hazard/service/impl/THazardWorkPlanServiceImpl.java
View file @
9a718b4b
...
...
@@ -69,10 +69,9 @@ import org.apache.poi.xwpf.usermodel.XWPFDocument;
import
org.apache.poi.xwpf.usermodel.XWPFPictureData
;
import
org.apache.xmlbeans.XmlOptions
;
import
org.flowable.common.engine.api.FlowableObjectNotFoundException
;
import
org.flowable.engine.HistoryService
;
import
org.flowable.engine.IdentityService
;
import
org.flowable.engine.RuntimeService
;
import
org.flowable.engine.TaskService
;
import
org.flowable.engine.*
;
import
org.flowable.engine.history.HistoricProcessInstance
;
import
org.flowable.engine.runtime.ChangeActivityStateBuilder
;
import
org.flowable.engine.runtime.ProcessInstance
;
import
org.flowable.engine.task.Comment
;
import
org.flowable.identitylink.api.IdentityLink
;
...
...
@@ -80,6 +79,7 @@ import org.flowable.idm.api.Group;
import
org.flowable.idm.api.User
;
import
org.flowable.task.api.Task
;
import
org.flowable.task.api.history.HistoricTaskInstance
;
import
org.flowable.variable.api.history.HistoricVariableInstance
;
import
org.openxmlformats.schemas.wordprocessingml.x2006.main.CTBody
;
import
org.quartz.*
;
import
org.springframework.beans.factory.annotation.Autowired
;
...
...
@@ -169,6 +169,10 @@ public class THazardWorkPlanServiceImpl extends SuperServiceImpl<THazardWorkPlan
private
ResourceLoader
resourceLoader
;
@Autowired
private
THazardWorkPlanCheckDao
tHazardWorkPlanCheckDao
;
@Autowired
private
TaskService
taskService
;
// 添加TaskService
@Autowired
private
HistoryService
historyService
;
// 添加HistoryService
@Override
...
...
@@ -860,6 +864,7 @@ public class THazardWorkPlanServiceImpl extends SuperServiceImpl<THazardWorkPlan
return
result
;
}
// 添加时区支持
public
static
double
calculateHoursDifferenceWithZone
(
String
startTime
,
String
endTime
)
{
DateTimeFormatter
formatter
=
DateTimeFormatter
.
ofPattern
(
"yyyy-MM-dd HH:mm:ss"
)
...
...
@@ -2185,4 +2190,85 @@ public class THazardWorkPlanServiceImpl extends SuperServiceImpl<THazardWorkPlan
}
return
queryWrapper
;
}
@Override
public
void
transferTask
(
TransferDTO
request
)
{
try
{
String
taskId
=
request
.
getTaskId
();
String
newAssignee
=
request
.
getNewAssignee
();
String
reason
=
request
.
getReason
();
String
currentUserId
=
request
.
getCurrentUserId
();
// 验证任务是否存在
Task
task
=
taskService
.
createTaskQuery
().
taskId
(
taskId
).
singleResult
();
if
(
task
==
null
)
{
log
.
info
(
"任务不存在或已完成"
);
throw
new
com
.
testor
.
common
.
core
.
exception
.
ServiceException
(
"任务不存在或已完成"
);
}
if
(
task
.
getAssignee
()
!=
null
){
// 权限验证:只有当前负责人可以转签
if
(!
task
.
getAssignee
().
equals
(
currentUserId
)
)
{
log
.
info
(
"无权限转签此任务"
);
throw
new
com
.
testor
.
common
.
core
.
exception
.
ServiceException
(
"无权限转签此任务"
);
}
}
// 验证新负责人
SysUser
newUser
=
sysUserService
.
getById
(
newAssignee
);
if
(
newUser
==
null
)
{
log
.
info
(
"新负责人不存在"
);
throw
new
com
.
testor
.
common
.
core
.
exception
.
ServiceException
(
"新负责人不存在"
);
}
// 记录原负责人
String
originalAssignee
=
task
.
getAssignee
();
// 执行转签
taskService
.
setAssignee
(
taskId
,
newAssignee
);
// 添加转签注释
taskService
.
addComment
(
taskId
,
task
.
getProcessInstanceId
(),
"任务转签: "
+
originalAssignee
+
" → "
+
newAssignee
+
", 原因: "
+
reason
);
log
.
info
(
"任务转签成功: {}"
,
taskId
);
}
catch
(
Exception
e
)
{
log
.
error
(
"转签任务失败: {}"
,
e
.
getMessage
(),
e
);
throw
new
com
.
testor
.
common
.
core
.
exception
.
ServiceException
(
"转签任务失败: "
+
e
.
getMessage
());
}
}
/**
* 撤回流程到上一个节点(或指定节点)
* @param request
*/
@Override
@Transactional
(
rollbackFor
=
Exception
.
class
)
public
void
recallProcess
(
CompleteTask
completeTask
)
{
THazardWorkPlan
byId
=
this
.
getById
(
completeTask
.
getBizId
());
Map
<
String
,
Object
>
vars
=
completeTask
.
getVars
();
String
opinion
=
"作业撤回"
;
if
(
StringHelper
.
isNotEmpty
(
vars
)
&&
StringHelper
.
isNotNull
(
vars
.
get
(
"opinion"
)))
{
opinion
=
(
String
)
vars
.
get
(
"opinion"
);
}
//关闭主流程数据
try
{
if
(
byId
.
getProcessId
()
!=
null
){
ruTaskService
.
stopProcess
(
byId
.
getProcessId
());
}
}
catch
(
FlowableObjectNotFoundException
e
)
{
log
.
error
(
e
.
getMessage
());
}
cancelChildTasks
(
completeTask
);
THazardWorkPlan
tHazardWorkPlan
=
new
THazardWorkPlan
();
tHazardWorkPlan
.
setId
(
completeTask
.
getBizId
());
tHazardWorkPlan
.
setWorkStatus
(
WorkPlanStatusEnum
.
DRAFT
.
getValue
());
tHazardWorkPlan
.
setCancelOpinion
(
opinion
);
this
.
updateById
(
tHazardWorkPlan
);
}
}
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/hazard/service/impl/TrainExaminationManageRetakeServiceImpl.java
0 → 100644
View file @
9a718b4b
package
com
.
testor
.
module
.
hazard
.
service
.
impl
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.testor.module.hazard.dao.THazardWorkPlanDao
;
import
com.testor.module.hazard.dao.TrainExaminationManageRetakeDao
;
import
com.testor.module.hazard.model.domain.THazardWorkPlan
;
import
com.testor.module.hazard.model.domain.TrainExaminationManageRetake
;
import
com.testor.module.hazard.model.dto.THazardWorkPlanParam
;
import
com.testor.module.hazard.model.dto.TrainExaminationManageRetakeParam
;
import
com.testor.module.hazard.model.enums.WorkPlanStatusEnum
;
import
com.testor.module.hazard.service.THazardWorkPlanService
;
import
com.testor.module.hazard.service.TrainExaminationManageRetakeService
;
import
com.testor.module.sys.model.domian.NewSysOrg
;
import
com.tongtech.tfw.backend.common.biz.constants.BizConstants
;
import
com.tongtech.tfw.backend.common.models.supers.SuperServiceImpl
;
import
com.tongtech.tfw.backend.core.helper.ObjectHelper
;
import
com.tongtech.tfw.backend.core.helper.StringHelper
;
import
lombok.extern.slf4j.Slf4j
;
import
org.springframework.stereotype.Service
;
import
java.util.ArrayList
;
import
java.util.Arrays
;
import
java.util.List
;
import
java.util.stream.Collectors
;
@Slf4j
@Service
public
class
TrainExaminationManageRetakeServiceImpl
extends
SuperServiceImpl
<
TrainExaminationManageRetakeDao
,
TrainExaminationManageRetake
>
implements
TrainExaminationManageRetakeService
{
private
QueryWrapper
<
TrainExaminationManageRetake
>
createQuery
(
TrainExaminationManageRetakeParam
queryParam
)
{
QueryWrapper
<
TrainExaminationManageRetake
>
queryWrapper
=
new
QueryWrapper
<>();
if
(
StringHelper
.
isNotEmpty
(
queryParam
.
getTrainExaminationManageId
()))
{
queryWrapper
.
eq
(
"train_examination_manage_id"
,
queryParam
.
getTrainExaminationManageId
());
}
return
queryWrapper
;
}
@Override
public
void
updateTrainExaminationManageRetake
(
TrainExaminationManageRetake
trainExaminationManageRetake
)
{
baseMapper
.
updateById
(
trainExaminationManageRetake
);
}
@Override
public
void
insertTrainExaminationManageRetake
(
TrainExaminationManageRetake
trainExaminationManageRetake
)
{
baseMapper
.
insert
(
trainExaminationManageRetake
);
}
@Override
public
TrainExaminationManageRetake
getByTrainExaminationManageId
(
String
trainExaminationManageId
)
{
return
baseMapper
.
getByTrainExaminationManageId
(
trainExaminationManageId
);
}
}
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/train/examinationManage/controller/TTrainExaminationManageController.java
View file @
9a718b4b
...
...
@@ -20,7 +20,11 @@ import com.testor.biz.sys.user.model.domain.SysUser;
import
com.testor.biz.sys.user.model.dto.SysUserListResponse
;
import
com.testor.biz.sys.user.service.SysUserService
;
import
com.testor.common.util.DateUtil
;
import
com.testor.module.hazard.model.domain.TrainExaminationManageRetake
;
import
com.testor.module.hazard.service.TrainExaminationManageRetakeService
;
import
com.testor.module.train.myManagement.model.domain.TTrainTestQuestionsExercise
;
import
com.testor.module.train.myManagement.service.TTrainMyManagementService
;
import
com.testor.module.train.myManagement.service.TTrainTestQuestionsExerciseService
;
import
com.testor.module.train.project.controller.TTrainProjectScan
;
import
com.tongtech.tfw.backend.common.context.ContextUtils
;
import
com.tongtech.tfw.backend.common.models.sys.UserInfo
;
...
...
@@ -70,6 +74,10 @@ public class TTrainExaminationManageController extends SuperController {
private
SysUserService
sysUserService
;
@Autowired
private
SysDictDataController
sysDictDataController
;
@Autowired
private
TrainExaminationManageRetakeService
trainExaminationManageRetakeService
;
@Autowired
private
TTrainTestQuestionsExerciseService
tTrainTestQuestionsExerciseService
;
/* Generated Method*/
@ApiOperation
(
value
=
"新增 编辑 考试管理—安全培训教育"
,
notes
=
"保存补考记录时parentId传上一个考试的id is_repair 传1 "
)
...
...
@@ -263,6 +271,28 @@ public class TTrainExaminationManageController extends SuperController {
tTrainProjectParams2
.
add
(
tTrainProjectParam
);
}
tTrainProjectParams2
=
tTrainProjectParams2
.
stream
().
sorted
(
Comparator
.
comparing
(
TTrainExaminationManageParam:
:
getCreateDate
).
reversed
()).
collect
(
toList
());
//补考操作状态
//1.可以新增: 未有补考记录
//2.可以修改: 已新增未有补考记录
//3.查看: 已新增有补考记录
for
(
TTrainExaminationManageParam
tTrainProjectParam2
:
tTrainProjectParams2
){
//判断是否设置过补考
TrainExaminationManageRetake
trainExaminationManageRetake
=
trainExaminationManageRetakeService
.
getByTrainExaminationManageId
(
tTrainProjectParam2
.
getId
());
if
(
null
==
trainExaminationManageRetake
){
//没有设置过补考
tTrainProjectParam2
.
setRetakeOperatingStatus
(
"1"
);
}
else
{
//设置过补考,查看是否补考过,补考过只能查看,没有补考过可以修改
// 查询是否有补考数据
List
<
TTrainTestQuestionsExercise
>
retakeExercises
=
tTrainTestQuestionsExerciseService
.
getByExaminationId
(
tTrainProjectParam2
.
getId
(),
null
);
if
(
retakeExercises
.
size
()
>
0
){
//补考过
tTrainProjectParam2
.
setRetakeOperatingStatus
(
"3"
);
}
else
{
tTrainProjectParam2
.
setRetakeOperatingStatus
(
"2"
);
}
}
}
}
BaseResponseList
<
TTrainExaminationManageParam
>
baseResponseList
=
new
BaseResponseList
<>();
baseResponseList
.
setData
(
tTrainProjectParams2
);
...
...
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/train/examinationManage/dao/TTrainExaminationManageDao.java
View file @
9a718b4b
...
...
@@ -6,6 +6,7 @@ import com.testor.module.train.examinationManage.model.domain.TTrainExaminationM
import
com.testor.module.train.examinationManage.model.dto.TTrainExaminationManageParam
;
import
com.tongtech.tfw.backend.common.models.supers.SuperDao
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
import
java.util.List
;
...
...
@@ -19,4 +20,12 @@ public interface TTrainExaminationManageDao extends SuperDao<TTrainExaminationMa
IPage
<
TTrainExaminationManageParam
>
getExamAffiliation
(
Page
<
TTrainExaminationManageParam
>
resultPage
,
@Param
(
"param"
)
TTrainExaminationManageParam
param
,
@Param
(
"parentIds"
)
String
parentIds
,
@Param
(
"orgId"
)
String
orgId
);
List
<
TTrainExaminationManageParam
>
getExamProjectPerson
(
@Param
(
"id"
)
String
id
);
/**
* 查询是否有补考数据
* @return
*/
@Select
(
"select * from t_train_examination_manage\n"
+
"where status = '0' and is_repair = '1' and parent_id = #{id}"
)
List
<
TTrainExaminationManageParam
>
getRepairExaminationManage
(
@Param
(
"id"
)
String
id
);
}
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/train/examinationManage/model/domain/TTrainExaminationManage.java
View file @
9a718b4b
...
...
@@ -177,6 +177,15 @@ public class TTrainExaminationManage extends SuperModel {
@TableField
(
"qr_code"
)
private
String
qrCode
;
@ApiModelProperty
(
value
=
"补考操作状态(1:可以新增;2:可以修改;3:查看)"
)
@TableField
(
exist
=
false
)
private
String
retakeOperatingStatus
;
@ApiModelProperty
(
value
=
"是 否"
)
@TableField
(
"makeup_exam_options"
)
private
String
makeupExamOptions
;
public
static
final
String
ID
=
"id"
;
public
static
final
String
IS_REPAIR
=
"is_repair"
;
public
static
final
String
PARENT_ID
=
"parent_id"
;
...
...
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/train/examinationManage/model/dto/TTrainExaminationManageParam.java
View file @
9a718b4b
package
com
.
testor
.
module
.
train
.
examinationManage
.
model
.
dto
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
com.testor.module.train.examinationManage.model.domain.TTrainExaminationManage
;
import
com.testor.module.train.project.model.dto.MyManagement
;
import
io.swagger.annotations.ApiModel
;
...
...
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/train/examinationManage/service/TTrainExaminationManageService.java
View file @
9a718b4b
...
...
@@ -8,6 +8,7 @@ import com.testor.module.train.examinationManage.model.dto.TTrainExaminationMana
import
com.tongtech.tfw.backend.common.biz.models.BaseResponse
;
import
com.tongtech.tfw.backend.common.biz.models.BizGeneralResponse
;
import
com.tongtech.tfw.backend.common.models.supers.SuperService
;
import
org.apache.ibatis.annotations.Select
;
import
java.util.List
;
import
java.util.Map
;
...
...
@@ -37,4 +38,12 @@ public interface TTrainExaminationManageService extends SuperService<TTrainExami
BaseResponse
<
TTrainExaminationManage
>
randomAdd
(
String
id
)
throws
Exception
;
List
<
TTrainExaminationManageParam
>
getExamProjectPerson
(
String
s
);
/**
* 查询是否有补考数据
* @return
*/
List
<
TTrainExaminationManageParam
>
getRepairExaminationManage
(
String
id
);
}
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/train/examinationManage/service/impl/TTrainExaminationManageServiceImpl.java
View file @
9a718b4b
...
...
@@ -578,4 +578,9 @@ public class TTrainExaminationManageServiceImpl extends SuperServiceImpl<TTrainE
public
List
<
TTrainExaminationManageParam
>
getExamProjectPerson
(
String
s
)
{
return
tTrainExaminationManageDao
.
getExamProjectPerson
(
s
);
}
@Override
public
List
<
TTrainExaminationManageParam
>
getRepairExaminationManage
(
String
id
)
{
return
baseMapper
.
getRepairExaminationManage
(
id
);
}
}
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/train/myManagement/controller/TTrainMyManagementController.java
View file @
9a718b4b
...
...
@@ -10,6 +10,8 @@ import com.testor.biz.sys.org.model.domain.SysOrg;
import
com.testor.biz.sys.org.service.SysOrgService
;
import
com.testor.common.util.DateUtil
;
import
com.testor.common.util.PageUtil
;
import
com.testor.module.hazard.model.domain.TrainExaminationManageRetake
;
import
com.testor.module.hazard.service.TrainExaminationManageRetakeService
;
import
com.testor.module.train.course.dao.TTrainSmallNodeDao
;
import
com.testor.module.train.course.model.domain.TTrainCourse
;
import
com.testor.module.train.course.model.domain.TTrainSection
;
...
...
@@ -25,7 +27,9 @@ import com.testor.module.train.exam.model.domain.TTrainTestQuestions;
import
com.testor.module.train.exam.service.TTrainExamChoiceService
;
import
com.testor.module.train.exam.service.TTrainExamJudgmentService
;
import
com.testor.module.train.exam.service.TTrainTestQuestionsService
;
import
com.testor.module.train.examinationManage.model.dto.TTrainExaminationManageParam
;
import
com.testor.module.train.examinationManage.model.dto.TTrainExaminationManageQueryParam
;
import
com.testor.module.train.examinationManage.service.TTrainExaminationManageService
;
import
com.testor.module.train.myManagement.model.domain.*
;
import
com.testor.module.train.myManagement.model.dto.TTrainMyManagementDelParam
;
import
com.testor.module.train.myManagement.model.dto.TTrainMyManagementParam
;
...
...
@@ -122,6 +126,14 @@ public class TTrainMyManagementController extends SuperController {
@Autowired
private
TTrainSmallNodeDao
tTrainSmallNodeDao
;
@Autowired
private
TrainExaminationManageRetakeService
trainExaminationManageRetakeService
;
@Autowired
private
TTrainExaminationManageService
tTrainExaminationManageService
;
/* Generated Method*/
// @ApiOperation(value = "新增 我的培训教育及考试—安全培训教育", notes = "Add TTrainMyManagement")
// @PostMapping(value = "/add")
...
...
@@ -225,6 +237,13 @@ public class TTrainMyManagementController extends SuperController {
return
testQuestions
;
}
@ApiOperation
(
value
=
"我的考试-开始补考考试 "
,
notes
=
"Get TTrainMyManagement By Id"
)
@GetMapping
(
value
=
"/startExamineRetake"
)
public
BaseResponse
<
ReturnTrainPaper
>
startExamineRetake
(
String
id
)
throws
Exception
{
BaseResponse
<
ReturnTrainPaper
>
testQuestions
=
tTrainTestQuestionsExerciseService
.
startExamineRetake
(
id
);
return
testQuestions
;
}
@ApiOperation
(
value
=
"我的考试-开始考试-提交试卷 "
,
notes
=
"必传个人中心主键id 试题id 选项id"
)
@PostMapping
(
value
=
"/submitTestPaper"
)
public
BaseResponse
<
TTrainTestQuestionsExercise
>
submitTestPaper
(
@RequestBody
List
<
TTrainTestQuestionsExercise
>
questBody
)
throws
Exception
{
...
...
@@ -239,6 +258,13 @@ public class TTrainMyManagementController extends SuperController {
return
testQuestions
;
}
@ApiOperation
(
value
=
"我的考试-补考考试-查看详情 "
,
notes
=
"Get TTrainMyManagement By Id"
)
@GetMapping
(
value
=
"/getTestPaperRetakeDetail"
)
public
BaseResponse
<
ReturnTrainPaper
>
getTestPaperRetakeDetail
(
String
id
)
throws
Exception
{
BaseResponse
<
ReturnTrainPaper
>
testQuestions
=
tTrainTestQuestionsExerciseService
.
getTestPaperRetakeDetail
(
id
);
return
testQuestions
;
}
@ApiOperation
(
value
=
"错题记录-我的培训教育及考试 "
,
notes
=
""
)
@GetMapping
(
value
=
"/errorRecord"
)
...
...
@@ -381,12 +407,101 @@ public class TTrainMyManagementController extends SuperController {
myManagementQueryVo
.
addAll
(
collect
);
baseResponse
.
setData
(
baseResponseList
);
List
<
TTrainMyManagementQueryVO
>
list
=
PageUtil
.
startPage
(
collect
,
Integer
.
valueOf
(
param
.
getPage
()),
Integer
.
valueOf
(
param
.
getLimit
()));
Date
currentTime
=
new
Date
();
for
(
TTrainMyManagementQueryVO
item:
list
){
TrainExaminationManageRetake
trainExaminationManageRetake
=
trainExaminationManageRetakeService
.
getByTrainExaminationManageId
(
item
.
getTaskId
());
if
(
null
!=
trainExaminationManageRetake
){
//判断正式考试成绩是否大于及格线,大于则不让补考
if
(
null
!=
item
.
getTestScore
()
&&
!
""
.
equals
(
item
.
getTestScore
())){
if
(
Double
.
valueOf
(
item
.
getTestScore
())>=
Double
.
valueOf
(
trainExaminationManageRetake
.
getPassScore
())){
item
.
setRepairStatus
(
"2"
);
}
else
{
//判断是否在补考时间内
boolean
isDuringExam
=
currentTime
.
after
(
trainExaminationManageRetake
.
getExamStartTime
())
&&
currentTime
.
before
(
trainExaminationManageRetake
.
getExamEndTime
());
if
(
isDuringExam
){
//判断没有补考过
List
<
TTrainTestQuestionsExercise
>
tTrainTestQuestionsExercises
=
tTrainTestQuestionsExerciseService
.
getByMyIdAndCreateBy
(
item
.
getId
(),
getUserId
());
if
(
tTrainTestQuestionsExercises
.
size
()
==
0
){
item
.
setRepairStatus
(
"1"
);
}
else
{
item
.
setRepairStatus
(
"3"
);
}
}
else
{
item
.
setRepairStatus
(
"2"
);
}
}
}
else
{
//没有成绩
//判断是否在补考时间内
boolean
isDuringExam
=
currentTime
.
after
(
trainExaminationManageRetake
.
getExamStartTime
())
&&
currentTime
.
before
(
trainExaminationManageRetake
.
getExamEndTime
());
if
(
isDuringExam
){
//判断没有补考过
List
<
TTrainTestQuestionsExercise
>
tTrainTestQuestionsExercises
=
tTrainTestQuestionsExerciseService
.
getByMyIdAndCreateBy
(
item
.
getId
(),
getUserId
());
if
(
tTrainTestQuestionsExercises
.
size
()
==
0
){
item
.
setRepairStatus
(
"1"
);
}
else
{
item
.
setRepairStatus
(
"3"
);
}
}
else
{
item
.
setRepairStatus
(
"2"
);
}
}
}
else
{
item
.
setRepairStatus
(
"2"
);
}
}
baseResponseList
.
setData
(
list
);
baseResponseList
.
setTotal
(
collect
.
size
());
baseResponse
.
setData
(
baseResponseList
);
return
baseResponse
;
}
else
{
return
buildList
(
param
);
BaseResponse
<
BaseResponseList
<
TTrainMyManagementQueryVO
>>
baseResponseListBaseResponse
=
buildList
(
param
);
Date
currentTime
=
new
Date
();
for
(
TTrainMyManagementQueryVO
item:
baseResponseListBaseResponse
.
getData
().
getData
()){
TrainExaminationManageRetake
trainExaminationManageRetake
=
trainExaminationManageRetakeService
.
getByTrainExaminationManageId
(
item
.
getTaskId
());
if
(
null
!=
trainExaminationManageRetake
){
//判断正式考试成绩是否大于及格线,大于则不让补考
if
(
null
!=
item
.
getTestScore
()
&&
!
""
.
equals
(
item
.
getTestScore
())){
if
(
Double
.
valueOf
(
item
.
getTestScore
())>=
Double
.
valueOf
(
trainExaminationManageRetake
.
getPassScore
())){
item
.
setRepairStatus
(
"2"
);
}
else
{
//判断是否在补考时间内
boolean
isDuringExam
=
currentTime
.
after
(
trainExaminationManageRetake
.
getExamStartTime
())
&&
currentTime
.
before
(
trainExaminationManageRetake
.
getExamEndTime
());
if
(
isDuringExam
){
//判断没有补考过
List
<
TTrainTestQuestionsExercise
>
tTrainTestQuestionsExercises
=
tTrainTestQuestionsExerciseService
.
getByMyIdAndCreateBy
(
item
.
getId
(),
getUserId
());
if
(
tTrainTestQuestionsExercises
.
size
()
==
0
){
item
.
setRepairStatus
(
"1"
);
}
else
{
item
.
setRepairStatus
(
"3"
);
}
}
else
{
item
.
setRepairStatus
(
"2"
);
}
}
}
else
{
//没有成绩
//判断是否在补考时间内
boolean
isDuringExam
=
currentTime
.
after
(
trainExaminationManageRetake
.
getExamStartTime
())
&&
currentTime
.
before
(
trainExaminationManageRetake
.
getExamEndTime
());
if
(
isDuringExam
){
//判断没有补考过
List
<
TTrainTestQuestionsExercise
>
tTrainTestQuestionsExercises
=
tTrainTestQuestionsExerciseService
.
getByMyIdAndCreateBy
(
item
.
getId
(),
getUserId
());
if
(
tTrainTestQuestionsExercises
.
size
()
==
0
){
item
.
setRepairStatus
(
"1"
);
}
else
{
item
.
setRepairStatus
(
"3"
);
}
}
else
{
item
.
setRepairStatus
(
"2"
);
}
}
}
else
{
item
.
setRepairStatus
(
"2"
);
}
}
return
baseResponseListBaseResponse
;
}
}
/* Long page = Long.valueOf(param.getPage());
...
...
@@ -458,7 +573,7 @@ public class TTrainMyManagementController extends SuperController {
item
.
setCurrentStatus
(
"3"
);
tTrainMyManagementService
.
update
(
new
UpdateWrapper
<
TTrainMyManagement
>()
.
eq
(
TTrainMyManagement
.
ID
,
item
.
getId
()).
set
(
TTrainMyManagement
.
CURRENT_STATUS
,
item
.
getCurrentStatus
()));
if
(
StringHelper
.
isEmpty
(
item
.
getTestScore
()))
{
if
(
StringHelper
.
isEmpty
(
item
.
getTestScore
())
&&
StringHelper
.
isEmpty
(
item
.
getRepairTest
())
)
{
item
.
setPercentage
(
"2"
);
}
}
...
...
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/train/myManagement/dao/TTrainMyManagementDao.java
View file @
9a718b4b
...
...
@@ -10,6 +10,7 @@ import com.testor.module.train.project.model.stat.TrainProjectUserDetailStat;
import
com.testor.module.train.project.model.stat.TrainProjectUserStat
;
import
com.tongtech.tfw.backend.common.models.supers.SuperDao
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
import
java.util.List
;
...
...
@@ -32,4 +33,7 @@ public interface TTrainMyManagementDao extends SuperDao<TTrainMyManagement> {
List
<
TrainProjectUserDetailStat
>
findTrainListState
(
@Param
(
"userId"
)
String
userId
,
@Param
(
"tabStatus"
)
String
tabStatus
);
@Select
(
"select * from t_train_my_management where id=#{id} and parent_id!=null"
)
TTrainMyManagement
getDetail
(
@Param
(
"id"
)
String
id
);
}
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/train/myManagement/dao/TTrainTestQuestionsExerciseDao.java
View file @
9a718b4b
...
...
@@ -6,6 +6,9 @@ import com.testor.module.train.myManagement.model.domain.TTrainTestQuestionsExer
import
com.testor.module.train.myManagement.model.dto.TTrainTestQuestionsExerciseParam
;
import
com.tongtech.tfw.backend.common.models.supers.SuperDao
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
import
java.util.List
;
/**
* 我的试题练习、考试—安全培训教育Mapper接口
...
...
@@ -15,4 +18,18 @@ import org.apache.ibatis.annotations.Param;
*/
public
interface
TTrainTestQuestionsExerciseDao
extends
SuperDao
<
TTrainTestQuestionsExercise
>
{
IPage
<
TTrainTestQuestionsExercise
>
errorRecord
(
Page
<
TTrainTestQuestionsExercise
>
resultPage
,
@Param
(
"param"
)
TTrainTestQuestionsExerciseParam
param
,
@Param
(
"userId"
)
String
userId
);
/**
* 根据考试id查询补考记录
* @param id 考试id
* @param userId 用户id
* @return
*/
List
<
TTrainTestQuestionsExercise
>
getByExaminationId
(
@Param
(
"id"
)
String
id
,
@Param
(
"userId"
)
String
userId
);
@Select
(
"select * from t_train_test_questions_exercise\n"
+
"where my_id = #{id} and create_by = #{createBy} and status = '0' and parent_id is not null"
)
List
<
TTrainTestQuestionsExercise
>
getByMyIdAndCreateBy
(
@Param
(
"id"
)
String
id
,
@Param
(
"createBy"
)
String
createBy
);
}
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/train/myManagement/model/domain/TTrainMyManagement.java
View file @
9a718b4b
...
...
@@ -221,6 +221,11 @@ public class TTrainMyManagement extends SuperModel
@ApiModelProperty
(
value
=
"考试时长"
)
@TableField
(
"exam_duration"
)
private
String
examDuration
;
@ApiModelProperty
(
value
=
"补考状态(1:可以补考 2:不可以补考 3:已补考)"
)
@TableField
(
exist
=
false
)
private
String
repairStatus
;
public
static
final
String
ID
=
"id"
;
public
static
final
String
PARENT_ID
=
"parent_id"
;
public
static
final
String
PERSON_ID
=
"person_id"
;
...
...
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/train/myManagement/service/TTrainTestQuestionsExerciseService.java
View file @
9a718b4b
...
...
@@ -11,6 +11,8 @@ import com.tongtech.tfw.backend.common.biz.models.BaseResponse;
import
com.tongtech.tfw.backend.common.biz.models.BaseResponseList
;
import
com.tongtech.tfw.backend.common.biz.models.BizGeneralResponse
;
import
com.tongtech.tfw.backend.common.models.supers.SuperService
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
import
java.util.List
;
...
...
@@ -36,4 +38,31 @@ public interface TTrainTestQuestionsExerciseService extends SuperService<TTrainT
BaseResponse
<
TTrainTestQuestionsExercise
>
submitTestPaper
(
List
<
TTrainTestQuestionsExercise
>
questBody
)
throws
Exception
;
BaseResponse
<
ReturnTrainPaper
>
getTestPaperDetail
(
String
id
)
throws
Exception
;
/**
* 开始补考考试
* @param id
* @return
* @throws Exception
*/
BaseResponse
<
ReturnTrainPaper
>
startExamineRetake
(
String
id
)
throws
Exception
;
/**
* 根据考试id查询补考记录
* @param parentId
* @return
*/
List
<
TTrainTestQuestionsExercise
>
getByExaminationId
(
String
id
,
String
userId
);
/**
* 获取补考考试详情
* @param id
* @return
* @throws Exception
*/
BaseResponse
<
ReturnTrainPaper
>
getTestPaperRetakeDetail
(
String
id
)
throws
Exception
;
List
<
TTrainTestQuestionsExercise
>
getByMyIdAndCreateBy
(
String
id
,
String
createBy
);
}
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/train/myManagement/service/impl/TTrainTestQuestionsExerciseServiceImpl.java
View file @
9a718b4b
...
...
@@ -5,12 +5,15 @@ import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import
com.baomidou.mybatisplus.core.metadata.IPage
;
import
com.baomidou.mybatisplus.extension.plugins.pagination.Page
;
import
com.testor.common.util.DateUtil
;
import
com.testor.module.hazard.dao.TrainExaminationManageRetakeDao
;
import
com.testor.module.hazard.model.domain.TrainExaminationManageRetake
;
import
com.testor.module.train.exam.model.domain.TTrainExamChoice
;
import
com.testor.module.train.exam.model.domain.TTrainExamJudgment
;
import
com.testor.module.train.exam.model.domain.TTrainTestQuestions
;
import
com.testor.module.train.exam.service.TTrainExamChoiceService
;
import
com.testor.module.train.exam.service.TTrainExamJudgmentService
;
import
com.testor.module.train.exam.service.TTrainTestQuestionsService
;
import
com.testor.module.train.myManagement.dao.TTrainMyManagementDao
;
import
com.testor.module.train.myManagement.dao.TTrainTestQuestionsExerciseDao
;
import
com.testor.module.train.myManagement.model.domain.TTrainMyManagement
;
import
com.testor.module.train.myManagement.model.domain.TTrainTestQuestionsExercise
;
...
...
@@ -41,9 +44,7 @@ import org.springframework.stereotype.Service;
import
java.time.LocalDateTime
;
import
java.time.format.DateTimeFormatter
;
import
java.util.ArrayList
;
import
java.util.Comparator
;
import
java.util.List
;
import
java.util.*
;
import
java.util.concurrent.atomic.AtomicInteger
;
import
java.util.stream.Collectors
;
...
...
@@ -72,6 +73,12 @@ public class TTrainTestQuestionsExerciseServiceImpl extends SuperServiceImpl<TTr
@Autowired
private
TTrainPaperService
tTrainPaperService
;
@Autowired
private
TTrainMyManagementDao
tTrainMyManagementDao
;
@Autowired
private
TrainExaminationManageRetakeDao
trainExaminationManageRetakeDao
;
@Override
public
BaseResponse
<
TTrainTestQuestionsExercise
>
saveClose
(
List
<
TTrainTestQuestionsExercise
>
questBody
)
throws
Exception
{
...
...
@@ -269,6 +276,119 @@ public class TTrainTestQuestionsExerciseServiceImpl extends SuperServiceImpl<TTr
//得到已经做过的题目
List
<
TTrainTestQuestionsExercise
>
list
=
this
.
list
(
new
QueryWrapper
<
TTrainTestQuestionsExercise
>()
.
eq
(
TTrainTestQuestionsExercise
.
MY_ID
,
myid
)
.
eq
(
TTrainTestQuestionsExercise
.
PERSON_ID
,
loginUser
.
getUserId
()).
isNull
(
TTrainTestQuestionsExercise
.
PARENT_ID
)
);
for
(
TestQuestionsContent
test
:
testQuestionsContents
)
{
for
(
TTrainTestQuestionsExercise
tTrain
:
list
)
{
if
(
test
.
getId
().
equals
(
tTrain
.
getTestQuestionsId
()))
{
test
.
setIsSelect
(
"1"
);
test
.
setIsCorrect
(
tTrain
.
getIsCorrect
());
if
(
StringHelper
.
isNotEmpty
(
tTrain
.
getOptionsId
()))
{
String
[]
split
=
tTrain
.
getOptionsId
().
split
(
","
);
for
(
Options
option
:
test
.
getOptions
())
{
for
(
String
s
:
split
)
{
if
(
option
.
getId
().
equals
(
s
))
{
option
.
setIsSelect
(
"1"
);
}
}
}
}
}
}
}
List
<
TestQuestionsContent
>
collect
=
testQuestionsContents
.
stream
().
sorted
(
Comparator
.
comparing
(
TestQuestionsContent:
:
getDictKey
).
reversed
()).
collect
(
Collectors
.
toList
());
AtomicInteger
num
=
new
AtomicInteger
(
1
);
collect
.
stream
().
forEach
(
item
->{
item
.
setTestQuestionsContent
(
num
.
getAndIncrement
()
+
"."
+
item
.
getTestQuestionsContent
());
});
return
collect
;
}
private
List
<
TestQuestionsContent
>
getAllTestRetake
(
List
<
TTrainTestQuestions
>
records
,
String
myid
)
{
// 试卷中的所有试题
List
<
TestQuestionsContent
>
testQuestionsContents
=
new
ArrayList
<>();
// int num = 0;
for
(
TTrainTestQuestions
tTrainTestQuestions
:
records
)
{
String
testQuestionsType
=
tTrainTestQuestions
.
getTestQuestionsType
();
//试题id
String
questionsId
=
tTrainTestQuestions
.
getId
();
// num++;
if
(
"SELECT"
.
equals
(
testQuestionsType
)
||
"MORE_SELECT"
.
equals
(
testQuestionsType
))
{
// 每一个题目
TestQuestionsContent
testQuestionsContent
=
BeanHelper
.
beanToBean
(
tTrainTestQuestions
,
TestQuestionsContent
.
class
);
QueryWrapper
<
TTrainExamChoice
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
TTrainExamChoice
.
TEST_QUESTIONS_ID
,
questionsId
);
// 当前题目包含的所有选项
List
<
TTrainExamChoice
>
list1
=
tTrainExamChoiceService
.
list
(
wrapper
);
// 按照选项排序
list1
=
list1
.
stream
().
sorted
(
Comparator
.
comparing
(
TTrainExamChoice:
:
getOptions
))
.
collect
(
Collectors
.
toList
());
List
<
Options
>
optionsList
=
new
ArrayList
<>();
for
(
TTrainExamChoice
tTrainExamChoice
:
list1
)
{
Options
options
=
BeanHelper
.
beanToBean
(
tTrainExamChoice
,
Options
.
class
);
String
optionsTest
=
options
.
getOptions
()
+
": "
+
options
.
getOptionText
();
options
.
setOptionText
(
optionsTest
);
optionsList
.
add
(
options
);
}
String
testQuestionsContent1
=
testQuestionsContent
.
getTestQuestionsContent
();
testQuestionsContent
.
setTestQuestionsContent
(
testQuestionsContent1
);
testQuestionsContent
.
setOptions
(
optionsList
);
String
score
=
""
;
TTrainMyManagement
management
=
tTrainMyManagementService
.
getById
(
myid
);
String
testPaperId
=
management
.
getTestPaperId
();
if
(
StringHelper
.
isNotEmpty
(
testPaperId
))
{
TTrainPaper
trainPaper
=
tTrainPaperService
.
getById
(
testPaperId
);
if
(
"SELECT"
.
equals
(
testQuestionsType
))
{
score
=
"(单选题、"
+
trainPaper
.
getSingleScore
()
+
"分)"
;
}
if
(
"MORE_SELECT"
.
equals
(
testQuestionsType
))
{
score
=
"(多选题、"
+
trainPaper
.
getMoreScore
()
+
"分)"
;
}
}
testQuestionsContent
.
setScore
(
score
);
testQuestionsContent
.
setDictKey
(
testQuestionsType
);
testQuestionsContents
.
add
(
testQuestionsContent
);
}
if
(
"JUDGE"
.
equals
(
testQuestionsType
))
{
// 每一个题目
TestQuestionsContent
testQuestionsContent
=
BeanHelper
.
beanToBean
(
tTrainTestQuestions
,
TestQuestionsContent
.
class
);
QueryWrapper
<
TTrainExamJudgment
>
wrapper
=
new
QueryWrapper
<>();
wrapper
.
eq
(
TTrainExamJudgment
.
TEST_QUESTIONS_ID
,
questionsId
);
// 当前题目包含的所有选项
List
<
TTrainExamJudgment
>
list1
=
tTrainExamJudgmentService
.
list
(
wrapper
);
// 按照选项排序
list1
=
list1
.
stream
().
sorted
(
Comparator
.
comparing
(
TTrainExamJudgment:
:
getOptions
))
.
collect
(
Collectors
.
toList
());
List
<
Options
>
optionsList
=
new
ArrayList
<>();
for
(
TTrainExamJudgment
tTrainExamChoice
:
list1
)
{
Options
options
=
BeanHelper
.
beanToBean
(
tTrainExamChoice
,
Options
.
class
);
String
optionsTest
=
options
.
getOptions
()
+
": "
+
options
.
getOptionText
();
options
.
setOptionText
(
optionsTest
);
optionsList
.
add
(
options
);
}
String
testQuestionsContent1
=
testQuestionsContent
.
getTestQuestionsContent
();
testQuestionsContent
.
setTestQuestionsContent
(
testQuestionsContent1
);
testQuestionsContent
.
setOptions
(
optionsList
);
String
score
=
""
;
TTrainMyManagement
management
=
tTrainMyManagementService
.
getById
(
myid
);
String
testPaperId
=
management
.
getTestPaperId
();
if
(
StringHelper
.
isNotEmpty
(
testPaperId
))
{
TTrainPaper
trainPaper
=
tTrainPaperService
.
getById
(
testPaperId
);
if
(
"JUDGE"
.
equals
(
testQuestionsType
))
{
score
=
"(判断题、"
+
trainPaper
.
getJudgeScore
()
+
"分)"
;
}
}
testQuestionsContent
.
setScore
(
score
);
testQuestionsContent
.
setDictKey
(
testQuestionsType
);
testQuestionsContents
.
add
(
testQuestionsContent
);
}
}
UserInfo
loginUser
=
ContextUtils
.
getLoginUser
();
//得到已经做过的题目
List
<
TTrainTestQuestionsExercise
>
list
=
this
.
list
(
new
QueryWrapper
<
TTrainTestQuestionsExercise
>()
.
eq
(
TTrainTestQuestionsExercise
.
PARENT_ID
,
myid
)
.
eq
(
TTrainTestQuestionsExercise
.
PERSON_ID
,
loginUser
.
getUserId
())
);
for
(
TestQuestionsContent
test
:
testQuestionsContents
)
{
...
...
@@ -353,6 +473,10 @@ public class TTrainTestQuestionsExerciseServiceImpl extends SuperServiceImpl<TTr
// 保存所有试题id
List
<
String
>
list
=
new
ArrayList
<>();
String
MYID
=
""
;
String
parentId
=
""
;
if
(
ObjectHelper
.
isNotEmpty
(
questBody
.
get
(
0
).
getMyId
())){
parentId
=
questBody
.
get
(
0
).
getParentId
();
}
for
(
TTrainTestQuestionsExercise
tTrain
:
questBody
)
{
TTrainTestQuestionsExercise
tTrainTest
=
BeanHelper
.
beanToBean
(
tTrain
,
TTrainTestQuestionsExercise
.
class
);
tTrainTest
.
setPersonId
(
loginUser
.
getUserId
());
...
...
@@ -373,19 +497,25 @@ public class TTrainTestQuestionsExerciseServiceImpl extends SuperServiceImpl<TTr
exercises
.
add
(
tTrainTest
);
}
TTrainMyManagement
management
=
tTrainMyManagementService
.
getById
(
MYID
);
if
(
parentId
==
null
||
""
.
equals
(
parentId
)){
if
(
"1"
.
equals
(
management
.
getIsAddExam
()))
{
throw
new
BusinessException
(
"请勿重复考试"
);
}
// 获取已存在的题目
}
// 正式考的时候删除
if
(
null
==
parentId
){
this
.
remove
(
new
QueryWrapper
<
TTrainTestQuestionsExercise
>()
.
in
(
TTrainTestQuestionsExercise
.
TEST_QUESTIONS_ID
,
list
)
.
eq
(
TTrainTestQuestionsExercise
.
MY_ID
,
MYID
)
.
eq
(
TTrainTestQuestionsExercise
.
PERSON_ID
,
loginUser
.
getUserId
()));
}
boolean
result
=
this
.
saveBatch
(
exercises
);
if
(
result
)
{
// 保存成功进行批卷处理
markTestPaper
(
MYID
);
markTestPaper
(
MYID
,
parentId
);
}
}
return
exerciseBaseResponse
;
...
...
@@ -434,12 +564,98 @@ public class TTrainTestQuestionsExerciseServiceImpl extends SuperServiceImpl<TTr
return
baseResponse
;
}
@Override
public
BaseResponse
<
ReturnTrainPaper
>
startExamineRetake
(
String
id
)
throws
Exception
{
BaseResponse
<
ReturnTrainPaper
>
baseResponse
=
new
BaseResponse
<>();
if
(
StringHelper
.
isNotEmpty
(
id
))
{
// 获取考试计划(如果没有补考记录就代表可以补考)
TTrainMyManagement
management
=
tTrainMyManagementDao
.
getDetail
(
id
);
if
(
null
==
management
){
// 获取考试计划
management
=
tTrainMyManagementService
.
getById
(
id
);
if
(
ObjectHelper
.
isEmpty
(
management
))
{
return
baseResponse
;
}
}
String
testPaperId
=
management
.
getTestPaperId
();
if
(
StringHelper
.
isNotEmpty
(
testPaperId
))
{
ReturnTrainPaper
returnTrainPaper
=
new
ReturnTrainPaper
();
TTrainPaper
trainPaper
=
tTrainPaperService
.
getById
(
testPaperId
);
String
[]
testQuestionsId
=
trainPaper
.
getTestQuestionsId
().
split
(
","
);
List
<
TTrainTestQuestions
>
questions
=
tTrainTestQuestionsService
.
list
(
new
QueryWrapper
<
TTrainTestQuestions
>()
.
in
(
TTrainTestQuestions
.
ID
,
testQuestionsId
)
.
ne
(
TTrainTestQuestions
.
STATUS
,
BizConstants
.
STATUS_DELETE
)
);
List
<
TestQuestionsContent
>
allTest
=
getAllTest
(
questions
,
id
);
returnTrainPaper
.
setPassScore
(
trainPaper
.
getPassScore
());
returnTrainPaper
.
setFullScore
(
trainPaper
.
getFullScore
());
returnTrainPaper
.
setTestPaperName
(
trainPaper
.
getTestPaperName
());
returnTrainPaper
.
setTestQuestionsContent
(
allTest
);
baseResponse
.
setData
(
returnTrainPaper
);
}
}
return
baseResponse
;
}
@Override
public
List
<
TTrainTestQuestionsExercise
>
getByExaminationId
(
String
id
,
String
userId
)
{
return
baseMapper
.
getByExaminationId
(
id
,
userId
);
}
@Override
public
BaseResponse
<
ReturnTrainPaper
>
getTestPaperRetakeDetail
(
String
id
)
throws
Exception
{
BaseResponse
<
ReturnTrainPaper
>
baseResponse
=
new
BaseResponse
<>();
if
(
StringHelper
.
isNotEmpty
(
id
))
{
// 获取考试计划
TTrainMyManagement
management
=
tTrainMyManagementService
.
getById
(
id
);
if
(
ObjectHelper
.
isEmpty
(
management
))
{
return
baseResponse
;
}
String
testPaperId
=
management
.
getTestPaperId
();
if
(
StringHelper
.
isNotEmpty
(
testPaperId
))
{
ReturnTrainPaper
returnTrainPaper
=
new
ReturnTrainPaper
();
TTrainPaper
trainPaper
=
tTrainPaperService
.
getById
(
testPaperId
);
String
[]
testQuestionsId
=
trainPaper
.
getTestQuestionsId
().
split
(
","
);
List
<
TTrainTestQuestions
>
questions
=
tTrainTestQuestionsService
.
list
(
new
QueryWrapper
<
TTrainTestQuestions
>()
.
in
(
TTrainTestQuestions
.
ID
,
testQuestionsId
)
.
ne
(
TTrainTestQuestions
.
STATUS
,
BizConstants
.
STATUS_DELETE
)
);
List
<
TestQuestionsContent
>
allTest
=
getAllTestRetake
(
questions
,
id
);
// 获取答题正确和错误的数量
AtomicInteger
trueNum
=
new
AtomicInteger
();
AtomicInteger
falseNum
=
new
AtomicInteger
();
allTest
.
stream
().
forEach
(
item
->{
if
(
"1"
.
equals
(
item
.
getIsCorrect
())
&&
"1"
.
equals
(
item
.
getIsSelect
()))
{
trueNum
.
getAndIncrement
();
}
if
(
"0"
.
equals
(
item
.
getIsCorrect
())
&&
"1"
.
equals
(
item
.
getIsSelect
())){
falseNum
.
getAndIncrement
();
}
});
returnTrainPaper
.
setTrueNum
(
String
.
valueOf
(
trueNum
));
returnTrainPaper
.
setFalseNum
(
String
.
valueOf
(
falseNum
));
returnTrainPaper
.
setPassScore
(
trainPaper
.
getPassScore
());
returnTrainPaper
.
setFullScore
(
trainPaper
.
getFullScore
());
returnTrainPaper
.
setTestPaperName
(
trainPaper
.
getTestPaperName
());
returnTrainPaper
.
setTestScore
(
management
.
getRepairTest
());
returnTrainPaper
.
setTestQuestionsContent
(
allTest
);
baseResponse
.
setData
(
returnTrainPaper
);
}
}
return
baseResponse
;
}
@Override
public
List
<
TTrainTestQuestionsExercise
>
getByMyIdAndCreateBy
(
String
id
,
String
createBy
)
{
return
baseMapper
.
getByMyIdAndCreateBy
(
id
,
createBy
);
}
/**
* 个人中心主键id
* 进行批改试卷处理
* @param myid
*/
public
void
markTestPaper
(
String
myid
)
throws
Exception
{
public
void
markTestPaper
(
String
myid
,
String
parentId
)
throws
Exception
{
// 获取一条考试计划
TTrainMyManagement
trainMyManagement
=
tTrainMyManagementService
.
getById
(
myid
);
// 获取试卷id
...
...
@@ -453,9 +669,15 @@ public class TTrainTestQuestionsExerciseServiceImpl extends SuperServiceImpl<TTr
.
ne
(
TTrainTestQuestions
.
STATUS
,
BizConstants
.
STATUS_DELETE
)
);
// 获取试卷中的所有试题
List
<
TestQuestionsContent
>
allTest
=
getAllTest
(
questions
,
myid
);
List
<
TestQuestionsContent
>
allTest
=
new
ArrayList
<>();
if
(
null
==
parentId
){
allTest
=
getAllTest
(
questions
,
myid
);
}
else
{
allTest
=
getAllTestRetake
(
questions
,
parentId
);
}
// 试卷分数汇总并保存考试分数
saveTestScore
(
allTest
,
trainPaper
,
myid
);
saveTestScore
(
allTest
,
trainPaper
,
myid
,
parentId
);
}
}
...
...
@@ -465,7 +687,7 @@ public class TTrainTestQuestionsExerciseServiceImpl extends SuperServiceImpl<TTr
* @param trainPaper 试卷的详细信息
* @param myid 个人中心主键id
*/
private
void
saveTestScore
(
List
<
TestQuestionsContent
>
allTest
,
TTrainPaper
trainPaper
,
String
myid
)
throws
Exception
{
private
void
saveTestScore
(
List
<
TestQuestionsContent
>
allTest
,
TTrainPaper
trainPaper
,
String
myid
,
String
parentId
)
throws
Exception
{
AtomicInteger
score
=
new
AtomicInteger
();
allTest
.
stream
().
forEach
(
item
->{
if
(
"SELECT"
.
equals
(
item
.
getDictKey
())
&&
"1"
.
equals
(
item
.
getIsCorrect
()))
{
...
...
@@ -489,12 +711,22 @@ public class TTrainTestQuestionsExerciseServiceImpl extends SuperServiceImpl<TTr
}
else
{
percentage
=
"2"
;
}
boolean
update
=
tTrainMyManagementService
.
update
(
new
UpdateWrapper
<
TTrainMyManagement
>()
boolean
update
=
true
;
//parentId不为空时代表补考,否则为正常考试
if
(
null
==
parentId
||
""
.
equals
(
parentId
)){
update
=
tTrainMyManagementService
.
update
(
new
UpdateWrapper
<
TTrainMyManagement
>()
.
eq
(
TTrainMyManagement
.
ID
,
myid
)
.
set
(
TTrainMyManagement
.
TEST_SCORE
,
sum
)
.
set
(
TTrainMyManagement
.
IS_ADD_EXAM
,
"1"
)
.
set
(
TTrainMyManagement
.
PERCENTAGE
,
percentage
)
);
.
set
(
TTrainMyManagement
.
PERCENTAGE
,
percentage
));
}
else
{
update
=
tTrainMyManagementService
.
update
(
new
UpdateWrapper
<
TTrainMyManagement
>()
.
eq
(
TTrainMyManagement
.
ID
,
myid
)
.
set
(
TTrainMyManagement
.
REPAIR_TEST
,
sum
)
.
set
(
TTrainMyManagement
.
PERCENTAGE
,
percentage
));
}
if
(!
update
)
{
throw
new
BusinessException
(
"更新考试成绩失败"
);
}
...
...
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/train/paper/dao/TTrainPaperDao.java
View file @
9a718b4b
...
...
@@ -2,6 +2,11 @@ package com.testor.module.train.paper.dao;
import
com.testor.module.train.paper.model.domain.TTrainPaper
;
import
com.tongtech.tfw.backend.common.models.supers.SuperDao
;
import
org.apache.ibatis.annotations.Param
;
import
org.apache.ibatis.annotations.Select
;
import
java.util.List
;
/**
* 试卷管理——安全教育培训Mapper接口
*
...
...
@@ -10,4 +15,13 @@ import com.tongtech.tfw.backend.common.models.supers.SuperDao;
*/
public
interface
TTrainPaperDao
extends
SuperDao
<
TTrainPaper
>
{
@Select
(
"select * from t_train_paper\n"
+
"where id in(\n"
+
"select paper_id from t_train_examination_manage\n"
+
"where id = #{examinationManageId}\n"
+
")"
)
List
<
TTrainPaper
>
selectByExaminationManageId
(
@Param
(
"examinationManageId"
)
String
examinationManageId
);
}
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/train/paper/service/TTrainPaperService.java
View file @
9a718b4b
...
...
@@ -9,6 +9,7 @@ import com.testor.module.train.paper.model.dto.TTrainPaperParam;
import
com.tongtech.tfw.backend.common.biz.models.BaseResponse
;
import
com.tongtech.tfw.backend.common.biz.models.BizGeneralResponse
;
import
com.tongtech.tfw.backend.common.models.supers.SuperService
;
import
org.apache.ibatis.annotations.Param
;
import
java.util.List
;
...
...
@@ -33,4 +34,7 @@ public interface TTrainPaperService extends SuperService<TTrainPaper> {
BaseResponse
<
TTrainPaperParam
>
getByIds
(
String
id
)
throws
Exception
;
String
getTestPaperName
(
String
testPaperId
);
List
<
TTrainPaper
>
selectByExaminationManageId
(
String
examinationManageId
);
}
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/train/paper/service/impl/TTrainPaperServiceImpl.java
View file @
9a718b4b
...
...
@@ -303,4 +303,9 @@ public class TTrainPaperServiceImpl extends SuperServiceImpl<TTrainPaperDao, TTr
}
return
trainPaper
.
getTestPaperName
();
}
@Override
public
List
<
TTrainPaper
>
selectByExaminationManageId
(
String
examinationManageId
)
{
return
baseMapper
.
selectByExaminationManageId
(
examinationManageId
);
}
}
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/train/project/model/domain/TTrainProject.java
View file @
9a718b4b
...
...
@@ -223,6 +223,10 @@ public class TTrainProject extends SuperModel {
@TableField
(
"train_type"
)
private
String
trainType
;
@ApiModelProperty
(
value
=
"是 否"
)
@TableField
(
"makeup_exam_options"
)
private
String
makeupExamOptions
;
// @ApiModelProperty(value = "是否线上培训 1 线上 0 线下")
// @TableField("is_online")
...
...
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/train/project/model/dto/TTrainProjectParam.java
View file @
9a718b4b
...
...
@@ -82,4 +82,6 @@ public class TTrainProjectParam extends TTrainProject {
private
ProjectScoreStatVo
scoreStatByProjectId
;
}
zlmy-modules/zlmy-boot/src/main/java/com/testor/module/train/project/service/impl/TTrainProjectServiceImpl.java
View file @
9a718b4b
...
...
@@ -132,7 +132,8 @@ public class TTrainProjectServiceImpl extends SuperServiceImpl<TTrainProjectDao,
examinationManageParam
.
setMyManagements
(
list
);
examinationManageParam
.
setExamDuration
(
addRequest
.
getExamDuration
()).
setExamEndTime
(
addRequest
.
getExamEndTime
())
.
setExamName
(
addRequest
.
getExamName
()).
setExamSite
(
addRequest
.
getExamSite
()).
setExamStartTime
(
addRequest
.
getExamStartTime
())
.
setExamType
(
addRequest
.
getVisitType
()).
setExamWay
(
addRequest
.
getExamType
()).
setPaperId
(
addRequest
.
getTestPaperId
());
.
setExamType
(
addRequest
.
getVisitType
()).
setExamWay
(
addRequest
.
getExamType
()).
setPaperId
(
addRequest
.
getTestPaperId
())
.
setMakeupExamOptions
(
addRequest
.
getMakeupExamOptions
());
// 考试计划id
examId
=
tTrainExaminationManageService
.
addEntity
(
examinationManageParam
).
getData
();
...
...
zlmy-modules/zlmy-boot/src/main/resources/mapper/hazard/THazardWorkPlan.xml
View file @
9a718b4b
...
...
@@ -31,6 +31,8 @@
<id
column=
"work_site_responsible_end_signature"
property=
"workSiteResponsibleEndSignature"
/>
<id
column=
"org_id"
property=
"orgId"
/>
<id
column=
"cancel_opinion"
property=
"cancelOpinion"
/>
<id
column=
"revoke_opinion"
property=
"revokeOpinion"
/>
<id
column=
"guardian_signature"
property=
"guardianSignature"
/>
</resultMap>
<select
id=
"selectToDoList"
resultType=
"com.tongtech.tfw.workflow.apis.task.model.dto.TodoTask"
>
SELECT DISTINCT
...
...
zlmy-modules/zlmy-boot/src/main/resources/mapper/hazard/TrainExaminationManageRetakeDao.xml
0 → 100644
View file @
9a718b4b
<?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=
"com.testor.module.hazard.dao.TrainExaminationManageRetakeDao"
>
<!-- 通用查询映射结果 -->
<resultMap
id=
"BaseResultMap"
type=
"com.testor.module.hazard.model.domain.TrainExaminationManageRetake"
>
<id
column=
"id"
property=
"id"
/>
<result
column=
"exam_start_time"
property=
"examStartTime"
/>
<result
column=
"exam_end_time"
property=
"examEndTime"
/>
<result
column=
"train_examination_manage_id"
property=
"trainExaminationManageId"
/>
<result
column=
"exam_duration"
property=
"examDuration"
/>
<result
column=
"exam_name"
property=
"examName"
/>
<result
column=
"pass_score"
property=
"passScore"
/>
<!-- SuperModel中的字段 -->
<result
column=
"status"
property=
"status"
/>
<result
column=
"create_by"
property=
"createBy"
/>
<result
column=
"create_date"
property=
"createDate"
/>
<result
column=
"update_by"
property=
"updateBy"
/>
<result
column=
"update_date"
property=
"updateDate"
/>
</resultMap>
<!-- 通用查询结果列 -->
<sql
id=
"Base_Column_List"
>
id, exam_start_time, exam_end_time, train_examination_manage_id, exam_duration, exam_name, pass_score, status, create_by, create_date, update_by, update_date
</sql>
</mapper>
\ No newline at end of file
zlmy-modules/zlmy-boot/src/main/resources/mapper/train/examinationManage/TTrainExaminationManage.xml
View file @
9a718b4b
...
...
@@ -24,6 +24,7 @@
<id
column=
"tenant_id"
property=
"tenantId"
/>
<id
column=
"process_id"
property=
"processId"
/>
<id
column=
"process_status"
property=
"processStatus"
/>
<id
column=
"makeup_exam_options"
property=
"makeupExamOptions"
/>
</resultMap>
<select
id=
"getExamAffiliation"
parameterType=
"com.testor.module.train.examinationManage.model.dto.TTrainExaminationManageParam"
...
...
@@ -43,6 +44,7 @@
, p.org_id
, p.qr_code
, p.create_date
,p.makeup_exam_options
-- , my.person_affiliation
-- , my.company
-- , my.exam_duration
...
...
@@ -91,6 +93,7 @@
, p1.org_id
, p1.qr_code
, p1.create_date
, p1.makeup_exam_options
from t_train_examination_manage p1
where id in (
select id
...
...
@@ -106,6 +109,7 @@
, p.org_id
, p.qr_code
, p.create_date
, p.makeup_exam_options
from t_train_examination_manage p
left join t_train_my_management my
on p.id = my.task_id
...
...
@@ -152,6 +156,7 @@
, p.org_id
, p.qr_code
, p.create_date
, p.makeup_exam_options
, my.person_affiliation
, my.company
, my.exam_duration
...
...
@@ -169,6 +174,7 @@
, org_id
, qr_code
, create_date
, makeup_exam_options
from t_train_examination_manage where id = #{id} ) p
join t_train_my_management my on p.id = my.task_id
</select>
...
...
zlmy-modules/zlmy-boot/src/main/resources/mapper/train/myManagement/TTrainTestQuestionsExercise.xml
View file @
9a718b4b
...
...
@@ -25,4 +25,19 @@
on e.test_questions_id = t.id
where e.is_correct = '0' and e.person_id=#{userId}
</select>
<select
id=
"getByExaminationId"
resultType=
"com.testor.module.train.myManagement.model.domain.TTrainTestQuestionsExercise"
>
select * from t_train_test_questions_exercise
where test_questions_id in(
select test_questions_id from t_train_paper
where id in(
select paper_id from t_train_examination_manage where id = #{id} and status = '0')
)
and status ='0' and parent_id is not null
<if
test=
"userId != null and userId != ''"
>
and create_by = #{userId}
</if>
</select>
</mapper>
\ No newline at end of file
zlmy-modules/zlmy-boot/src/main/resources/mapper/train/project/TTrainProject.xml
View file @
9a718b4b
...
...
@@ -28,6 +28,7 @@
<!-- <id column="company" property="company"/>-->
<id
column=
"process_status"
property=
"processStatus"
/>
<id
column=
"train_type"
property=
"trainType"
/>
<id
column=
"makeup_exam_options"
property=
"makeupExamOptions"
/>
</resultMap>
<select
id=
"getAffiliation"
parameterType=
"com.testor.module.train.project.model.dto.TTrainProjectParam"
resultType=
"com.testor.module.train.project.model.dto.TTrainProjectParam"
databaseId=
"mysql"
>
...
...
@@ -45,6 +46,7 @@
, p.org_id
, p.create_date
, p.train_type
, p.makeup_exam_options
from t_train_project p
left join t_train_my_management my
on p.id = my.task_id
...
...
@@ -90,7 +92,8 @@
org_name ,
org_id ,
create_date ,
train_type
train_type ,
makeup_exam_options
FROM
t_train_project
WHERE
...
...
@@ -109,6 +112,7 @@
, p.org_id
, p.create_date
, p.train_type
, p.makeup_exam_options
from t_train_project p
left join t_train_my_management my
on p.id = my.task_id
...
...
@@ -156,6 +160,7 @@
, p.org_id
, p.create_date
, p.train_type
, p.makeup_exam_options
, my.person_affiliation
, my.company
, my.id as myManagementId
...
...
@@ -174,6 +179,7 @@
, create_date
, course_id
, train_type
, makeup_exam_options
from t_train_project
where id = #{id}) p
join t_train_my_management my on p.id = my.task_id
...
...
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