浏览代码

业务层次

he2802 2 年之前
父节点
当前提交
3e5d0c195d

+ 12 - 0
zhongzheng-admin/src/main/java/com/zhongzheng/controller/course/CourseBusinessController.java

@@ -156,4 +156,16 @@ public class CourseBusinessController extends BaseController {
     public AjaxResult<Void> editRefundPeriodUserIds(@RequestBody CourseBusinessEditBo bo) {
         return toAjax(iCourseBusinessService.editRefundPeriodUserIds(bo) ? 1 : 0);
     }
+
+
+    /**
+     * 根据名称查找业务层ID
+     */
+    @ApiOperation("根据名称查找业务层ID")
+    @PreAuthorize("@ss.hasPermi('course:business:list')")
+    @GetMapping("/queryFullId")
+    public AjaxResult<CourseBusinessVo> queryFullId(CourseBusinessQueryBo bo) {
+        CourseBusinessVo vo = iCourseBusinessService.queryFullId(bo);
+        return AjaxResult.success(vo);
+    }
 }

+ 3 - 3
zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/ExamServiceImpl.java

@@ -251,19 +251,19 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements IE
             if((q1>0)&&(q1<entity.getSimulateConfig().getSingleChoice().getKnum())){
                 throw new CustomException("模拟配置单选题参数错误");
             }
-            if(entity.getSimulateConfig().getSingleChoice().getOrderNum()>3){
+            if(entity.getSimulateConfig().getSingleChoice().getOrderNum()>4){
                 throw new CustomException("模拟配置单选题参数错误");
             }
             if((q2>0)&&(q2<entity.getSimulateConfig().getMultipleChoice().getKnum())){
                 throw new CustomException("模拟配置多选题参数错误");
             }
-            if(entity.getSimulateConfig().getMultipleChoice().getOrderNum()>3){
+            if(entity.getSimulateConfig().getMultipleChoice().getOrderNum()>4){
                 throw new CustomException("模拟配置多选题参数错误");
             }
             if((q3>0)&&(q3<entity.getSimulateConfig().getCaseQuestion().getKnum())){
                 throw new CustomException("模拟配置案例题参数错误");
             }
-            if(entity.getSimulateConfig().getCaseQuestion().getOrderNum()>3){
+            if(entity.getSimulateConfig().getCaseQuestion().getOrderNum()>4){
                 throw new CustomException("模拟配置案例题参数错误");
             }
             entity.setSimulateConfigJson(JSON.toJSONString(entity.getSimulateConfig()));

+ 9 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/bo/CourseBusinessQueryBo.java

@@ -46,7 +46,7 @@ public class CourseBusinessQueryBo extends BaseEntity {
 	private Long id;
 
 	/** 项目名称 */
-	@ApiModelProperty("项目名称")
+	@ApiModelProperty("业务名称")
 	private String businessName;
 	/** 项目id */
 	@ApiModelProperty("项目id")
@@ -82,4 +82,12 @@ public class CourseBusinessQueryBo extends BaseEntity {
 	private Integer periodType;
 	@ApiModelProperty("学时审核层级:1初审,2初审和复审")
 	private Integer periodNumber;
+
+	/** 项目名称 */
+	@ApiModelProperty("项目名称")
+	private String projectName;
+
+	/** 教育类型名称 */
+	@ApiModelProperty("教育类型名称")
+	private String educationName;
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/mapper/CourseBusinessMapper.java

@@ -26,4 +26,6 @@ public interface CourseBusinessMapper extends BaseMapper<CourseBusiness> {
 
     @InterceptorIgnore(tenantLine = "true")
     CourseBusiness getBusinessByIdTenant(@Param("businessId") Long businessId,@Param("tenantId") Long tenantId);
+
+    CourseBusinessVo queryFullId(CourseBusinessQueryBo bo);
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/ICourseBusinessService.java

@@ -65,4 +65,6 @@ public interface ICourseBusinessService extends IService<CourseBusiness> {
     CourseBusiness getBusinessByTenant(String encoder, Long newTenantId);
 
 	CourseBusiness getBusinessByIdTenant(Long businessId, Long tenantId);
+
+	CourseBusinessVo queryFullId(CourseBusinessQueryBo bo);
 }

+ 5 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseBusinessServiceImpl.java

@@ -242,4 +242,9 @@ public class CourseBusinessServiceImpl extends ServiceImpl<CourseBusinessMapper,
         return baseMapper.getBusinessByIdTenant(businessId, tenantId);
     }
 
+    @Override
+    public CourseBusinessVo queryFullId(CourseBusinessQueryBo bo) {
+        return baseMapper.queryFullId(bo);
+    }
+
 }

+ 17 - 0
zhongzheng-system/src/main/resources/mapper/modules/course/CourseBusinessMapper.xml

@@ -27,6 +27,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
     <resultMap type="com.zhongzheng.modules.course.vo.CourseBusinessVo" id="CourseBusinessVoResult">
         <result property="id" column="id"/>
         <result property="businessName" column="business_name"/>
+        <result property="businessId" column="business_id"/>
         <result property="remark" column="remark"/>
         <result property="projectId" column="project_id"/>
         <result property="schoolYear" column="school_year"/>
@@ -99,6 +100,22 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             b.id = #{id}
     </select>
 
+    <select id="queryFullId" parameterType="com.zhongzheng.modules.course.bo.CourseBusinessQueryBo"  resultMap="CourseBusinessVoResult">
+        SELECT
+            e.id as education_id,
+            p.id AS project_id,
+            b.id AS business_id
+        FROM
+            course_business b
+                LEFT JOIN course_project_type p ON b.project_id = p.id
+                LEFT JOIN course_education_type e ON p.education_id = e.id
+        WHERE
+            b.business_name = #{businessName}
+          AND e.education_name = #{educationName}
+          AND p.project_name = #{projectName}
+          limit 1
+    </select>
+
     <select id="getBusinessByTenant" parameterType="map"  resultType="com.zhongzheng.modules.course.domain.CourseBusiness">
         SELECT * FROM course_business WHERE encoder = #{encoder} and tenant_id = #{newTenantId}
     </select>