Browse Source

3.2.7 优化

xiaofei 2 năm trước cách đây
mục cha
commit
992d29f53d

+ 15 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/BasicCardRuleDto.java

@@ -0,0 +1,15 @@
+package com.qmth.distributed.print.business.bean.dto;
+
+import com.qmth.distributed.print.business.entity.BasicCardRule;
+import com.qmth.distributed.print.business.enums.ExamNumberStyleEnum;
+import com.qmth.distributed.print.business.enums.PaperTypeEnum;
+import com.qmth.teachcloud.common.entity.SysOrg;
+
+import java.util.List;
+
+/**
+ * @Date: 2021/3/29.
+ */
+public class BasicCardRuleDto extends BasicCardRule {
+
+}

+ 0 - 204
distributed-print-business/src/main/java/com/qmth/distributed/print/business/bean/dto/CardRuleDto.java

@@ -1,204 +0,0 @@
-package com.qmth.distributed.print.business.bean.dto;
-
-import com.qmth.distributed.print.business.enums.ExamNumberStyleEnum;
-import com.qmth.distributed.print.business.enums.PaperTypeEnum;
-import com.qmth.teachcloud.common.entity.SysOrg;
-
-import java.util.List;
-
-/**
- * @Date: 2021/3/29.
- */
-public class CardRuleDto {
-
-    private String id;
-    private String schoolId;
-    private String name;
-    private ExamNumberStyleEnum examNumberStyle;
-
-    private Integer examNumberDigit;
-    private PaperTypeEnum paperType;
-    private Boolean examAbsent;
-    private Boolean writeSign;
-    private Boolean discipline;
-    private String requiredFields;
-    private String extendFields;
-    private String titleRule;
-    private String attention;
-    private String objectiveAttention;
-    private String subjectiveAttention;
-    private Boolean enable;
-    private String remark;
-    private String createId;
-    private Long createTime;
-    private List<SysOrg> orgs;
-    private Integer fillNumber;
-
-    public Integer getFillNumber() {
-        return fillNumber;
-    }
-
-    public void setFillNumber(Integer fillNumber) {
-        this.fillNumber = fillNumber;
-    }
-
-    public String getId() {
-        return id;
-    }
-
-    public void setId(String id) {
-        this.id = id;
-    }
-
-    public String getSchoolId() {
-        return schoolId;
-    }
-
-    public void setSchoolId(String schoolId) {
-        this.schoolId = schoolId;
-    }
-
-    public String getName() {
-        return name;
-    }
-
-    public void setName(String name) {
-        this.name = name;
-    }
-
-    public ExamNumberStyleEnum getExamNumberStyle() {
-        return examNumberStyle;
-    }
-
-    public void setExamNumberStyle(ExamNumberStyleEnum examNumberStyle) {
-        this.examNumberStyle = examNumberStyle;
-    }
-
-    public Integer getExamNumberDigit() {
-        return examNumberDigit;
-    }
-
-    public void setExamNumberDigit(Integer examNumberDigit) {
-        this.examNumberDigit = examNumberDigit;
-    }
-
-    public PaperTypeEnum getPaperType() {
-        return paperType;
-    }
-
-    public void setPaperType(PaperTypeEnum paperType) {
-        this.paperType = paperType;
-    }
-
-    public Boolean getExamAbsent() {
-        return examAbsent;
-    }
-
-    public void setExamAbsent(Boolean examAbsent) {
-        this.examAbsent = examAbsent;
-    }
-
-    public Boolean getWriteSign() {
-        return writeSign;
-    }
-
-    public void setWriteSign(Boolean writeSign) {
-        this.writeSign = writeSign;
-    }
-
-    public Boolean getDiscipline() {
-        return discipline;
-    }
-
-    public void setDiscipline(Boolean discipline) {
-        this.discipline = discipline;
-    }
-
-    public String getRequiredFields() {
-        return requiredFields;
-    }
-
-    public void setRequiredFields(String requiredFields) {
-        this.requiredFields = requiredFields;
-    }
-
-    public String getExtendFields() {
-        return extendFields;
-    }
-
-    public void setExtendFields(String extendFields) {
-        this.extendFields = extendFields;
-    }
-
-    public String getTitleRule() {
-        return titleRule;
-    }
-
-    public void setTitleRule(String titleRule) {
-        this.titleRule = titleRule;
-    }
-
-    public String getAttention() {
-        return attention;
-    }
-
-    public void setAttention(String attention) {
-        this.attention = attention;
-    }
-
-    public String getObjectiveAttention() {
-        return objectiveAttention;
-    }
-
-    public void setObjectiveAttention(String objectiveAttention) {
-        this.objectiveAttention = objectiveAttention;
-    }
-
-    public String getSubjectiveAttention() {
-        return subjectiveAttention;
-    }
-
-    public void setSubjectiveAttention(String subjectiveAttention) {
-        this.subjectiveAttention = subjectiveAttention;
-    }
-
-    public Boolean getEnable() {
-        return enable;
-    }
-
-    public void setEnable(Boolean enable) {
-        this.enable = enable;
-    }
-
-    public String getRemark() {
-        return remark;
-    }
-
-    public void setRemark(String remark) {
-        this.remark = remark;
-    }
-
-    public String getCreateId() {
-        return createId;
-    }
-
-    public void setCreateId(String createId) {
-        this.createId = createId;
-    }
-
-    public Long getCreateTime() {
-        return createTime;
-    }
-
-    public void setCreateTime(Long createTime) {
-        this.createTime = createTime;
-    }
-
-    public List<SysOrg> getOrgs() {
-        return orgs;
-    }
-
-    public void setOrgs(List<SysOrg> orgs) {
-        this.orgs = orgs;
-    }
-}

