Selaa lähdekoodia

Merge branch 'dev'

yangdamao 1 vuosi sitten
vanhempi
commit
c48928ed5b

+ 10 - 4
zhongzheng-admin/src/main/java/com/zhongzheng/controller/common/CommonController.java

@@ -50,10 +50,7 @@ import com.zhongzheng.modules.distribution.vo.DistributionSellerVo;
 import com.zhongzheng.modules.exam.bo.*;
 import com.zhongzheng.modules.exam.service.IExamApplyService;
 import com.zhongzheng.modules.exam.vo.ExamApplyDetailVo;
-import com.zhongzheng.modules.goods.bo.AlikeGoodsBo;
-import com.zhongzheng.modules.goods.bo.GoodsQueryBo;
-import com.zhongzheng.modules.goods.bo.GoodsStudyUrlBo;
-import com.zhongzheng.modules.goods.bo.UserGoodsListBo;
+import com.zhongzheng.modules.goods.bo.*;
 import com.zhongzheng.modules.goods.service.IGoodsService;
 import com.zhongzheng.modules.goods.vo.*;
 import com.zhongzheng.modules.grade.bo.*;
@@ -909,4 +906,13 @@ public class CommonController extends BaseController {
         return AjaxResult.success();
     }
 
+    /**
+     * 回复试卷业务层次
+     */
+    @ApiOperation("回复试卷业务层次")
+    @GetMapping("/common/free/update/exam/business")
+    public AjaxResult<Void> updateExamBusiness() {
+        return toAjax(iGoodsService.updateExamBusiness() ? 1 : 0);
+    }
+
 }

+ 1 - 1
zhongzheng-admin/src/main/java/com/zhongzheng/controller/order/OrderBusinessConfigController.java

