yangdamao пре 1 година
родитељ
комит
b294878aaf

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

@@ -191,6 +191,7 @@ exam:
     subscribeUpdateExam: http://192.168.1.7:9099/cd/subscribe/update/exam
     subscribeAddExamNum: http://192.168.1.7:9099/cd/subscribe/add/num
     subscribeAddExamResult: http://192.168.1.7:9099/cd/exam/add/exam/result
+    subscribeAddCertificate: http://192.168.1.7:9099/cd/exam/add/exam/result/certificate
     question: http://120.79.166.78:19013/common/question/getMeasureList
     questionDetail: http://120.79.166.78:19013/common/question/getTopicList
 

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

@@ -192,6 +192,7 @@ exam:
     subscribeUpdateExam: http://192.168.1.7:9099/cd/subscribe/update/exam
     subscribeAddExamNum: http://192.168.1.7:9099/cd/subscribe/add/num
     subscribeAddExamResult: http://192.168.1.7:9099/cd/exam/add/exam/result
+    subscribeAddCertificate: http://192.168.1.7:9099/cd/exam/add/exam/result/certificate
     question: http://120.79.166.78:19013/common/question/getMeasureList
     questionDetail: http://120.79.166.78:19013/common/question/getTopicList
 

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

@@ -194,6 +194,7 @@ exam:
     subscribeUpdateExam: http://192.168.1.7:9099/cd/subscribe/update/exam
     subscribeAddExamNum: http://192.168.1.7:9099/cd/subscribe/add/num
     subscribeAddExamResult: http://192.168.1.7:9099/cd/exam/add/exam/result
+    subscribeAddCertificate: http://192.168.1.7:9099/cd/exam/add/exam/result/certificate
     question: http://120.79.166.78:19013/common/question/getMeasureList
     questionDetail: http://120.79.166.78:19013/common/question/getTopicList
 

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseServiceImpl.java

@@ -1009,6 +1009,9 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
             goodsUserVo.setPeriodStatus(classGradeVo.getPeriodStatus());
             goodsUserVo.setSignId(classGradeVo.getId());
             goodsUserVo.setOfficialStatus(classGradeVo.getOfficialStatus());
+            goodsUserVo.setClassStatus(classGradeVo.getClassStatus());
+            goodsUserVo.setClassStartTime(classGradeVo.getClassStartTime());
+            goodsUserVo.setClassEndTime(classGradeVo.getClassEndTime());
         }
         return goodsUserVos;
     }

+ 30 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/bo/ExamApplyCertificateBo.java

@@ -0,0 +1,30 @@
+package com.zhongzheng.modules.exam.bo;
+
+import lombok.Data;
+
+import java.io.Serializable;
+
+/**
+ * @author yangdamao
+ * @date 2023年06月20日 11:22
+ */
+@Data
+public class ExamApplyCertificateBo implements Serializable {
+
+    private String userName;
+
+    private String idCard;
+
+    /** 证书编号 */
+    private String certificateCode;
+    /** 发证时间 */
+    private Long certificateStartTime;
+    /** 到期时间 */
+    private Long certificateEndTime;
+    /** 证书下载地址 */
+    private String certificateUrl;
+
+    private String major;
+
+    private Long tenantId;
+}

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

@@ -48,4 +48,6 @@ private static final long serialVersionUID=1L;
     @TableField(fill = FieldFill.INSERT_UPDATE)
     private Long updateTime;
 
+    private Long tenantId;
+
 }

+ 16 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/impl/ExamActivityServiceImpl.java

@@ -35,6 +35,8 @@ import com.zhongzheng.modules.mock.domain.MockMajor;
 import com.zhongzheng.modules.mock.domain.MockMajorSubject;
 import com.zhongzheng.modules.mock.service.IMockMajorService;
 import com.zhongzheng.modules.mock.service.IMockMajorSubjectService;
+import com.zhongzheng.modules.system.domain.SysTenant;
+import com.zhongzheng.modules.system.service.ISysTenantService;
 import com.zhongzheng.modules.user.domain.User;
 import com.zhongzheng.modules.user.service.IUserMockSubscribeService;
 import com.zhongzheng.modules.user.service.IUserService;
@@ -42,6 +44,7 @@ import com.zhongzheng.modules.wx.service.IWxLoginService;
 import org.apache.commons.lang3.StringUtils;
 import org.springframework.beans.BeanUtils;
 import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
 import org.springframework.transaction.annotation.Transactional;
 
@@ -81,6 +84,10 @@ public class ExamActivityServiceImpl extends ServiceImpl<ExamActivityMapper, Exa
     private IUserService userService;
     @Autowired
     private IUserMockSubscribeService userMockSubscribeService;
+    @Autowired
+    private ISysTenantService sysTenantService;
+    @Value("${liveGotoURL}")
+    private String liveGotoURL;
 
     @Override
     @Transactional(rollbackFor = Exception.class)
