xiaof vor 3 Jahren
Ursprung
Commit
8f96fa75dc

+ 9 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/PrintTaskDto.java

@@ -23,6 +23,7 @@ public class PrintTaskDto {
     private Long printStartTime;
     private Long printEndTime;
     private String packageCode;
+    private Boolean normal;
 
     public String getExamDetailId() {
         return examDetailId;
@@ -167,4 +168,12 @@ public class PrintTaskDto {
     public void setPackageCode(String packageCode) {
         this.packageCode = packageCode;
     }
+
+    public Boolean getNormal() {
+        return normal;
+    }
+
+    public void setNormal(Boolean normal) {
+        this.normal = normal;
+    }
 }

+ 14 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/entity/ExamDetail.java

@@ -101,8 +101,14 @@ public class ExamDetail extends BaseEntity implements Serializable {
     @TableField("attachment_path")
     private String attachmentPath;
 
+    @ApiModelProperty(value = "来源")
+    @TableField("exam_data_source")
     private ExamDataSourceEnum examDataSource;
 
+    @ApiModelProperty(value = "是否正常,true正常,false做废")
+    @TableField("normal")
+    private Boolean normal;
+
     public Long getSchoolId() {
         return schoolId;
     }
@@ -274,4 +280,12 @@ public class ExamDetail extends BaseEntity implements Serializable {
     public void setExamDataSource(ExamDataSourceEnum examDataSource) {
         this.examDataSource = examDataSource;
     }
+
+    public Boolean getNormal() {
+        return normal;
+    }
+
+    public void setNormal(Boolean normal) {
+        this.normal = normal;
+    }
 }

+ 2 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/ExamDetailService.java

@@ -195,4 +195,6 @@ public interface ExamDetailService extends IService<ExamDetail> {
     List<ExamDetail> listByCourseCodeAndPaperNumber(Long schoolId, String courseCode, String paperNumber);
 
     List<ExamDetailCourse> listSyncPaperNumberByPrintPlanId(Long printPlanId);
+
+    boolean taskNormal(ExamDetail examDetail);
 }

+ 8 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamDetailServiceImpl.java

@@ -456,6 +456,7 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
             examDetail.setExamStartTime(SystemConstant.convertIdToLong(examStartTime));
             examDetail.setExamEndTime(SystemConstant.convertIdToLong(examEndTime));
             examDetail.setExamDataSource(ExamDataSourceEnum.FILE_IMPORT);
+            examDetail.setNormal(true);
             examDetail.setCreateId(userId);
             examDetail.setUpdateId(userId);
             examDetailList.add(examDetail);
@@ -772,6 +773,13 @@ public class ExamDetailServiceImpl extends ServiceImpl<ExamDetailMapper, ExamDet
         return this.baseMapper.listSyncPaperNumberByPrintPlanId(printPlanId);
     }
 
+    @Override
+    public boolean taskNormal(ExamDetail examDetail) {
+        UpdateWrapper<ExamDetail> updateWrapper = new UpdateWrapper<>();
+        updateWrapper.lambda().set(ExamDetail::getNormal, examDetail.getNormal()).eq(ExamDetail::getId, examDetail.getId());
+        return this.update(updateWrapper);
+    }
+
     @Transactional(rollbackFor = Exception.class)
     @Override
     public void deleteExaminationData(Long printPlanId, ExamDataSourceEnum source) {

+ 1 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/ExamTaskPrintServiceImpl.java

@@ -172,6 +172,7 @@ public class ExamTaskPrintServiceImpl extends ServiceImpl<ExamTaskPrintMapper, E
             examDetail.setExamStartTime(examTaskPrint.getExamStartTime());
             examDetail.setExamEndTime(examTaskPrint.getExamEndTime());
             examDetail.setExamDataSource(ExamDataSourceEnum.EXAM_TASK);
+            examDetail.setNormal(true);
             examDetail.setCreateId(examTaskPrint.getCreateId());
             examDetail.setCreateTime(System.currentTimeMillis());
             examDetailService.save(examDetail);

+ 0 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/templete/service/impl/TaskLogicServiceImpl.java

@@ -727,8 +727,6 @@ public class TaskLogicServiceImpl implements TaskLogicService {
                         .thenComparing(ExaminationImportDto::getExamRoom)
         );
 
-        System.out.println(JSON.toJSONString(examinationImportDtoList));
-
         // 校验课程代码和试卷编号在印刷计划下是1对1的关系
         List<String> paperNumberList = examinationImportDtoList.stream().map(ExaminationImportDto::getPaperNumber).distinct().collect(Collectors.toList());
         for (String paperNumber : paperNumberList) {

+ 2 - 1
distributed-print-business/src/main/resources/mapper/ExamDetailMapper.xml

@@ -44,7 +44,8 @@
             b.status,
             b.validate,
             b.print_start_time printStartTime,
-            b.print_end_time printEndTime
+            b.print_end_time printEndTime,
+            b.normal
         FROM
             exam_print_plan a
                  JOIN

+ 31 - 117
distributed-print-business/src/main/resources/mapper/ExamTaskMapper.xml

@@ -151,44 +151,44 @@
     </select>
     <select id="listTaskApply" resultType="com.qmth.distributed.print.business.bean.dto.ExamTaskDto">
         SELECT
-        a.id,
-        a.school_id schoolId,
-        a.course_code courseCode,
-        a.course_name courseName,
-        a.specialty,
-        a.paper_number paperNumber,
-        a.card_rule_id cardRuleId,
-        CASE a.card_rule_id
-        WHEN - 1 THEN '全部通卡'
-        ELSE b.name
-        END cardRuleName,
-        a.user_id userId,
-        c.real_name userName,
-        a.start_time startTime,
-        a.end_time endTime,
-        a.status,
-        a.teacher_name teacherName,
-        a.lecturer_name lecturerName,
-        d.name teachingRoomName,
-        e.status  auditStatus,
-        a.enable,
-        a.create_id createId,
-        a.create_time createTime,
-        e.setup,
-        a.flow_id flowId
+            a.id,
+            a.school_id schoolId,
+            a.course_code courseCode,
+            a.course_name courseName,
+            a.specialty,
+            a.paper_number paperNumber,
+            a.card_rule_id cardRuleId,
+            CASE a.card_rule_id
+            WHEN - 1 THEN '全部通卡'
+            ELSE b.name
+            END cardRuleName,
+            a.user_id userId,
+            c.real_name userName,
+            a.start_time startTime,
+            a.end_time endTime,
+            a.status,
+            a.teacher_name teacherName,
+            a.lecturer_name lecturerName,
+            d.name teachingRoomName,
+            e.status  auditStatus,
+            a.enable,
+            a.create_id createId,
+            a.create_time createTime,
+            e.setup,
+            a.flow_id flowId
         FROM
-        exam_task a
+            exam_task a
         LEFT JOIN
-        basic_card_rule b ON a.card_rule_id = b.id
+            basic_card_rule b ON a.card_rule_id = b.id
         LEFT JOIN
-        sys_user c ON a.user_id = c.id
+            sys_user c ON a.user_id = c.id
         LEFT JOIN
-        sys_org d ON a.teaching_room_id = d.id
+            sys_org d ON a.teaching_room_id = d.id
         LEFT JOIN
-        t_f_flow_approve e ON a.flow_id = e.flow_id
+            t_f_flow_approve e ON a.flow_id = e.flow_id
         <where>
             a.enable = true
-            and (a.status = 'STAGE' or (a.status = 'SUBMIT' and e.status = 'REJECT'))
+            and (a.status = 'STAGE' or (a.status = 'SUBMIT' and e.status is not null and e.status != 'FINISH'))
             <if test="userId != null and userId != ''">
                 and a.user_id = #{userId}
             </if>
@@ -307,92 +307,6 @@
                 </foreach>
             </if>
         </where>
-        union all
-        SELECT
-        a.id,
-        a.school_id schoolId,
-        a.course_code courseCode,
-        a.course_name courseName,
-        a.specialty,
-        a.paper_number paperNumber,
-        a.card_rule_id cardRuleId,
-        case a.card_rule_id when -1 then '全部通卡' else b.name end cardRuleName,
-        a.user_id userId,
-        c.real_name userName,
-        d.real_name createName,
-        a.start_time startTime,
-        a.end_time endTime,
-        a.enable,
-        a.create_id createId,
-        a.create_time createTime,
-        a.status,
-        a.flow_id flowId,
-        f.setup,
-        f.status as auditStatus,
-        f.status as flowStatus,
-        a.teacher_name teacherName,
-        a.lecturer_name lecturerName,
-        so.name teachingRoomName,
-        false as myself
-        FROM
-        exam_task a
-        LEFT JOIN
-        basic_card_rule b ON a.card_rule_id = b.id
-        LEFT JOIN
-        sys_user c ON a.user_id = c.id
-        LEFT JOIN
-        sys_user d ON a.create_id = d.id
-        LEFT JOIN
-        exam_task_paper_log e ON a.id = e.exam_task_id AND e.review = false
-        LEFT JOIN
-        t_f_flow_approve f ON a.flow_id = f.flow_id
-        LEFT JOIN
-        sys_org so ON a.teaching_room_id = so.id
-        <where>
-            a.enable = true
-            AND a.review = true
-            AND a.status = 'SUBMIT' and (f.status = 'AUDITING' or f.status = 'REJECT')
-            and EXISTS(
-            select * from(
-            <include refid="findFlowIdToNotMySelfSql" />
-            ) t where t.flowId = a.flow_id)
-            <if test="schoolId != null and schoolId != ''">
-                and a.school_id = #{schoolId}
-            </if>
-            <if test="courseCode != null and courseCode != ''">
-                and a.course_code = #{courseCode}
-            </if>
-            <if test="paperNumber != null and paperNumber != ''">
-                and a.paper_number = #{paperNumber}
-            </if>
-            <if test="userId != null and userId != ''">
-                and a.user_id = #{userId}
-            </if>
-            <if test="cardRuleId != null and cardRuleId != ''">
-                and a.card_rule_id = #{cardRuleId}
-            </if>
-            <if test="startTime != null and startTime != ''">
-                and a.start_time &gt;= #{startTime}
-            </if>
-            <if test="endTime != null and endTime != ''">
-                and a.start_time &lt;= #{endTime}
-            </if>
-            <if test="startCreateTime != null and startCreateTime > 0">
-                and a.create_time >= #{startCreateTime}
-            </if>
-            <if test="endCreateTime != null and endCreateTime > 0">
-                and #{endCreateTime} >= a.create_time
-            </if>
-            <if test="createName != null and createName != ''">
-                and d.real_name like concat('%',#{createName},'%')
-            </if>
-            <if test="orgIds != null">
-                AND d.org_id IN
-                <foreach collection="orgIds" item="item" index="index" open="(" separator="," close=")">
-                    #{item}
-                </foreach>
-            </if>
-        </where>
         ) t
         order by t.createTime desc
     </select>

+ 13 - 0
distributed-print/src/main/java/com/qmth/distributed/print/api/ExamPrintPlanController.java

@@ -330,5 +330,18 @@ public class ExamPrintPlanController {
         return Objects.nonNull(tbTask) ? ResultUtil.ok(new EditResult(tbTask.getId())) : ResultUtil.error("创建任务失败");
     }
 
+    /**
+     * 印刷任务做废、恢复
+     *
+     * @param examDetail
+     * @return
+     */
+    @ApiOperation(value = "印刷任务管理-做废/恢复")
+    @RequestMapping(value = "/task_normal", method = RequestMethod.POST)
+    public Result taskNormal(@RequestBody ExamDetail examDetail) {
+        boolean isSuccess = examDetailService.taskNormal(examDetail);
+        return ResultUtil.ok(isSuccess);
+    }
+
 }