+ 2 - 4
distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/BasicCardRuleMapper.java

@@ -3,14 +3,12 @@ package com.qmth.distributed.print.business.mapper;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.qmth.distributed.print.business.bean.dto.CardRuleDto;
-import com.qmth.distributed.print.business.bean.params.CardRuleParam;
+import com.qmth.distributed.print.business.bean.dto.BasicCardRuleDto;
 import com.qmth.distributed.print.business.entity.BasicCardRule;
 import com.qmth.teachcloud.common.bean.dto.DataPermissionRule;
 import org.apache.ibatis.annotations.Param;
 
 import java.util.List;
-import java.util.Set;
 
 /**
  * <p>
@@ -22,7 +20,7 @@ import java.util.Set;
  */
 public interface BasicCardRuleMapper extends BaseMapper<BasicCardRule> {
 
-    IPage<CardRuleDto> listPage(Page<CardRuleDto> page, @Param("schoolId") Long schoolId, @Param("enable") Boolean enable, @Param("name") String name, @Param("createStartTime") Long createStartTime, @Param("createEndTime") Long createEndTime, @Param("dpr") DataPermissionRule dpr);
+    IPage<BasicCardRuleDto> listPage(Page<BasicCardRuleDto> page, @Param("schoolId") Long schoolId, @Param("enable") Boolean enable, @Param("name") String name, @Param("createStartTime") Long createStartTime, @Param("createEndTime") Long createEndTime, @Param("dpr") DataPermissionRule dpr);
 
     List<BasicCardRule> list(@Param("schoolId") Long schoolId, @Param("param") String param);
 }

+ 0 - 8
distributed-print-business/src/main/java/com/qmth/distributed/print/business/mapper/ExamTaskApplyTempMapper.java

@@ -1,15 +1,7 @@
 package com.qmth.distributed.print.business.mapper;
 
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
-import com.baomidou.mybatisplus.core.metadata.IPage;
-import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
-import com.qmth.distributed.print.business.bean.dto.CardRuleDto;
-import com.qmth.distributed.print.business.entity.BasicCardRule;
 import com.qmth.distributed.print.business.entity.ExamTaskApplyTemp;
