Explorar o código

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

caozixuan %!s(int64=2) %!d(string=hai) anos
pai
achega
990979ba82

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

@@ -165,6 +165,7 @@ public class ConditionServiceImpl implements ConditionService {
         SysOrg rootOrg = sysOrgService.findRootOrg(schoolId);
         QueryWrapper<SysOrg> queryWrapper = new QueryWrapper<>();
         queryWrapper.lambda().eq(SysOrg::getParentId, rootOrg.getId())
+                .isNull(SysOrg::getType)
                 .orderByAsc(SysOrg::getCreateTime);
         return sysOrgService.list(queryWrapper);
     }

+ 6 - 1
distributed-print-business/src/main/resources/db/upgrade/3.2.5/1、升级3.2.5数据库修改脚本.sql

@@ -40,4 +40,9 @@ CREATE TABLE `exam_detail_course_paper_type` (
                                                  `paper_type` VARCHAR(5) NOT NULL COMMENT '卷型',
                                                  PRIMARY KEY (`id`));
 ALTER TABLE `exam_detail_course_paper_type`
-    ADD INDEX `idx_exam_detail_course_id` (`exam_detail_course_id` ASC);
+    ADD INDEX `idx_exam_detail_course_id` (`exam_detail_course_id` ASC);
+
+ALTER TABLE `exam_paper_structure`
+    CHANGE COLUMN `objective_structure` `objective_structure` MEDIUMTEXT NULL DEFAULT NULL COMMENT '客观题试卷结构JSON' ,
+    CHANGE COLUMN `subjective_structure` `subjective_structure` MEDIUMTEXT NULL DEFAULT NULL COMMENT '主观题试卷结构JSON' ,
+    CHANGE COLUMN `paper_info_json` `paper_info_json` MEDIUMTEXT NULL DEFAULT NULL COMMENT '整个试卷信息json(前端提供的全部信息)' ;

+ 3 - 1
distributed-print-business/src/main/resources/db/upgrade/3.2.5/2、升级3.2.5数据修改脚本.sql

@@ -54,4 +54,6 @@ update exam_card t set t.card_rule_id = (select bpc.card_rule_id from basic_prin
                                          where FIND_IN_SET(t.id, REPLACE(REPLACE(substring_index(substring_index(CONVERT((etd.paper_attachment_ids ->>'$[*].cardId') USING utf8), ']', 1), '[',-1),' "','"'),'"','')) )
 where t.type = 'CUSTOM' and t.card_rule_id is null and t.id > 0;
 
-insert into exam_detail_course_paper_type select id + cast(FLOOR(RAND()*10000000000000) as signed), id, paper_type from exam_detail_course where paper_type is not null and id>0;
+insert into exam_detail_course_paper_type select id + cast(FLOOR(RAND()*10000000000000) as signed), id, paper_type from exam_detail_course where paper_type is not null and id>0;
+
+INSERT INTO `sys_privilege` (`id`, `name`, `url`, `type`, `parent_id`, `sequence`, `property`, `enable`, `default_auth`, `front_display`) VALUES ('874', '共用接口-查询学院', '/api/admin/basic/condition/list_college', 'URL', '149', '14', 'SYS', '1', '1', '1');

+ 22 - 7
distributed-print/src/main/java/com/qmth/distributed/print/api/SysController.java

@@ -12,6 +12,7 @@ import com.qmth.distributed.print.business.entity.TBSyncTask;
 import com.qmth.distributed.print.business.entity.TeachClazz;
 import com.qmth.distributed.print.business.enums.DictionaryEnum;
 import com.qmth.distributed.print.business.enums.LoginTypeEnum;
+import com.qmth.distributed.print.business.service.ConditionService;
 import com.qmth.distributed.print.business.service.PrintCommonService;
 import com.qmth.distributed.print.business.service.TBSyncTaskService;
 import com.qmth.distributed.print.business.service.TeachClazzService;
@@ -112,6 +113,9 @@ public class SysController {
     @Resource
     BasicOperationLogService basicOperationLogService;
 
+    @Resource
+    ConditionService conditionService;
+
     /**
      * 登录
      *
@@ -656,13 +660,24 @@ public class SysController {
                 }).collect(Collectors.toList());
                 break;
             case COLLEGE:
-                List<BasicCollege> basicCollegeList = basicCollegeService.list(new QueryWrapper<BasicCollege>().lambda().eq(BasicCollege::getSchoolId, schoolId));
-                dictionaryResultList = basicCollegeList.stream().map(e -> {
-                    DictionaryResult dictionaryResult = new DictionaryResult();
-                    dictionaryResult.setId(e.getId());
-                    dictionaryResult.setName(e.getCollegeName());
-                    return dictionaryResult;
-                }).collect(Collectors.toList());
+                String privilegeId = ServletUtil.getCurrentPrivilegeId().toString();
+                if ("392".equals(privilegeId)) {
+                    List<SysOrg> sysOrgs = conditionService.listCollege();
+                    dictionaryResultList = sysOrgs.stream().map(e -> {
+                        DictionaryResult dictionaryResult = new DictionaryResult();
+                        dictionaryResult.setId(e.getId());
+                        dictionaryResult.setName(e.getName());
+                        return dictionaryResult;
+                    }).collect(Collectors.toList());
+                } else {
+                    List<BasicCollege> basicCollegeList = basicCollegeService.list(new QueryWrapper<BasicCollege>().lambda().eq(BasicCollege::getSchoolId, schoolId));
+                    dictionaryResultList = basicCollegeList.stream().map(e -> {
+                        DictionaryResult dictionaryResult = new DictionaryResult();
+                        dictionaryResult.setId(e.getId());
+                        dictionaryResult.setName(e.getCollegeName());
+                        return dictionaryResult;
+                    }).collect(Collectors.toList());
+                }
                 break;
 //            case COLLEGE:
 //                if (Objects.nonNull(semesterId)) {