Browse Source

Merge remote-tracking branch 'origin/dev_v3.3.1' into dev_v3.3.1

wangliang 1 year ago
parent
commit
682a898ca4

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

@@ -92,6 +92,12 @@ public class BasicCardRule extends BaseEntity implements Serializable {
      */
     @TableField("extend_fields")
     private String extendFields;
+
+    /**
+     * 变量信息填充字段
+     */
+    @TableField("fill_fields")
+    private String fillFields;
     /**
      * 题卡标题规则
      */
@@ -257,6 +263,14 @@ public class BasicCardRule extends BaseEntity implements Serializable {
         this.extendFields = extendFields;
     }
 
+    public String getFillFields() {
+        return fillFields;
+    }
+
+    public void setFillFields(String fillFields) {
+        this.fillFields = fillFields;
+    }
+
     public String getTitleRule() {
         return titleRule;
     }

+ 17 - 0
distributed-print-business/src/main/java/com/qmth/distributed/print/business/util/pdf/CreatePdfNewUtil.java

@@ -843,6 +843,23 @@ public class CreatePdfNewUtil {
                     }
                 }
             }
+        } else if (ExamNumberStyleEnum.FILL.equals(basicCardRule.getExamNumberStyle())) {
+            String fillFields = basicCardRule.getFillFields();
+            if (StringUtils.isNotBlank(fillFields)) {
+                if (examStudent != null) {
+                    // 根据题卡规则必选字段,替换相应值,没有则“”
+                    List<StudentExtendDto> studentExtendDtos = createExtendObject(examDetail, examStudent, basicCardRule);
+                    if (CollectionUtils.isNotEmpty(studentExtendDtos)) {
+                        for (String s : fillFields.split(",")) {
+                            Optional<StudentExtendDto> extendDto = studentExtendDtos.stream().filter(m -> m.getFieldName().equals(s)).findFirst();
+                            if (extendDto.isPresent()) {
+                                StudentExtendDto studentExtendDto = extendDto.get();
+                                studentHtml = studentHtml.replaceAll("\\$\\{" + studentExtendDto.getFieldName() + "\\}", String.valueOf(studentExtendDto.getValue()));
+                            }
+                        }
+                    }
+                }
+            }
         }
 
         studentHtml = studentHtml.replaceAll("\\$\\{packageCodeDom\\}", "");

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

@@ -17,6 +17,7 @@
         <result column="undertaking_body" property="undertakingBody" />
         <result column="required_fields" property="requiredFields" />
         <result column="extend_fields" property="extendFields" />
+        <result column="fill_fields" property="fillFields" />
         <result column="title_rule" property="titleRule" />
         <result column="attention" property="attention" />
         <result column="objective_attention" property="objectiveAttention" />
@@ -32,7 +33,7 @@
 
     <!-- 通用查询结果列 -->
     <sql id="Base_Column_List">
-        select id, school_id, name, exam_number_style,exam_number_digit, paper_type, exam_absent, write_sign, discipline,undertaking_enable, undertaking_body,required_fields, extend_fields, title_rule,first_level_subheading,second_level_subheading, attention, objective_attention, subjective_attention, enable, remark, create_id, create_time, update_id, update_time, fill_number from basic_card_rule
+        select id, school_id, name, exam_number_style,exam_number_digit, paper_type, exam_absent, write_sign, discipline,undertaking_enable, undertaking_body,required_fields, extend_fields,fill_fields, title_rule,first_level_subheading,second_level_subheading, 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.entity.BasicCardRule">
         <include refid="Base_Column_List"></include>

+ 2 - 1
distributed-print/install/mysql/upgrade/3.3.1.sql

@@ -772,6 +772,7 @@ ALTER TABLE t_r_basic_info MODIFY COLUMN teaching_object varchar(1000) NULL COMM
 INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `enable`, `default_auth`, `front_display`) VALUES ('1139', '轨迹图查询题卡内容', '/api/admin/mark/track/getCard', 'URL', '946', '12', 'AUTH', '1', '1', '1');
 UPDATE `sys_privilege` SET `related` = '953,954,955,956,957,958,959,960,969,1139' WHERE (`id` = '950');
 
+ALTER TABLE `basic_card_rule` ADD COLUMN `fill_fields` VARCHAR(500) NULL COMMENT '变量信息填充字段' AFTER `extend_fields`;
 
 delete from basic_operation_log where customized_operation_type = 'SEARCH';
-update basic_operation_log set customized_operation_type = 'SYNC',iperation_type='EDIT'  where customized_operation_type = 'PUSH';
+update basic_operation_log set customized_operation_type = 'SYNC',operation_type='EDIT' where customized_operation_type = 'PUSH';