@@ -210,10 +217,18 @@ public class ExamActivityServiceImpl extends ServiceImpl<ExamActivityMapper, Exa
 
     @Override
     public String getActivityApplyCode(Long activityId) {
+        ExamActivity activity = getById(activityId);
+        if (ObjectUtils.isNull(activity)){
+            throw new CustomException("活动不存在");
+        }
+        //H5域名
+        SysTenant tenant = sysTenantService.getById(activity.getTenantId());
+        String hostH5 = tenant.getHostH5();
         String urlBase64 = "";
         try {
             QRCodeWriter qrCodeWriter = new QRCodeWriter();
-            BitMatrix bitMatrix = qrCodeWriter.encode(String.format("pages5/mockExam/examApply?tid=%s",activityId), BarcodeFormat.QR_CODE, 120, 120);
+            BitMatrix bitMatrix = qrCodeWriter.encode(String.format("%s%s/pages5/mockExam/examApply?tid=%s",liveGotoURL,hostH5,activityId),
+                    BarcodeFormat.QR_CODE, 300, 300);
             // 写到输出流
             ByteArrayOutputStream outputStream = new ByteArrayOutputStream();
             MatrixToImageWriter.writeToStream(bitMatrix, "jpg", outputStream);

+ 19 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/impl/ExamApplyServiceImpl.java

@@ -139,6 +139,8 @@ public class ExamApplyServiceImpl extends ServiceImpl<ExamApplyMapper, ExamApply
     private String ZHONGZHENG_PROFILE;
     @Value("${exam.subscribeAddExamResult}")
     private String EXAM_SUBSCRIBE_SAVE_RESULT;
+    @Value("${exam.subscribeAddCertificate}")
+    private String EXAM_SUBSCRIBE_SAVE_RESULT_CERTIFICATE;
 
     @Override
     public ExamApplyVo queryById(Long applyId) {
@@ -1333,7 +1335,7 @@ public class ExamApplyServiceImpl extends ServiceImpl<ExamApplyMapper, ExamApply
             }
             bo.setApplyTime(DateUtils.dateTimeSec("yyyy-MM-dd",collect.get(0)));
             bo.setApplyStartTime(getTimeStr(collect.get(1)));
-            bo.setApplyEndTime(getTimeStr(collect.get(2)));
+            bo.setApplyEndTime(getTimeStr(collect.get(3)));
             bo.setTenantId(user.getTenantId());
             bo.setMajor(majorName);
             iUserSubscribeService.updateByIdNoTenant(subscribe);
@@ -1351,6 +1353,7 @@ public class ExamApplyServiceImpl extends ServiceImpl<ExamApplyMapper, ExamApply
             return "请勿上传空文件!";
         }
         List<String> msgList = new ArrayList<>();
+        List<ExamApplyCertificateBo> certificateBos = new ArrayList<>();
         files.forEach(multipartFile -> {
             //文件名= 身份证号码_岗位名称_证书编号_发证日期
             String fileName = multipartFile.getOriginalFilename();
@@ -1390,6 +1393,15 @@ public class ExamApplyServiceImpl extends ServiceImpl<ExamApplyMapper, ExamApply
             try {
                 String upload = ossService.upload(ossRequest);
                 subscribe.setCertificateUrl(upload);
+                ExamApplyCertificateBo examAp = new ExamApplyCertificateBo();
+                examAp.setCertificateUrl(upload);
+                examAp.setCertificateEndTime(timeTwo);
+                examAp.setCertificateStartTime(time);
+                examAp.setCertificateCode(collect.get(2));
+                examAp.setMajor(collect.get(1));
+                examAp.setIdCard(EncryptHandler.decrypt(user.getIdCard()));
+                examAp.setTenantId(user.getTenantId());
+                certificateBos.add(examAp);
             } catch (Exception e) {
 //                log.error("证书上传有误:"+collect.get(0));
                 msgList.add(multipartFile.getOriginalFilename());
@@ -1397,6 +1409,12 @@ public class ExamApplyServiceImpl extends ServiceImpl<ExamApplyMapper, ExamApply
             }
             iUserSubscribeService.updateByIdNoTenant(subscribe);
         });
+        //通知B端系统
+        if (CollectionUtils.isNotEmpty(certificateBos)){
+            String param = JSONArray.toJSONString(certificateBos);
+            Map<String, String> headersMap = new HashMap<>();
+            HttpUtils.sendPostJsonHeaderAsync(EXAM_SUBSCRIBE_SAVE_RESULT_CERTIFICATE, param, headersMap);
+        }
         return msgList.stream().collect(Collectors.joining(","));
     }
 

+ 2 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/exam/service/impl/ExamApplySiteServiceImpl.java

@@ -158,7 +158,7 @@ public class ExamApplySiteServiceImpl extends ServiceImpl<ExamApplySiteMapper, E
                 CdExamRoomUpdateBo roomBo = new CdExamRoomUpdateBo();
                 roomBo.setSignId(apply.getApplyId());
                 roomBo.setDataFrom(1);
-//                roomBo.setTenantId(apply.getTenantId());
+                roomBo.setTenantId(apply.getTenantId());
                 roomBo.setExamType(apply.getApplyNature());
                 roomBo.setExamTime(timeAddBo.getExamTime());
                 ExamApplySiteTimeTwoAddBo twoAddBo = timeAddBo.getExamApplySiteTimeTwo().stream().findFirst().orElse(null);
@@ -178,7 +178,7 @@ public class ExamApplySiteServiceImpl extends ServiceImpl<ExamApplySiteMapper, E
                 CdExamRoomBo roomBo = new CdExamRoomBo();
                 roomBo.setSignId(apply.getApplyId());
                 roomBo.setDataFrom(1);
-//                roomBo.setTenantId(apply.getTenantId());
+                roomBo.setTenantId(apply.getTenantId());
                 roomBo.setType(1);//七大员预约
                 roomBo.setExamType(apply.getApplyNature());
                 roomBo.setExamTime(timeAddBo.getExamTime());