@@ -95,7 +95,7 @@ public class OrderBusinessConfigController extends BaseController {
     @PreAuthorize("@ss.hasPermi('system:config:add')")
     @Log(title = "录单配置", businessType = BusinessType.INSERT)
     @PostMapping("/withEntity")
-    public AjaxResult<OrderBusinessConfig> addWithEntity(@RequestBody OrderBusinessConfigAddBo bo) {
+    public AjaxResult<OrderBusinessConfigVo> addWithEntity(@RequestBody OrderBusinessConfigAddBo bo) {
         return AjaxResult.success(iOrderBusinessConfigService.insertByAddBoWithEntity(bo));
     }
 

+ 14 - 14
zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/SysLoginService.java

@@ -93,20 +93,20 @@ public class SysLoginService
      */
     public String login(String username, String password, String code, String uuid,String smsCode,String tel)
     {
-//        String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid;
-//        String captcha = redisCache.getCacheObject(verifyKey);
-//        redisCache.deleteObject(verifyKey);
-//        if (captcha == null)
-//        {
-//            AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire")));
-//            throw new CaptchaExpireException();
-//        }
-//        if (!code.equalsIgnoreCase(captcha))
-//        {
-//            AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error")));
-//            throw new CaptchaException();
-//        }
-//        iUserLoginErrorService.checkLimit(username);
+        String verifyKey = Constants.CAPTCHA_CODE_KEY + uuid;
+        String captcha = redisCache.getCacheObject(verifyKey);
+        redisCache.deleteObject(verifyKey);
+        if (captcha == null)
+        {
+            AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.expire")));
+            throw new CaptchaExpireException();
+        }
+        if (!code.equalsIgnoreCase(captcha))
+        {
+            AsyncManager.me().execute(AsyncFactory.recordLogininfor(username, Constants.LOGIN_FAIL, MessageUtils.message("user.jcaptcha.error")));
+            throw new CaptchaException();
+        }
+        iUserLoginErrorService.checkLimit(username);
         // 用户验证
         Authentication authentication = null;
         try

+ 23 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/mapper/GoodsMapper.java

@@ -2,6 +2,10 @@ package com.zhongzheng.modules.goods.mapper;
 
 import com.baomidou.mybatisplus.annotation.InterceptorIgnore;
 import com.baomidou.mybatisplus.core.mapper.BaseMapper;
+import com.zhongzheng.modules.bank.domain.Exam;
+import com.zhongzheng.modules.bank.domain.QuestionBusiness;
+import com.zhongzheng.modules.bank.domain.QuestionChapter;
+import com.zhongzheng.modules.bank.domain.QuestionModule;
 import com.zhongzheng.modules.course.bo.CourseQueryBo;
 import com.zhongzheng.modules.course.bo.ExternalQuestionBo;
 import com.zhongzheng.modules.course.bo.ReplenishExamBo;
@@ -110,4 +114,23 @@ public interface GoodsMapper extends BaseMapper<Goods> {
 
     @InterceptorIgnore(tenantLine = "true")
     Integer getCourseExamNumNoTenant(Long goodsId);
+
+    @InterceptorIgnore(tenantLine = "true")
+    List<QuestionModule> getModuleExam();
+
+    @InterceptorIgnore(tenantLine = "true")
+    SysGoodsCopyRecord getSysGoodsCopy(@Param("moduleExamId") Long moduleExamId,@Param("type")Integer type);
+
+    @InterceptorIgnore(tenantLine = "true")
+    List<QuestionBusiness> getModuleExamBusiness(@Param("oldId")Long oldId,@Param("type")Integer type);
+
+    @InterceptorIgnore(tenantLine = "true")
+    Integer saveExamBusiness(QuestionBusiness bs);
+
+    @InterceptorIgnore(tenantLine = "true")
+    List<QuestionChapter> getChapterExam();
+
+    @InterceptorIgnore(tenantLine = "true")
+    List<Exam> getExam();
+
 }

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/IGoodsService.java

@@ -167,4 +167,7 @@ public interface IGoodsService extends IService<Goods> {
     Integer getCourseNum(Long goodsId);
 
     Integer getCourseExamNum(Long goodsId);
+
+    Boolean updateExamBusiness();
+
 }

+ 87 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsServiceImpl.java

@@ -5298,6 +5298,93 @@ public class GoodsServiceImpl extends ServiceImpl<GoodsMapper, Goods> implements
         return baseMapper.getCourseExamNumNoTenant(goodsId);
     }
 
+    @Override
+    public Boolean updateExamBusiness() {
+        //模块卷
+        List<QuestionModule> modules = baseMapper.getModuleExam();
+        if (CollectionUtils.isNotEmpty(modules)){
+            modules.forEach(item -> {
+                Long tenantId = item.getTenantId();
+                SysGoodsCopyRecord copyRecord = baseMapper.getSysGoodsCopy(item.getModuleExamId(),46);
+                if (ObjectUtils.isNull(copyRecord)){
+                    return;
+                }
+                List<QuestionBusiness> businesses = baseMapper.getModuleExamBusiness(copyRecord.getOldId(),4);
+                if (CollectionUtils.isEmpty(businesses)){
+                    return;
+                }
+                //同步模块卷业务层次
+                businesses.forEach(bs -> {
+                    bs.setId(null);
+                    bs.setMajorId(item.getModuleExamId());
+                    bs.setEducationTypeId(getNewIdByTenant(bs.getEducationTypeId(),14,tenantId));
+                    bs.setProjectId(getNewIdByTenant(bs.getProjectId(),22,tenantId));
+                    bs.setBusinessId(getNewIdByTenant(bs.getBusinessId(),9,tenantId));
+                    bs.setSubjectId(getNewIdByTenant(bs.getSubjectId(),26,tenantId));
+                    bs.setTenantId(tenantId);
+                    baseMapper.saveExamBusiness(bs);
+                });
+            });
+        }
+
+        //章卷
+        List<QuestionChapter> chapters = baseMapper.getChapterExam();
+        if (CollectionUtils.isNotEmpty(chapters)){
+            chapters.forEach(item -> {
+                Long tenantId = item.getTenantId();
+                SysGoodsCopyRecord copyRecord = baseMapper.getSysGoodsCopy(item.getChapterExamId(),44);
+                if (ObjectUtils.isNull(copyRecord)){
+                    return;
+                }
+                List<QuestionBusiness> businesses = baseMapper.getModuleExamBusiness(copyRecord.getOldId(),3);
+                if (CollectionUtils.isEmpty(businesses)){
+                    return;
+                }
+
+                //同步模块卷业务层次
+                businesses.forEach(bs -> {
+                    bs.setId(null);
+                    bs.setMajorId(item.getChapterExamId());
+                    bs.setEducationTypeId(getNewIdByTenant(bs.getEducationTypeId(),14,tenantId));
+                    bs.setProjectId(getNewIdByTenant(bs.getProjectId(),22,tenantId));
+                    bs.setBusinessId(getNewIdByTenant(bs.getBusinessId(),9,tenantId));
+                    bs.setSubjectId(getNewIdByTenant(bs.getSubjectId(),26,tenantId));
+                    bs.setTenantId(tenantId);
+
+                    baseMapper.saveExamBusiness(bs);
+                });
+            });
+        }
+
+        //试卷
+        List<Exam> exam = baseMapper.getExam();
+        if (CollectionUtils.isNotEmpty(exam)){
+            exam.forEach(item -> {
+                Long tenantId = item.getTenantId();
+                SysGoodsCopyRecord copyRecord = baseMapper.getSysGoodsCopy(item.getExamId(),28);
+                if (ObjectUtils.isNull(copyRecord)){
+                    return;
+                }
+                List<QuestionBusiness> businesses = baseMapper.getModuleExamBusiness(copyRecord.getOldId(),2);
+                if (CollectionUtils.isEmpty(businesses)){
+                    return;
+                }
+                //同步模块卷业务层次
+                businesses.forEach(bs -> {
+                    bs.setId(null);
+                    bs.setMajorId(item.getExamId());
+                    bs.setEducationTypeId(getNewIdByTenant(bs.getEducationTypeId(),14,tenantId));
+                    bs.setProjectId(getNewIdByTenant(bs.getProjectId(),22,tenantId));
+                    bs.setBusinessId(getNewIdByTenant(bs.getBusinessId(),9,tenantId));
+                    bs.setSubjectId(getNewIdByTenant(bs.getSubjectId(),26,tenantId));
+                    bs.setTenantId(tenantId);
+
+                    baseMapper.saveExamBusiness(bs);
+                });
+            });
+        }
+        return true;
+    }
 
     private void updateHandoutsId(Long goodsId, Long tenantId, Long handoutsId) {
         baseMapper.updateHandoutsId(goodsId, tenantId, handoutsId);

+ 10 - 4
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeServiceImpl.java

@@ -1075,23 +1075,29 @@ public class ClassGradeServiceImpl extends ServiceImpl<ClassGradeMapper, ClassGr
             }else{
                 exportVo.setStudyStatusStr("已完成");
             }
+            if(Validator.isEmpty(classGradeStudentVo.getStudyCount())){
+                classGradeStudentVo.setStudyCount(0L);
+            }
+            if(Validator.isEmpty(classGradeStudentVo.getUseStudyCount())){
+                classGradeStudentVo.setUseStudyCount(0);
+            }
             exportVo.setTotalStudyCount(classGradeStudentVo.getUseStudyCount()+classGradeStudentVo.getStudyCount().intValue());
-            if(classGradeStudentVo.getUserStatus()==1){
+            if(Validator.isNotEmpty(classGradeStudentVo.getUserStatus())&&classGradeStudentVo.getUserStatus()==1){
                 exportVo.setUserStatus("变更");
             }else{
                 exportVo.setUserStatus("未变更");
             }
-            if(classGradeStudentVo.getOfficialStatus()==1){
+            if(Validator.isNotEmpty(classGradeStudentVo.getOfficialStatus())&&classGradeStudentVo.getOfficialStatus()==1){
                 exportVo.setOfficialStatus("是");
             }else{
                 exportVo.setOfficialStatus("否");
             }
-            if(classGradeStudentVo.getPeriodStatus()==1){
+            if(Validator.isNotEmpty(classGradeStudentVo.getPeriodStatus())&&classGradeStudentVo.getPeriodStatus()==1){
                 exportVo.setPeriodStatus("通过");
             }else{
                 exportVo.setPeriodStatus("未通过");
             }
-            if(classGradeStudentVo.getPeriodPlush()==1){
+            if(Validator.isNotEmpty(classGradeStudentVo.getPeriodPlush())&&classGradeStudentVo.getPeriodPlush()==1){
                 exportVo.setPeriodPlush("是");
             }else{
                 exportVo.setPeriodPlush("否");

+ 7 - 7
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/UserPeriodServiceImpl.java

@@ -672,13 +672,13 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
     public boolean syncStudyLogToOld(UserPeriodEditBo bo) {
         //企业ID
         String tenant = ServletUtils.getRequest().getHeader("TenantId");
-        SysOldOrg org = sysOldOrgService.list(new LambdaQueryWrapper<SysOldOrg>()
-                .eq(SysOldOrg::getTenantId, tenant)
-                .last("limit 1")).stream().findFirst().orElse(null);
-        if (org.getShareClass() == 0){
-            //有职能的机构学时不推送旧系统
-            return true;
-        }
+//        SysOldOrg org = sysOldOrgService.list(new LambdaQueryWrapper<SysOldOrg>()
+//                .eq(SysOldOrg::getTenantId, tenant)
+//                .last("limit 1")).stream().findFirst().orElse(null);
+//        if (org.getShareClass() == 0){
+//            //有职能的机构学时不推送旧系统
+//            return true;
+//        }
         CourseEducationType educationType = iCourseEducationTypeService.getOne(new LambdaQueryWrapper<CourseEducationType>().eq(CourseEducationType::getStatus, 1).eq(CourseEducationType::getEducationName,"继续教育").last("limit 1"));
         CourseProjectType projectType = iCourseProjectTypeService.getOne(new LambdaQueryWrapper<CourseProjectType>().eq(CourseProjectType::getStatus, 1).eq(CourseProjectType::getEducationId,educationType.getId()).eq(CourseProjectType::getProjectName,"建造师").last("limit 1"));
         CourseBusiness business = iCourseBusinessService.getOne(new LambdaQueryWrapper<CourseBusiness>().eq(CourseBusiness::getStatus, 1).eq(CourseBusiness::getProjectId,projectType.getId()).eq(CourseBusiness::getBusinessName,"二级").last("limit 1"));

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/IOrderBusinessConfigService.java

@@ -39,7 +39,7 @@ public interface IOrderBusinessConfigService extends IService<OrderBusinessConfi
 	 */
 	Boolean insertByAddBo(OrderBusinessConfigAddBo bo);
 
-	OrderBusinessConfig insertByAddBoWithEntity(OrderBusinessConfigAddBo bo);
+	OrderBusinessConfigVo insertByAddBoWithEntity(OrderBusinessConfigAddBo bo);
 
 	/**
 	 * 根据编辑业务对象修改录单配置

+ 4 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/order/service/impl/OrderBusinessConfigServiceImpl.java

@@ -96,13 +96,15 @@ public class OrderBusinessConfigServiceImpl extends ServiceImpl<OrderBusinessCon
     }
 
     @Override
-    public OrderBusinessConfig insertByAddBoWithEntity(OrderBusinessConfigAddBo bo) {
+    public OrderBusinessConfigVo insertByAddBoWithEntity(OrderBusinessConfigAddBo bo) {
         OrderBusinessConfig add = BeanUtil.toBean(bo, OrderBusinessConfig.class);
         validEntityBeforeSave(add);
         add.setCreateTime(DateUtils.getNowTime());
         add.setUpdateTime(DateUtils.getNowTime());
         this.save(add);
-        return add;
+        OrderBusinessConfigQueryBo queryBo = new OrderBusinessConfigQueryBo();
+        queryBo.setId(add.getId());
+        return this.baseMapper.getDetail(queryBo);
     }
 
     @Override

+ 25 - 0
zhongzheng-system/src/main/resources/mapper/modules/goods/GoodsMapper.xml

@@ -970,6 +970,31 @@
         WHERE goods_name = #{goodsName} and code = #{code} and tenant_id = #{tenantId}
     </select>
 
+    <select id="getModuleExam" resultType="com.zhongzheng.modules.bank.domain.QuestionModule">
+        SELECT * FROM question_module qm WHERE (SELECT COUNT( qb.id)FROM question_business qb WHERE qb.major_id = qm.module_exam_id AND qb.type = 4) &lt;= 0 AND `status` = 1
+    </select>
+
+    <select id="getChapterExam" resultType="com.zhongzheng.modules.bank.domain.QuestionChapter">
+        SELECT * FROM question_chapter qm WHERE (SELECT COUNT( qb.id)FROM question_business qb WHERE qb.major_id = qm.chapter_exam_id AND qb.type = 3) &lt;= 0 AND `status` = 1
+    </select>
+
+    <select id="getExam" resultType="com.zhongzheng.modules.bank.domain.Exam">
+        SELECT * FROM exam qm WHERE (SELECT COUNT( qb.id)FROM question_business qb WHERE qb.major_id = qm.exam_id AND qb.type = 2) &lt;= 0 AND `status` = 1
+    </select>
+
+    <select id="getSysGoodsCopy" parameterType="map" resultType="com.zhongzheng.modules.system.domain.SysGoodsCopyRecord">
+        SELECT * FROM sys_goods_copy_record WHERE new_id = #{moduleExamId} AND type = #{type} LIMIT 1
+    </select>
+
+    <select id="getModuleExamBusiness" parameterType="map" resultType="com.zhongzheng.modules.bank.domain.QuestionBusiness">
+        SELECT * FROM question_business WHERE major_id = #{oldId} AND type = #{type} AND tenant_id = 867735392558919680
+    </select>
+
+    <insert id="saveExamBusiness" parameterType="com.zhongzheng.modules.bank.domain.QuestionBusiness" >
+        INSERT INTO question_business (education_type_id,business_id,tenant_id,project_id,subject_id,major_id,type)
+        VALUES(#{educationTypeId},#{businessId},#{tenantId},#{projectId},#{subjectId},#{majorId},#{type})
+    </insert>
+
     <update id="updateByTenant" parameterType="com.zhongzheng.modules.goods.domain.Goods">
         UPDATE goods
         SET `year`                  = #{year},

+ 21 - 1
zhongzheng-system/src/main/resources/mapper/modules/grade/ClassGradeMapper.xml

@@ -407,6 +407,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         cgu.official_status_num,
         u.user_account,
         u.user_id,
+        u.company_name,
         cgu.`status`,
         u.realname,
         og.goods_id,
@@ -453,7 +454,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         ueg.exam_number,
         ueg.do_number,
         ueg.expend_number,
-        ueg.expend_before
+        ueg.expend_before,
+        up.`status` as profile_status,
+        cet.education_name
         FROM
         class_grade_user cgu
         LEFT JOIN class_grade cg ON cgu.grade_id = cg.grade_id
@@ -463,8 +466,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         LEFT JOIN major m ON g.major_id = m.id
         LEFT JOIN course_business cb ON g.business_id = cb.id
         LEFT JOIN course_project_type cpt ON g.project_id = cpt.id
+        LEFT JOIN course_education_type cet ON g.education_type_id = cet.id
         LEFT JOIN user_wx_follow uwf ON u.union_id = uwf.union_id
         LEFT JOIN user_exam_goods ueg ON ueg.order_goods_id = og.order_goods_id
+        LEFT JOIN user_profile up on cgu.order_goods_id = up.order_goods_id and up.type_status=1 and up.current_status = 1
         where 1=1 and cgu.`status` = 1
         <if test="sevenCode != null and sevenCode !='' ">
             AND cg.seven_code = #{sevenCode}
@@ -490,12 +495,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="studyCountMore != null and studyCountMore == 0 ">
             AND og.study_count = 0
         </if>
+        <if test="periodStatus != null ">
+            AND cgu.period_status = #{periodStatus}
+        </if>
         <if test="officialStatus != null and officialStatus == 1 ">
             AND cgu.official_status = 1
         </if>
         <if test="officialStatus != null and officialStatus == 0 ">
             AND (cgu.official_status is NULL or cgu.official_status=0)
         </if>
+        <if test="periodPlush != null and periodPlush == 1 ">
+            AND cgu.period_plush = 1
+        </if>
+        <if test="periodPlush != null and periodPlush == 0 ">
+            AND (cgu.period_plush is NULL or cgu.period_plush=0)
+        </if>
         <if test="realname != null and realname != ''">
             AND u.realname like concat('%', #{realname}, '%')
         </if>
@@ -514,6 +528,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
             #{item,typeHandler=com.zhongzheng.common.type.EncryptHandler}
             </foreach>
         </if>
+        <if test="searchKey != null and searchKey != ''">
+            AND (cg.class_name like concat('%', #{searchKey}, '%') or u.realname like concat('%', #{searchKey}, '%') or u.company_name like concat('%', #{searchKey}, '%'))
+        </if>
         <if test="orderSn != null and orderSn != ''">
             AND og.order_sn = #{orderSn}
         </if>
@@ -661,6 +678,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <if test="studyCountMore != null and studyCountMore == 0 ">
             AND og.study_count = 0
         </if>
+        <if test="periodStatus != null ">
+            AND cgu.period_status = #{periodStatus}
+        </if>
         <if test="officialStatus != null and officialStatus == 1 ">
             AND cgu.official_status = 1
         </if>