yangdamao 1 年間 前
コミット
f5999a0079

+ 1 - 0
zhongzheng-admin-saas/src/main/resources/application-dev.yml

@@ -173,6 +173,7 @@ oldSys:
     goods: http://gdxypx.xy.com/WitSystem/BussinessApi/NewYxtLogin
     question: http://192.168.1.121:8057/WordData/GetMeasureList
     questionDetail: http://192.168.1.121:8057/WordData/GetTopicList
+    studyCheck: http://gdxypx.xy.com/System/BussinessApi/EjStudyCheck
 
 invoice:
     host: http://192.168.1.222:7077/sys/common/openMplatform/log

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

@@ -643,8 +643,8 @@ public class CommonController extends BaseController {
 
     @ApiOperation("根据身份证查询当前学员是否有学习")
     @GetMapping("common/free/getStudyTimeByCard")
-    public AjaxResult<UserStudyTimeVo> getStudyTimeByCard(@RequestParam("idCard")String idCard) {
-        return AjaxResult.success(iUserService.getStudyTimeByCard(idCard));
+    public AjaxResult<UserStudyTimeVo> getStudyTimeByCard(@RequestParam("idCard")String idCard,@RequestParam("type")Integer type) {
+        return AjaxResult.success(iUserService.getStudyTimeByCard(idCard,type));
     }
 
     /**

+ 1 - 0
zhongzheng-admin/src/main/resources/application-dev.yml

@@ -174,6 +174,7 @@ oldSys:
     goods: http://gdxypx.xy.com/WitSystem/BussinessApi/NewYxtLogin
     question: http://192.168.1.121:8057/WordData/GetMeasureList
     questionDetail: http://192.168.1.121:8057/WordData/GetTopicList
+    studyCheck: http://gdxypx.xy.com/System/BussinessApi/EjStudyCheck
 
 invoice:
     host: http://192.168.1.222:7077/sys/common/openMplatform/log

+ 1 - 0
zhongzheng-api/src/main/resources/application-dev.yml

@@ -176,6 +176,7 @@ oldSys:
     goods: http://gdxypx.xy.com/System/BussinessApi/NewYxtLogin
     question: http://192.168.1.121:8057/WordData/GetMeasureList
     questionDetail: http://192.168.1.121:8057/WordData/GetTopicList
+    studyCheck: http://gdxypx.xy.com/System/BussinessApi/EjStudyCheck
 
 invoice:
     host: http://192.168.1.222:7077/sys/common/openMplatform/log

+ 3 - 2
zhongzheng-framework/src/main/java/com/zhongzheng/framework/web/service/UserServiceImpl.java

@@ -2062,7 +2062,7 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
     }
 
     @Override
-    public UserStudyTimeVo getStudyTimeByCard(String idCard) {
+    public UserStudyTimeVo getStudyTimeByCard(String idCard,Integer type) {
         UserStudyTimeVo vo = new UserStudyTimeVo();
         vo.setIdCard(idCard);
         User user = getByCardNoTenant(idCard);
@@ -2070,8 +2070,9 @@ public class UserServiceImpl extends ServiceImpl<UserMapper, User> implements IU
             vo.setStudyFlag(false);
             return vo;
         }
+        String business = type == 1? "继续教育二级建造师":"继续教育二级造价师";
         //查询是否有二建课程在学习
-        Long studyTime = baseMapper.getFistStudyTime(user.getUserId(),user.getTenantId(),"继续教育二级建造师");
+        Long studyTime = baseMapper.getFistStudyTime(user.getUserId(),user.getTenantId(),business);
         if (ObjectUtils.isNull(studyTime)){
             vo.setStudyFlag(false);
             return vo;

+ 26 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeUserServiceImpl.java

@@ -5,6 +5,7 @@ import cn.hutool.core.convert.Convert;
 import cn.hutool.core.lang.Validator;
 import cn.hutool.core.util.IdUtil;
 import com.alibaba.fastjson.JSON;
+import com.alibaba.fastjson.JSONArray;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
 import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
@@ -32,6 +33,7 @@ import com.zhongzheng.modules.bank.bo.QuestionModuleChapterQueryBo;
 import com.zhongzheng.modules.bank.service.IQuestionChapterExamService;
 import com.zhongzheng.modules.bank.service.IQuestionModuleChapterService;
 import com.zhongzheng.modules.bank.vo.ExamVo;
+import com.zhongzheng.modules.bank.vo.ExternalQuestionVo;
 import com.zhongzheng.modules.bank.vo.QuestionChapterVo;
 import com.zhongzheng.modules.base.service.IUserProfileService;
 import com.zhongzheng.modules.course.bo.CourseBusinessQueryBo;
@@ -203,6 +205,9 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
     @Value("${oldSys.host}")
     private String OLD_SYS_HOST;
 
+    @Value("${oldSys.studyCheck}")
+    private String OLD_STUDY_CHECK;
+
     @Autowired
     private IUserPeriodService iUserPeriodService;
 
@@ -3685,6 +3690,27 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
 
     @Override
     public Long checkFinishRequiredCourse(ClassGradeUserQueryBo bo) {
+        //查询旧系统是否有学习
+        String businessName = iGoodsService.getGoodsBusinessName(bo.getGoodsId());
+        if (businessName.contains("继续教育二级建造师") || businessName.contains("继续教育二级造价师")){
+            User user = iUserService.getById(bo.getUserId());
+            Integer type = "继续教育二级建造师".equals(businessName)?1:2;
+            String param = String.format("idnum=%s&type=%s",EncryptHandler.decrypt(user.getIdCard()),type);
+            String respone = "";
+            try {
+                respone = HttpUtils.sendGet(OLD_STUDY_CHECK, param);
+                if (respone.contains("\"Status\":true")) {
+                    JSONObject jsonObject1 = JSONObject.parseObject(respone);
+                    UserStudyTimeVo timeVo = JSONArray.parseObject(jsonObject1.get("data").toString(), UserStudyTimeVo.class);
+                    if (ObjectUtils.isNotNull(timeVo) && ObjectUtils.isNotNull(timeVo.getStudyStartTime()) && timeVo.getStudyFlag()){
+                        //旧系统正在学习中
+                        return 1L;
+                    }
+                }
+            } catch (Exception e) {
+                throw new CustomException("旧系统二建继续校验接口请求失败"+e.getMessage());
+            }
+        }
         return baseMapper.checkFinishRequiredCourse(bo);
     }
 

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/IUserService.java

@@ -161,5 +161,5 @@ public interface IUserService extends IService<User> {
 
 	void userDataDownloadUp(UserDataDownloadUpBo bo);
 
-	UserStudyTimeVo getStudyTimeByCard(String idCard);
+	UserStudyTimeVo getStudyTimeByCard(String idCard,Integer type);
 }

+ 3 - 0
zhongzheng-system/src/main/resources/mapper/modules/user/UserMapper.xml

@@ -663,8 +663,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         LEFT JOIN course_project_type cpt ON g.project_id = cpt.id
         LEFT JOIN course_business cb ON g.business_id = cb.id
         LEFT JOIN class_grade cg ON usr.grade_id = cg.grade_id
+        LEFT JOIN class_grade_user cgu ON usr.order_goods_id = cgu.order_goods_id
         WHERE
         usr.current_status = 1
+        AND cgu.period_status = -1
+        AND cgu.status = 1
         AND usr.user_id = #{userId}
         AND usr.tenant_id = #{tenantId}
         AND INSTR( CONCAT( cet.education_name, cb.business_name, cpt.project_name ), #{businessName} )