-import org.apache.ibatis.annotations.Param;
-
-import java.util.List;
-import java.util.Set;
 
 /**
  * <p>

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

@@ -2,7 +2,7 @@ package com.qmth.distributed.print.business.service;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.baomidou.mybatisplus.extension.service.IService;
-import com.qmth.distributed.print.business.bean.dto.CardRuleDto;
+import com.qmth.distributed.print.business.bean.dto.BasicCardRuleDto;
 import com.qmth.distributed.print.business.entity.BasicCardRule;
 
 import java.util.List;
@@ -17,7 +17,7 @@ import java.util.List;
  */
 public interface BasicCardRuleService extends IService<BasicCardRule> {
 
-    IPage<CardRuleDto> list(Boolean enable, String name, Long createStartTime, Long createEndTime, Integer pageNumber, Integer pageSize);
+    IPage<BasicCardRuleDto> list(Boolean enable, String name, Long createStartTime, Long createEndTime, Integer pageNumber, Integer pageSize);
 
     List<BasicCardRule> list(String param);
 

+ 23 - 32
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/BasicCardRuleServiceImpl.java

@@ -6,7 +6,7 @@ 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.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
-import com.qmth.distributed.print.business.bean.dto.CardRuleDto;
+import com.qmth.distributed.print.business.bean.dto.BasicCardRuleDto;
 import com.qmth.distributed.print.business.entity.BasicCardRule;
 import com.qmth.distributed.print.business.entity.BasicExamRule;
 import com.qmth.distributed.print.business.entity.ExamCard;
@@ -59,11 +59,11 @@ public class BasicCardRuleServiceImpl extends ServiceImpl<BasicCardRuleMapper, B
     BasicExamRuleService basicExamRuleService;
 
     @Override
-    public IPage<CardRuleDto> list(Boolean enable, String name, Long createStartTime, Long createEndTime, Integer pageNumber, Integer pageSize) {
+    public IPage<BasicCardRuleDto> list(Boolean enable, String name, Long createStartTime, Long createEndTime, Integer pageNumber, Integer pageSize) {
         SysUser requestUser = (SysUser) ServletUtil.getRequestUser();
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
         DataPermissionRule dpr = basicRoleDataPermissionService.findDataPermission(schoolId, requestUser.getId(), ServletUtil.getRequest().getServletPath());
-        IPage<CardRuleDto> cardRuleDtoIPage = this.baseMapper.listPage(new Page<>(pageNumber, pageSize), schoolId, enable, SystemConstant.translateSpecificSign(name), createStartTime, createEndTime, dpr);
+        IPage<BasicCardRuleDto> cardRuleDtoIPage = this.baseMapper.listPage(new Page<>(pageNumber, pageSize), schoolId, enable, SystemConstant.translateSpecificSign(name), createStartTime, createEndTime, dpr);
 
         BasicExamRule basicExamRule = basicExamRuleService.getBySchoolId();
         List<JSONObject> examRuleRequiredFieldList = JSONObject.parseArray(basicExamRule.getRequiredFields(), JSONObject.class);
@@ -93,7 +93,7 @@ public class BasicCardRuleServiceImpl extends ServiceImpl<BasicCardRuleMapper, B
             allExamRuleFieldList.removeAll(removeJsonObject);
         }
 
-        for (CardRuleDto record : cardRuleDtoIPage.getRecords()) {
+        for (BasicCardRuleDto record : cardRuleDtoIPage.getRecords()) {
             List<JSONObject> cardRuleExtendFieldList = JSONObject.parseArray(record.getExtendFields(), JSONObject.class);
             for (JSONObject jsonObject : allExamRuleFieldList) {
                 Optional<JSONObject> objectOptional = cardRuleExtendFieldList.stream().filter(m -> m.getString("code").equals(jsonObject.getString("code"))).findFirst();
@@ -117,78 +117,69 @@ public class BasicCardRuleServiceImpl extends ServiceImpl<BasicCardRuleMapper, B
 
     @Override
     public boolean delete(BasicCardRule cardRule) {
+        // 考试绑定的题卡规则数据
         QueryWrapper<BasicPrintConfig> basicPrintConfigQueryWrapper = new QueryWrapper<>();
         basicPrintConfigQueryWrapper.lambda().eq(BasicPrintConfig::getCardRuleId, cardRule.getId());
         int basicPrintConfigCount = basicPrintConfigService.count(basicPrintConfigQueryWrapper);
+        if (basicPrintConfigCount > 0) {
+            throw ExceptionResultEnum.ERROR.exception("题卡规则已绑定考试,不能删除");
+        }
 
+        // 题卡绑定的题卡规则数据
         QueryWrapper<ExamCard> examCardQueryWrapper = new QueryWrapper<>();
         examCardQueryWrapper.lambda().eq(ExamCard::getCardRuleId, cardRule.getId());
         int examCardCount = examCardService.count(examCardQueryWrapper);
+        if (examCardCount > 0) {
+            throw ExceptionResultEnum.ERROR.exception("题卡规则已绑定题卡,不能删除");
+        }
 
+        // 命题任务绑定的题卡规则数据
         QueryWrapper<ExamTask> examTaskQueryWrapper = new QueryWrapper<>();
         examTaskQueryWrapper.lambda().eq(ExamTask::getCardRuleId, cardRule.getId());
         int examTaskCount = examTaskService.count(examTaskQueryWrapper);
-
-        if (basicPrintConfigCount == 0 && examCardCount == 0 && examTaskCount == 0) {
-            this.removeById(cardRule.getId());
-        } else {
-            throw ExceptionResultEnum.ERROR.exception("题卡规则已绑定数据,不能删除");
+        if (examTaskCount > 0) {
+            throw ExceptionResultEnum.ERROR.exception("题卡规则已绑定命题任务,不能删除");
         }
-        return true;
+
+        return this.removeById(cardRule.getId());
     }
 
     @Transactional
     @Override
     public boolean saveCardRule(BasicCardRule cardRule) {
         Long schoolId = Long.valueOf(ServletUtil.getRequestHeaderSchoolId().toString());
-        cardRule.setSchoolId(schoolId);
         SysUser sysUser = (SysUser) ServletUtil.getRequestUser();
 
-        if (cardRule.getTitleRule().length() > 200) {
-            throw ExceptionResultEnum.ERROR.exception("题卡标题规则长度不能超过200字符");
-        }
-
         QueryWrapper<BasicCardRule> queryWrapper = new QueryWrapper<>();
-        queryWrapper.lambda().eq(BasicCardRule::getSchoolId, cardRule.getSchoolId()).eq(BasicCardRule::getName, cardRule.getName());
+        queryWrapper.lambda().eq(BasicCardRule::getSchoolId, schoolId)
+                .eq(BasicCardRule::getName, cardRule.getName());
         BasicCardRule basicCardRule = this.getOne(queryWrapper);
         boolean isSuccess;
         // 新增
         if (Objects.isNull(cardRule.getId())) {
             if (basicCardRule != null) {
-                throw ExceptionResultEnum.ERROR.exception("题卡规则名称已存在");
+                throw ExceptionResultEnum.ERROR.exception("题卡规则名称已使用");
             }
             cardRule.setId(SystemConstant.getDbUuid());
+            cardRule.setSchoolId(schoolId);
             cardRule.setOrgId(sysUser.getOrgId());
             cardRule.setCreateId(sysUser.getId());
             cardRule.setCreateTime(System.currentTimeMillis());
-            isSuccess = this.save(cardRule);
         }
         // 修改
         else {
             if (basicCardRule != null && basicCardRule.getId().longValue() != cardRule.getId().longValue()) {
-                throw ExceptionResultEnum.ERROR.exception("题卡规则名称已存在");
+                throw ExceptionResultEnum.ERROR.exception("题卡规则名称已使用");
             }
-
             cardRule.setOrgId(sysUser.getOrgId());
             cardRule.setUpdateId(sysUser.getId());
             cardRule.setUpdateTime(System.currentTimeMillis());
-
-            //删除权限
-//            basicTemplateOrgService.removeByRuleId(cardRule.getId());
-            isSuccess = this.updateById(cardRule);
         }
-
-//         新增权限
-//        basicTemplateOrgService.saveBatch(schoolId, TemplateTypeEnum.CARD_RULE, cardRule.getId(), cardRule.getOrgIds(), cardRule.getCreateId());
-        return isSuccess;
+        return this.saveOrUpdate(cardRule);
     }
 
     @Override
     public boolean enable(Long id, Boolean enable) {
-        BasicCardRule basicCardRule = this.getById(id);
-        if (basicCardRule == null) {
-            throw ExceptionResultEnum.ERROR.exception("题卡规则不存在");
-        }
         UpdateWrapper<BasicCardRule> updateWrapper = new UpdateWrapper<>();
         updateWrapper.lambda().set(BasicCardRule::getEnable, enable)
                 .eq(BasicCardRule::getId, id);

+ 2 - 2
distributed-print-business/src/main/java/com/qmth/distributed/print/business/service/impl/BasicExamRuleServiceImpl.java

@@ -188,11 +188,11 @@ public class BasicExamRuleServiceImpl extends ServiceImpl<BasicExamRuleMapper, B
                 oldFieldList.sort(Comparator.comparing(FieldsDto::getCode));
                 newFieldList.sort(Comparator.comparing(FieldsDto::getCode));
 
-                // md5加密
+                // md5加密作比较
                 String md5OldExtends = DigestUtils.md5DigestAsHex(JSONObject.toJSONBytes(oldFieldList));
                 String newOldExtends = DigestUtils.md5DigestAsHex(JSONObject.toJSONBytes(newFieldList));
                 if (!md5OldExtends.equals(newOldExtends)) {
-                    throw ExceptionResultEnum.ERROR.exception("有未结束的印刷计划,不能修改扩展字段");
+                    throw ExceptionResultEnum.ERROR.exception("印刷计划未全部结束,不能修改考务规则");
                 }
             }
             examRule.updateInfo(sysUser.getId());

+ 4 - 0
distributed-print-business/src/main/resources/db/log/脚本-xiaof.sql

@@ -95,3 +95,7 @@ INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence
 INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `enable`, `default_auth`, `front_display`) VALUES ('879', '作废', '/api/admin/exam/task/cancel', 'URL', '42', '8', 'AUTH', '1', '1', '1');
 
 ALTER TABLE `exam_task` ADD COLUMN `cancel_remark` MEDIUMTEXT NULL COMMENT '作废原因' AFTER `paper_name`;
+
+
+-----------------------3.2.7 start 优化需求 2023-06-20----------------------
+ALTER TABLE `basic_card_rule` CHANGE COLUMN `name` `name` VARCHAR(100) NOT NULL COMMENT '题卡规则名称' ;

+ 3 - 3
distributed-print-business/src/main/resources/mapper/BasicCardRuleMapper.xml

@@ -32,17 +32,17 @@
     <sql id="Base_Column_List">
         select id, school_id, name, exam_number_style,exam_number_digit, paper_type, exam_absent, write_sign, discipline, required_fields, extend_fields, title_rule, attention, objective_attention, subjective_attention, enable, remark, create_id, create_time, update_id, update_time, fill_number from basic_card_rule
     </sql>
-    <select id="listPage" resultType="com.qmth.distributed.print.business.bean.dto.CardRuleDto">
+    <select id="listPage" resultType="com.qmth.distributed.print.business.bean.dto.BasicCardRuleDto">
         <include refid="Base_Column_List"></include>
         <where>
             <if test="schoolId != null and schoolId != ''">
                 and school_id = #{schoolId}
             </if>
-            <if test="enable != null and enable != '' or enable == 0">
+            <if test="enable != null and enable != ''">
                 and enable = #{enable}
             </if>
             <if test="name != null and name != ''">
-                and name like concat('%',#{name},'%')
+                and name like concat(#{name},'%')
             </if>
             <if test="createStartTime != null and createStartTime != ''">
                 and create_time >= #{createStartTime}

+ 24 - 23
distributed-print-business/src/main/resources/mapper/ExamCardMapper.xml

@@ -181,28 +181,29 @@
     </select>
     <select id="listPage" resultType="com.qmth.distributed.print.business.bean.dto.ExamCardPageDto">
         select
-        ec.id id,
-        ec.school_id schoolId,
-        ec.org_id orgId,
-        ec.course_code courseCode,
-        ec.course_name courseName,
-        ec.title title,
-        ec.make_method makeMethod,
-        ec.status status,
-        ec.create_id createId,
-        ec.create_time createTime,
-        ec.update_id updateId,
-        ec.update_time updateTime,
-        ec.type type,
-        ec.create_method createMethod,
-        ec.attachment_id attachmentId,
-        ec.sync_status syncStatus,
-        ec.enable enable,
-        ec.used used,
-        ec.remark remark,
-        ec.card_rule_id cardRuleId,
-        ecd.jpg_attachment_info jpgAttachmentInfo
-            from exam_card ec left join exam_card_detail ecd on ec.id = ecd.card_id
+            ec.id id,
+            ec.school_id schoolId,
+            ec.org_id orgId,
+            ec.course_code courseCode,
+            ec.course_name courseName,
+            ec.title title,
+            ec.make_method makeMethod,
+            ec.status status,
+            ec.create_id createId,
+            ec.create_time createTime,
+            ec.update_id updateId,
+            ec.update_time updateTime,
+            ec.type type,
+            ec.create_method createMethod,
+            ec.attachment_id attachmentId,
+            ec.sync_status syncStatus,
+            ec.enable enable,
+            ec.used used,
+            ec.remark remark,
+            ec.card_rule_id cardRuleId,
+            ecd.jpg_attachment_info jpgAttachmentInfo
+        from exam_card ec
+            left join exam_card_detail ecd on ec.id = ecd.card_id
         <where>
             ec.school_id = #{schoolId}
             <if test="cardType != null and cardType != ''">
@@ -214,7 +215,7 @@
             <if test="createMethod != null and createMethod != ''">
                 and ec.create_method = #{createMethod}
             </if>
-            <if test="enable != null and enable != '' or enable == 0">
+            <if test="enable != null and enable != ''">
                 and ec.enable = #{enable}
             </if>
             <if test="createStartTime != null and createStartTime != ''">

+ 10 - 15
distributed-print/src/main/java/com/qmth/distributed/print/api/BasicCardRuleController.java

@@ -3,7 +3,7 @@ package com.qmth.distributed.print.api;
 
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.qmth.boot.api.constant.ApiConstant;
-import com.qmth.distributed.print.business.bean.dto.CardRuleDto;
+import com.qmth.distributed.print.business.bean.dto.BasicCardRuleDto;
 import com.qmth.distributed.print.business.entity.BasicCardRule;
 import com.qmth.distributed.print.business.service.BasicCardRuleService;
 import com.qmth.teachcloud.common.annotation.OperationLogDetail;
@@ -58,7 +58,7 @@ public class BasicCardRuleController {
                        @RequestParam(value = "createEndTime", required = false) Long createEndTime,
                        @RequestParam @Min(SystemConstant.PAGE_NUMBER_MIN) Integer pageNumber,
                        @RequestParam @Min(SystemConstant.PAGE_SIZE_MIN) @Max(SystemConstant.PAGE_SIZE_MAX) Integer pageSize) {
-        IPage<CardRuleDto> cardRuleDtoIPage = basicCardRuleService.list(enable, name, createStartTime, createEndTime, pageNumber, pageSize);
+        IPage<BasicCardRuleDto> cardRuleDtoIPage = basicCardRuleService.list(enable, name, createStartTime, createEndTime, pageNumber, pageSize);
         return ResultUtil.ok(cardRuleDtoIPage);
     }
 
@@ -76,19 +76,18 @@ public class BasicCardRuleController {
     }
 
     /**
-     * 查询单个
+     * 查询详情
      *
      * @param id
      * @return
      */
-    @ApiOperation(value = "查询单个")
+    @ApiOperation(value = "查询详情")
     @RequestMapping(value = "/get_one", method = RequestMethod.POST)
     public Result getOne(@RequestParam(value = "id", required = false) Long id) {
-        if(id == null){
-            throw ExceptionResultEnum.ERROR.exception("");
+        if (id == null) {
+            throw ExceptionResultEnum.ERROR.exception("传参有误,题卡规则ID为空");
         }
-        BasicCardRule cardRule = basicCardRuleService.getById(id);
-        return ResultUtil.ok(cardRule);
+        return ResultUtil.ok(basicCardRuleService.getById(id));
     }
 
     /**
@@ -101,8 +100,7 @@ public class BasicCardRuleController {
     @RequestMapping(value = "/save", method = RequestMethod.POST)
     @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.EDIT)
     public Result save(@RequestBody BasicCardRule cardRule) {
-        boolean isSuccess = basicCardRuleService.saveCardRule(cardRule);
-        return ResultUtil.ok(isSuccess);
+        return ResultUtil.ok(basicCardRuleService.saveCardRule(cardRule));
     }
 
     /**
@@ -115,20 +113,17 @@ public class BasicCardRuleController {
     @RequestMapping(value = "/delete", method = RequestMethod.POST)
     @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.DELETE)
     public Result delete(@RequestBody BasicCardRule cardRule) {
-        boolean isSuccess = basicCardRuleService.delete(cardRule);
-        return ResultUtil.ok(isSuccess);
+        return ResultUtil.ok(basicCardRuleService.delete(cardRule));
     }
 
     /**
      * 启用/禁用
-     *
      */
     @ApiOperation(value = "启用/禁用")
     @RequestMapping(value = "/enable", method = RequestMethod.POST)
     @OperationLogDetail(customizedOperationType = CustomizedOperationTypeEnum.UPDATE)
     public Result enable(@RequestBody BasicCardRule basicCardRule) {
-        boolean isSuccess = basicCardRuleService.enable(basicCardRule.getId(), basicCardRule.getEnable());
-        return ResultUtil.ok(isSuccess);
+        return ResultUtil.ok(basicCardRuleService.enable(basicCardRule.getId(), basicCardRule.getEnable()));
     }
 }
 

+ 3 - 3
distributed-print/src/main/java/com/qmth/distributed/print/api/ExamCardController.java

@@ -53,9 +53,9 @@ public class ExamCardController {
     //====================================通卡接口(start)===================================
 
     /**
-     * 题卡管理(通卡管理)
+     * 题卡管理
      *
-     * @param type            题卡类型(通卡或专卡)
+     * @param cardType        题卡类型(通卡或专卡)
      * @param title           题卡名称模糊查询
      * @param createMethod    题卡创建方式(上传、自定义)
      * @param enable          1正常/0禁用
@@ -233,7 +233,7 @@ public class ExamCardController {
      * 导出题卡pdf,html,json,jpg
      *
      * @param response
-     * @param id 题卡ID
+     * @param id       题卡ID
      */
     @ApiOperation(value = "导出题卡文件")
     @RequestMapping(value = "/download_card", method = RequestMethod.POST)