he2802 1 tahun lalu
induk
melakukan
37a1ac9f9f

+ 0 - 1
run-prod.sh

@@ -1,5 +1,4 @@
 
-
 #!/usr/bin/env bash
 # 定义应用组名
 group_admin_name='zhongzheng'

+ 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));
     }
 

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

@@ -107,6 +107,7 @@ public class SysLoginService
             throw new CaptchaException();
         }
 //        iUserLoginErrorService.checkLimit(username);
+
         // 用户验证
         Authentication authentication = null;
         try

+ 9 - 9
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/service/impl/UserProfileServiceImpl.java

@@ -1014,15 +1014,15 @@ public class UserProfileServiceImpl extends ServiceImpl<UserProfileMapper, UserP
                     userProfileExportVo.setSex(jsonBean.getSex().getValue());
                     userProfileExportVo.setIdcard(jsonBean.getIdcard().getValue());
                     userProfileExportVo.setTelphone(jsonBean.getTelphone().getValue());
-                    userProfileExportVo.setEducation(jsonBean.getEducation().getValue());
-                    userProfileExportVo.setSchool(jsonBean.getSchool().getValue());
-                    userProfileExportVo.setGraduation_time(DateUtil.formatDate(jsonBean.getGraduation_time().getValue()));
-                    userProfileExportVo.setWork_unit(jsonBean.getWork_unit().getValue());
-                    userProfileExportVo.setUnit_contact(jsonBean.getUnit_contact().getValue());
-                    userProfileExportVo.setUnit_tel(jsonBean.getUnit_tel().getValue());
-                    userProfileExportVo.setApply_post(jsonBean.getApply_post().getValue());
-                    userProfileExportVo.setMajor(jsonBean.getMajor().getValue());
-                    userProfileExportVo.setWorking_years(jsonBean.getWorking_years().getValue());
+                    userProfileExportVo.setEducation(Validator.isEmpty(jsonBean.getEducation())?"":jsonBean.getEducation().getValue());
+                    userProfileExportVo.setSchool(Validator.isEmpty(jsonBean.getSchool())?"":jsonBean.getSchool().getValue());
+                    userProfileExportVo.setGraduation_time(Validator.isEmpty(jsonBean.getGraduation_time())?"":DateUtil.formatDate(jsonBean.getGraduation_time().getValue()));
+                    userProfileExportVo.setWork_unit(Validator.isEmpty(jsonBean.getWork_unit())?"":jsonBean.getWork_unit().getValue());
+                    userProfileExportVo.setUnit_contact(Validator.isEmpty(jsonBean.getUnit_contact())?"":jsonBean.getUnit_contact().getValue());
+                    userProfileExportVo.setUnit_tel(Validator.isEmpty(jsonBean.getUnit_tel())?"":jsonBean.getUnit_tel().getValue());
+                    userProfileExportVo.setApply_post(Validator.isEmpty(jsonBean.getApply_post())?"":jsonBean.getApply_post().getValue());
+                    userProfileExportVo.setMajor(Validator.isEmpty(jsonBean.getMajor())?"":jsonBean.getMajor().getValue());
+                    userProfileExportVo.setWorking_years(Validator.isEmpty(jsonBean.getWorking_years())?"":jsonBean.getWorking_years().getValue());
                     List<String> fileList = new ArrayList<>();
                     if (Validator.isNotEmpty(jsonBean.getRecent_photos().getValue())) {
                         userProfileExportVo.setRecent_photos(ALIYUN_OSS_ENDPOINT + "/" + jsonBean.getRecent_photos().getValue());

+ 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("否");

+ 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},

+ 18 - 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>