yangdamao 2 years ago
parent
commit
7cdd2173d4

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/domain/ExamApply.java

@@ -63,6 +63,8 @@ private static final long serialVersionUID=1L;
     private Integer applyNature;
     /** 专场学员资料地址 */
     private String natureUrl;
+    /** 关联code(公用祥粤考场) */
+    private String relCode;
 
     private Long tenantId;
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/mapper/ExamApplyMapper.java

@@ -97,4 +97,7 @@ public interface ExamApplyMapper extends BaseMapper<ExamApply> {
 
     @InterceptorIgnore(tenantLine = "true")
     ExamApply getEntityById(Long applyId);
+
+    @InterceptorIgnore(tenantLine = "true")
+    String getExamRelCodeNotTenant(@Param("applyName") String applyName);
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/IExamApplyService.java

@@ -101,4 +101,7 @@ public interface IExamApplyService extends IService<ExamApply> {
     void updateExamUserProfile(MultipartFile file);
 
 	String examUserProfileExport(UserProfileQueryBo bo);
+
+    String getExamRelCodeNotTenant(String applyName);
+
 }

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/impl/ExamApplyServiceImpl.java

@@ -1219,6 +1219,11 @@ public class ExamApplyServiceImpl extends ServiceImpl<ExamApplyMapper, ExamApply
         return content;
     }
 
+    @Override
+    public String getExamRelCodeNotTenant(String applyName) {
+        return baseMapper.getExamRelCodeNotTenant(applyName);
+    }
+
     //生成承诺书
     private void generateCommitment(String keyValue,String toPath,String idCard,String major)throws IOException {
         int imgIndex=(int)(Math.random() * 10 );

+ 8 - 6
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeServiceImpl.java

@@ -1520,7 +1520,7 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
         }
         List<Long> ids = list.stream().map(ClassGrade::getGradeId).collect(Collectors.toList());
 //        //保留预报名编号
-//        baseMapper.UpGradeCodeByIdTenant(ids);
+        baseMapper.UpGradeCodeByIdTenant(ids);
 
         ClassGradeOpenUpBo openUpBo = new ClassGradeOpenUpBo();
         openUpBo.setGradeIds(ids);
@@ -1659,10 +1659,12 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
                 return;
             }
             //班级是否存在
-            ClassGrade grade = baseMapper.getCodeNoTenant(bo.getRegisterCode(),tenant.getTenantId());
-            if (ObjectUtils.isNotNull(grade)){
-                //已经存在 不创建
-                return;
+            if (StringUtils.isNotBlank(bo.getRegisterCode())){
+                ClassGrade grade = baseMapper.getCodeNoTenant(bo.getRegisterCode(),tenant.getTenantId());
+                if (ObjectUtils.isNotNull(grade)){
+                    //已经存在 不创建
+                    return;
+                }
             }
             ClassGrade classGrade = new ClassGrade();
             classGrade.setCreateTime(DateUtils.getNowTime());
@@ -1683,6 +1685,7 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
             }else {
                 classGrade.setClassStatus(0);
                 classGrade.setLearningStatus(2);//待定
+                classGrade.setOfficialName(bo.getRegisterCode());
             }
             classGrade.setStudentUpper(ClassGrade.INIT_UPPER); //上限300
             classGrade.setUpdateTime(DateUtils.getNowTime());
@@ -1691,7 +1694,6 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
             classGrade.setGradeCode(gradeCode);
             classGrade.setClassName(bo.getClassName());
             classGrade.setTenantId(tenant.getTenantId());
-            classGrade.setRegisterCode(bo.getRegisterCode());
             save(classGrade);
             List<ClassGradeGoods> gradeGoods = relGoods.stream().map(item -> {
                 ClassGradeGoods classGradeGoods = new ClassGradeGoods();

+ 11 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/schedule/service/impl/ScheduleServiceImpl.java

@@ -98,6 +98,7 @@ import com.zhongzheng.modules.polyv.service.IPolyvLiveService;
 import com.zhongzheng.modules.schedule.service.IScheduleService;
 import com.zhongzheng.modules.system.bo.SysTenantBadBillConfigBo;
 import com.zhongzheng.modules.system.bo.SysTenantQueryBo;
+import com.zhongzheng.modules.system.domain.SysTenant;
 import com.zhongzheng.modules.system.service.ISysTenantService;
 import com.zhongzheng.modules.system.service.ISysUserService;
 import com.zhongzheng.modules.system.vo.SysTenantVo;
@@ -1728,8 +1729,18 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
                 examApply.setProjectId(projectId);
                 examApply.setBusinessId(businessId);
                 examApply.setCode(ServletUtils.getEncoded("KSAP"));
+                examApply.setRelCode(ServletUtils.getEncoded("SHEX"));
                 examApply.setReportStatus(0);
                 examApply.setApplyNature(1);//普通场次
+                //是否公用祥粤考场
+                String tenantId = ServletUtils.getRequest().getHeader("TenantId");
+                SysTenant sysTenant = iSysTenantService.getById(Long.valueOf(tenantId));
+                if (ObjectUtils.isNotNull(sysTenant.getExamRoom()) && sysTenant.getExamRoom() == 1){
+                   String code = iExamApplyService.getExamRelCodeNotTenant(examApply.getApplyName());
+                   if (StringUtils.isNotEmpty(code)){
+                       examApply.setRelCode(code);
+                   }
+                }
                 iExamApplyService.save(examApply);
 
                 //考试商品

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/system/domain/SysTenant.java

@@ -111,5 +111,7 @@ private static final long serialVersionUID=1L;
     private Integer sort;
     /** 七大员班级标识:1使用祥粤班级 0正常 */
     private Integer sevenClass;
+    /** 考场共享标识: 1使用祥粤 0正常 */
+    private Integer examRoom;
 
 }

+ 4 - 0
zhongzheng-system/src/main/resources/mapper/modules/exam/ExamApplyMapper.xml

@@ -308,6 +308,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             apply_id = #{applyId}
     </select>
 
+    <select id="getExamRelCodeNotTenant" parameterType="java.lang.String" resultType="java.lang.String">
+        SELECT rel_code FROM `exam_apply` WHERE apply_name = #{applyName} AND rel_code != '' AND rel_code IS NOT NULL LIMIT 1
+    </select>
+
     <select id="getUserProfileList" parameterType="java.lang.String" resultType="com.zhongzheng.modules.base.domain.UserProfile">
         SELECT
             up.*