he2802 1 год назад
Родитель
Сommit
c6d66a1b77
39 измененных файлов с 805 добавлено и 578 удалено
  1. 12 0
      run-prod.sh
  2. 7 2
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/common/CommonController.java
  3. 1 1
      zhongzheng-admin/src/main/java/com/zhongzheng/controller/schedule/ScheduleController.java
  4. 2 0
      zhongzheng-api/src/main/java/com/zhongzheng/controller/cmmon/CommonController.java
  5. BIN
      zhongzheng-common/src/main/resources/static/001.png
  6. BIN
      zhongzheng-common/src/main/resources/static/00312.jpg
  7. BIN
      zhongzheng-common/src/main/resources/static/004.jpg
  8. BIN
      zhongzheng-common/src/main/resources/static/004.png
  9. BIN
      zhongzheng-common/src/main/resources/static/2323.jpg
  10. 1 1
      zhongzheng-framework/src/main/java/com/zhongzheng/framework/config/MybatisPlusConfig.java
  11. 31 32
      zhongzheng-system/src/main/java/com/zhongzheng/modules/alioss/service/impl/OssServiceImpl.java
  12. 1 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/alisms/service/impl/AliSmsServiceImpl.java
  13. 2 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/bank/service/impl/ExamServiceImpl.java
  14. 133 5
      zhongzheng-system/src/main/java/com/zhongzheng/modules/base/service/impl/CertificateTpServiceImpl.java
  15. 6 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/base/vo/CertificatePhotoVo.java
  16. 4 5
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/bo/CourseModuleAddBo.java
  17. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/bo/CourseModuleEditBo.java
  18. 2 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/domain/CourseModule.java
  19. 2 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/service/impl/CourseServiceImpl.java
  20. 3 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseModuleVo.java
  21. 459 458
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsServiceImpl.java
  22. 4 0
      zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsVo.java
  23. 0 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/bo/ClassGradeUserQueryBo.java
  24. 26 10
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/ClassGradeUserServiceImpl.java
  25. 8 4
      zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/service/impl/UserPeriodServiceImpl.java
  26. 15 6
      zhongzheng-system/src/main/java/com/zhongzheng/modules/schedule/service/impl/ScheduleServiceImpl.java
  27. 8 3
      zhongzheng-system/src/main/java/com/zhongzheng/modules/system/service/impl/SysWebServiceImpl.java
  28. 5 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserCertificateAddBo.java
  29. 2 2
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserCertificateEditBo.java
  30. 6 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/domain/UserCertificate.java
  31. 1 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/mapper/UserMapper.java
  32. 10 5
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserBankRecordServiceImpl.java
  33. 1 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserExamWrongRecordServiceImpl.java
  34. 1 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserStudyRecordServiceImpl.java
  35. 9 1
      zhongzheng-system/src/main/java/com/zhongzheng/modules/user/vo/UserCertificateVo.java
  36. 2 2
      zhongzheng-system/src/main/resources/mapper/modules/course/CourseModuleMapper.xml
  37. 33 29
      zhongzheng-system/src/main/resources/mapper/modules/grade/ClassGradeUserMapper.xml
  38. 4 0
      zhongzheng-system/src/main/resources/mapper/modules/user/UserCertificateMapper.xml
  39. 2 2
      zhongzheng-system/src/main/resources/mapper/modules/user/UserStudyRecordMapper.xml

+ 12 - 0
run-prod.sh

@@ -1,3 +1,10 @@
+
+
+echo "开始等待20秒..."
+# 1-10秒内随机
+sleep 5
+echo "等待后继续"
+
 #!/usr/bin/env bash
 # 定义应用组名
 group_admin_name='zhongzheng'
@@ -32,3 +39,8 @@ docker run \
 -v /data/nginx/conf.d:/data/nginx/conf.d \
 -d ${group_admin_name}/${app_admin_name}:${app_admin_version}
 echo '----start container admin----'
+
+echo "开始等待20秒..."
+# 1-10秒内随机
+sleep 5
+echo "等待后继续"

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

@@ -32,6 +32,7 @@ import com.zhongzheng.modules.bank.service.IQuestionOtherService;
 import com.zhongzheng.modules.bank.service.IQuestionService;
 import com.zhongzheng.modules.bank.vo.QuestionVo;
 import com.zhongzheng.modules.base.bo.ConfigQueryBo;
+import com.zhongzheng.modules.base.service.ICertificateTpService;
 import com.zhongzheng.modules.course.bo.ExternalQuestionBo;
 import com.zhongzheng.modules.course.bo.ReplenishExamBo;
 import com.zhongzheng.modules.course.vo.CourseChapterVo;
@@ -166,6 +167,8 @@ public class CommonController extends BaseController {
     private IQuestionOtherService iQuestionOtherService;
     @Autowired
     private OssService ossService;
+    @Autowired
+    private ICertificateTpService iCertificateTpService;
     /**
      * 通用下载请求
      *
@@ -479,10 +482,11 @@ public class CommonController extends BaseController {
     }
 
     @ApiOperation("测试分班")
-    @GetMapping("common/jzs/grade")
-    public AjaxResult<Void> testGrade() {
+    @PostMapping("common/free/grade")
+    public AjaxResult<Void> testGrade(@RequestBody ClassGradeUserQueryBo bo) {
         //   iClassGradeService.checkEjjjPeopleNumLimit(195L,984L);
         //   iUserService.batchUpdateTelId();
+        iCertificateTpService.makeCertificatePhoto(bo);
         return AjaxResult.success();
     }
 
@@ -581,6 +585,7 @@ public class CommonController extends BaseController {
         if (!ToolsUtils.checkSignFromOldSys(bo.getStamp().toString(), bo.getSign())) {
             return AjaxResult.error("签名错误");
         }
+
         return AjaxResult.success("成功", iTopSysTenantRegisterService.insertByAddBo(bo) ? 1 : 0);
     }
 

+ 1 - 1
zhongzheng-admin/src/main/java/com/zhongzheng/controller/schedule/ScheduleController.java

@@ -403,7 +403,7 @@ public class ScheduleController extends BaseController {
         //茂名市建设培训学校 680980002459417532
         //肇庆市建筑业协会 480813706424615769
 //        List<String> tenantIds = Arrays.asList("972001468256950403", "680980002459417532", "480813706424615769");
-        List<String> tenantIds = Arrays.asList("335322347347308");
+        List<String> tenantIds = Arrays.asList("87440920140968","694515817698614");
         tenantIds.forEach(tenantId -> {
             iScheduleService.synchronizationGoodsByTenantId(tenantId);
         });

+ 2 - 0
zhongzheng-api/src/main/java/com/zhongzheng/controller/cmmon/CommonController.java

@@ -133,6 +133,8 @@ public class CommonController extends BaseController {
         return AjaxResult.success(wxLoginService.getWxInfo(query));
     }
 
+
+
     /**
      * 获取小程序首页链接
      */

BIN
zhongzheng-common/src/main/resources/static/001.png


BIN
zhongzheng-common/src/main/resources/static/00312.jpg


BIN
zhongzheng-common/src/main/resources/static/004.jpg


BIN
zhongzheng-common/src/main/resources/static/004.png


BIN
zhongzheng-common/src/main/resources/static/2323.jpg


+ 1 - 1
zhongzheng-framework/src/main/java/com/zhongzheng/framework/config/MybatisPlusConfig.java

@@ -26,7 +26,7 @@ public class MybatisPlusConfig {
 	public MybatisPlusInterceptor mybatisPlusInterceptor() {
 		MybatisPlusInterceptor interceptor = new MybatisPlusInterceptor();
 		// 多租户插件(注意:这个一定要放在最上面)
-		interceptor.addInnerInterceptor(new CustomTenantLineInnerInterceptor(customTenantLineHandler));
+		interceptor.addInnerInterceptor(new TenantLineInnerInterceptor(customTenantLineHandler));
 		// 分页插件
 		interceptor.addInnerInterceptor(paginationInnerInterceptor());
 		// 乐观锁插件

+ 31 - 32
zhongzheng-system/src/main/java/com/zhongzheng/modules/alioss/service/impl/OssServiceImpl.java

@@ -227,7 +227,7 @@ public class OssServiceImpl implements OssService {
                 RandomFilename = "file" + "/" +(sdf.format(new Date())) + "/" + now + ".zip";
                 break;
             case 11:
-                RandomFilename = "file/nuonuo" + "/" +(sdf.format(new Date())) + "/" + now + ".pdf";
+                RandomFilename = "file/pdf/" +(sdf.format(new Date())) + "/" + now + ".pdf";
                 break;
         }
 
@@ -289,6 +289,34 @@ public class OssServiceImpl implements OssService {
         }
     }
 
+    @Override
+    public String uploadWithUrl(OssRequest base, String urlString){
+        String path = null;
+        InputStream inputStream = null;
+        try {
+            URL url = new URL(urlString);
+            URLConnection con = url.openConnection();
+            //获取上传文件输入流
+            inputStream =con.getInputStream();
+            path = uploadInputStream(inputStream,base.getImageStatus());
+
+            // 关闭OSSClient。
+            //ossClient.shutdown();
+            return path;
+        } catch (Exception e) {
+
+        }finally {
+            try {
+                if (null != inputStream) {
+                    inputStream.close();
+                }
+            }catch (IOException e){
+
+            }
+            return path;
+        }
+    }
+
     @Override
     public String uploadInputStream(InputStream inputStream, Integer imageStatus) throws Exception {
         try {
@@ -374,8 +402,8 @@ public class OssServiceImpl implements OssService {
 
     @Override
     public InputStream getStreamByObject(String filePath) throws Exception {
-            OSSObject ossObject = ossClient.getObject(ALIYUN_OSS_BUCKET_NAME, filePath);
-            return ossObject.getObjectContent();
+        OSSObject ossObject = ossClient.getObject(ALIYUN_OSS_BUCKET_NAME, filePath);
+        return ossObject.getObjectContent();
     }
 
     @Override
@@ -404,35 +432,6 @@ public class OssServiceImpl implements OssService {
         }
     }
 
-    @Override
-    public String uploadWithUrl(OssRequest base, String urlString){
-        String path = null;
-        InputStream inputStream = null;
-        try {
-            URL url = new URL(urlString);
-            URLConnection con = url.openConnection();
-            //获取上传文件输入流
-            inputStream =con.getInputStream();
-            path = uploadInputStream(inputStream,base.getImageStatus());
-
-            // 关闭OSSClient。
-            //ossClient.shutdown();
-            return path;
-        } catch (Exception e) {
-
-        }finally {
-            try {
-                if (null != inputStream) {
-                    inputStream.close();
-                }
-            }catch (IOException e){
-
-            }
-            return path;
-        }
-    }
-
-
     public void zipFile(List<String> fileList, ZipOutputStream zipOut,String dir) {
         if (CollectionUtils.isEmpty(fileList)) {
             return;

+ 1 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/alisms/service/impl/AliSmsServiceImpl.java

@@ -91,6 +91,7 @@ public class AliSmsServiceImpl implements IAliSmsService {
         //发送带指定短信code带参数发送不同短信内容
         try{
             SendSmsResponse response = SmsUtils.sendSms(tel,SIGNNAME,code,param,ACCESSKEYID,ACCESSKEYSECRET);
+            LOGGER.error("发送短信结果:"+JSON.toJSONString(response));
             if(response.getBody().getMessage().equals("OK")){
                 SmsAddBo smsAddBo = new SmsAddBo();
                 smsAddBo.setCode(param);

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

@@ -351,7 +351,7 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements IE
 
     @Override
     public boolean getShanDongExam(Long userId,String majorname,Long relExamId) {
-        Boolean getNew = false;
+        Boolean getNew = true;
         User user = iUserService.getOne(new LambdaQueryWrapper<User>()
                 .eq(User::getUserId, userId).last("limit 1"));
         String idnum = user.getIdCard();
@@ -374,6 +374,7 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements IE
                 if (!respone.contains("\"msg\":\"获取成功\"")) {
                     throw new CustomException("同步请求错误" + respone);
                 }
+                System.out.println(respone);
                 QuestionOtherAddBo addBo = new QuestionOtherAddBo();
                 addBo.setJsonStr(respone);
                 addBo.setFromPlat(1);
@@ -382,7 +383,6 @@ public class ExamServiceImpl extends ServiceImpl<ExamMapper, Exam> implements IE
                 addBo.setRelExamId(relExamId);
                 Long id = iQuestionOtherService.insertByAddBo(addBo);
                 iQuestionOtherService.queryById(id);
-        //        System.out.println(respone);
             } catch (Exception e) {
                 throw new CustomException("同步请求错误" + e.getMessage());
             }

+ 133 - 5
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/service/impl/CertificateTpServiceImpl.java

@@ -34,6 +34,8 @@ import com.zhongzheng.modules.course.vo.CourseChapterVo;
 import com.zhongzheng.modules.course.vo.CourseMenuVo;
 import com.zhongzheng.modules.course.vo.CourseModuleVo;
 import com.zhongzheng.modules.course.vo.CourseVo;
+import com.zhongzheng.modules.course.service.IMajorService;
+import com.zhongzheng.modules.course.vo.*;
 import com.zhongzheng.modules.goods.bo.GoodsCourseQueryBo;
 import com.zhongzheng.modules.goods.service.IGoodsCourseService;
 import com.zhongzheng.modules.goods.service.IGoodsService;
@@ -101,7 +103,8 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
 
     @Autowired
     private ICourseModuleService iCourseModuleService;
-
+    @Autowired
+    private IMajorService iMajorService;
     @Value("${certificate.host}")
     private String CERTIFICATE_HOST;
 
@@ -193,10 +196,17 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
             //获取章列表
             List<CourseChapterVo> chapterList =  iClassGradeUserService.findChapterList(bo);
             BigDecimal totalTime = new BigDecimal(0);
+            BigDecimal publicTotalTime = new BigDecimal(0);
             for(CourseChapterVo chapterVo : chapterList){
-                totalTime=totalTime.add(new BigDecimal(courseMenuMapper.countChapterTotalTime(chapterVo.getChapterId())));
+                if(Validator.isEmpty(chapterVo.getCommonSign())||chapterVo.getCommonSign()==0){
+                    totalTime=totalTime.add(new BigDecimal(courseMenuMapper.countChapterTotalTime(chapterVo.getChapterId())));
+                }else if(chapterVo.getCommonSign()==1){
+                    publicTotalTime=publicTotalTime.add(new BigDecimal(courseMenuMapper.countChapterTotalTime(chapterVo.getChapterId())));
+                }
+
             }
             goodsVo.setClassHours(totalTime.divide(new BigDecimal(45*60),BigDecimal.ROUND_HALF_UP));
+            goodsVo.setPublicClassHours(publicTotalTime.divide(new BigDecimal(45*60),BigDecimal.ROUND_HALF_UP));
             if(Validator.isNotEmpty(goodsVo.getCertificateTpId())){
                 //        String[] s = goodsVo.getCertificateIds().split(",");
                 List<Long> tpIds = new ArrayList<>();
@@ -482,6 +492,43 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
             UserCertificateAddBo addBo = mergeData(bo,goodsVo,vo,tpVo.getTpId(),ossPath,moduleId);
             iUserCertificateService.insertByAddBo(addBo);
         }
+        else if("certificate09".equals(tpVo.getKeyValue())){
+            CertificatePhotoVo vo = new CertificatePhotoVo();
+            if(Validator.isEmpty(goodsVo.getMajorId())){
+                throw new CustomException("生成证书专业缺失");
+            }
+            if(Validator.isEmpty(userVo.getOneInchPhotos())){
+                throw new CustomException("生成证书一寸照片缺失");
+            }
+            MajorVo majorVo = iMajorService.queryById(goodsVo.getMajorId());
+            String onePhoto = userVo.getOneInchPhotos();
+            String code = "XYSGXC"+nowDate.substring(0, 4)+getCertificateCode();
+            vo.setOneInchPhotos(onePhoto);
+            vo.setCode(code);
+            vo.setRealname(userVo.getRealname());
+            vo.setIdCard(userVo.getIdCard());
+            String date = DateUtils.timestampToDate(goodsVo.getCreateTime());
+            vo.setYear(date.substring(0, 4));
+            vo.setMajor("施工现场专业人员");
+            String sex = "男";
+            if(Validator.isNotEmpty(userVo.getSex())&&userVo.getSex()==2){
+                sex = "女";
+            }
+            vo.setSex(sex);
+            vo.setClassHours(goodsVo.getClassHours().setScale( 0, BigDecimal.ROUND_HALF_UP )+"");
+            vo.setPublicClassHours(goodsVo.getPublicClassHours().setScale( 0, BigDecimal.ROUND_HALF_UP )+"");
+            vo.setDateY(nowDate.substring(0, 4));
+            vo.setDateM(nowDate.substring(5, 7));
+            vo.setDateD(nowDate.substring(8, 10));
+            vo.setMajor(majorVo.getCategoryName());
+            vo.setTrainStartTime(studyRecordVo.getFirstStartTime()); //培训开始时间
+            vo.setTrainEndTime(classGradeUser.getPeriodWaitTime());//学时变为待审核时间,也是学习完成时间
+            List<String> chapterListTxt = changeChapterList(chapterList);
+            vo.setChapterList(chapterListTxt);
+            String ossPath =drawPicSGXC(vo);
+            UserCertificateAddBo addBo = mergeData(bo,goodsVo,vo,tpVo.getTpId(),ossPath,moduleId);
+            iUserCertificateService.insertByAddBo(addBo);
+        }
     }
 
     private UserCertificateAddBo mergeData(ClassGradeUserQueryBo bo, GoodsVo goodsVo,CertificatePhotoVo vo,Long certificateTpId,String certificatePath,Long moduleId){
@@ -505,6 +552,7 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
         addBo.setChapterStr(ArrayUtils.toString(vo.getChapterList(), ","));
         addBo.setMoreCertificateStatus(goodsVo.getMoreCertificateStatus());
         addBo.setModuleId(moduleId);
+        addBo.setPublicClassHours(goodsVo.getPublicClassHours().setScale( 0, BigDecimal.ROUND_HALF_UP ));
         return addBo;
     }
     private String getCertificateCode(){
@@ -645,9 +693,7 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
             g.drawString(entity.getRemark1(), 1035, 408);
             g.drawString(entity.getRemark2(), 728, 460);
 
-         /*   g.drawString(entity.getDateY(), 707, 677);
-            g.drawString(entity.getDateM(), 783, 677);
-            g.drawString(entity.getDateD(), 835, 677);*/
+
 
             g.drawString(entity.getDateY(), 945, 677);
             g.drawString(entity.getDateM(), 1019, 677);
@@ -681,6 +727,88 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
         return imgName;
     }
 
+    private  String drawPicSGXC(CertificatePhotoVo entity){
+        Font font = new Font("微软雅黑", Font.PLAIN, 55);// 添加字体的属性设置 微软雅黑
+        Font font2 = new Font("微软雅黑", Font.BOLD, 58);
+        String imgName = null;
+        try {
+            // 加载图片
+            InputStream imgStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("static/004.jpg");
+            //        String imageLocalUrl = projectUrl + "003.jpg";
+            //         BufferedImage imageLocal = ImageIO.read(new File(imageLocalUrl));
+            BufferedImage imageLocal = ImageIO.read(imgStream);
+            // 以本地图片为模板
+            Graphics2D g = imageLocal.createGraphics();
+            g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
+            // 设置文本样式
+            g.setFont(font);
+            g.setColor(Color.BLACK);
+
+            InputStream oneInchPhotos =  ossService.getStreamByObject(entity.getOneInchPhotos());
+            BufferedImage oneInchBuffered = ImageIO.read(oneInchPhotos);
+            g.drawImage(oneInchBuffered, 430, 960, 300, 400, null);
+
+
+
+            g.drawString(entity.getCode(), 1235, 1245);
+            g.drawString(entity.getRealname(), 1235, 1011);
+            g.drawString(entity.getIdCard(), 1235, 1126);
+            g.drawString(entity.getMajor(), 1235, 1368);
+/*
+            g.drawString(entity.getDateY(), 780, 365);
+            g.drawString(entity.getDateM(), 905, 365);
+
+            g.drawString(entity.getRemark1(), 1035, 408);
+            g.drawString(entity.getRemark2(), 728, 460);
+*/
+
+            g.drawString(entity.getDateY(), 1332, 2973);
+            g.drawString(entity.getDateM(), 1594, 2973);
+            g.drawString(entity.getDateD(), 1781, 2973);
+
+            g.setFont(font2);
+            g.drawString(entity.getRealname(), 455, 1616);
+            g.drawString(entity.getDateY()+"年"+entity.getDateM()+"月"+entity.getDateD()+"日", 846, 1616);
+            g.drawString("施工现场专业人员", 1508, 1616);
+
+            g.drawString(entity.getDateY(), 311, 1770);
+            g.drawString(String.valueOf(Integer.parseInt(entity.getPublicClassHours())+Integer.parseInt(entity.getClassHours())), 1341, 1770);
+
+            g.drawString(entity.getPublicClassHours(), 311, 1920);
+            g.drawString(entity.getClassHours(), 881, 1920);
+
+            InputStream logoStream = Thread.currentThread().getContextClassLoader().getResourceAsStream("static/001.png");
+            BufferedImage logoBuffered = ImageIO.read(logoStream);
+            g.drawImage(logoBuffered, 1438, 2555, 529, 528, null);
+
+            //二维码
+            String qrTxt = CERTIFICATE_HOST+"pages/certificate/index?code="+entity.getCode();
+            QRCodeWriter qrCodeWriter = new QRCodeWriter();
+            BitMatrix bitMatrix = qrCodeWriter.encode(qrTxt, BarcodeFormat.QR_CODE, 360, 360);
+            BufferedImage qrImage = toBufferedImage(bitMatrix);
+            // 在模板上添加用户二维码(地址,左边距,上边距,图片宽度,图片高度,未知)
+            g.drawImage(qrImage, 324, 2583, 360, 360, null);
+            // 完成模板修改
+            g.dispose();
+            // 获取新文件的地址
+            // 生成新的合成过的用户二维码并写入新图片
+            //        ImageIO.write(imageLocal, "jpg", outputfile);
+            //上传OSS
+            InputStream is =  bufferedImageToInputStream(imageLocal);
+            String ossPath = ossService.uploadInputStream(is,7);
+            if(imgStream!=null){
+                imgStream.close();
+            }
+            return ossPath;
+        } catch (Exception e) {
+            e.printStackTrace();
+        }
+        // 返回给页面的图片地址(因为绝对路径无法访问)
+        //    imgName = Constants.PROJECT_URL + "codeImg/" + userId + ".png";
+
+        return imgName;
+    }
+
     public InputStream bufferedImageToInputStream(BufferedImage image){
         ByteArrayOutputStream os = new ByteArrayOutputStream();
         try {

+ 6 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/vo/CertificatePhotoVo.java

@@ -5,6 +5,7 @@ import io.swagger.annotations.ApiModel;
 import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 
+import java.math.BigDecimal;
 import java.util.List;
 
 
@@ -24,6 +25,8 @@ public class CertificatePhotoVo {
 	private String realname;
 	@ApiModelProperty("身份证号")
 	private String idCard;
+	@ApiModelProperty("一寸照片")
+	private String oneInchPhotos;
 
 	@ApiModelProperty("年份")
 	private String year;
@@ -54,5 +57,8 @@ public class CertificatePhotoVo {
 	/** 培训结束时间 */
 	@ApiModelProperty("培训结束时间")
 	private Long trainEndTime;
+	@Excel(name = "公共学时")
+	@ApiModelProperty("公共学时")
+	private String publicClassHours;
 
 }

+ 4 - 5
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/bo/CourseModuleAddBo.java

@@ -54,18 +54,17 @@ public class CourseModuleAddBo {
     /** 赠送卷ID */
     @ApiModelProperty("赠送卷ID")
     private Long freeExamId;
+
+    @ApiModelProperty("公共标识:1公共章 0非公共章")
+    private Integer commonSign;
     /** 证书类型ID */
-    @Excel(name = "证书类型ID")
     @ApiModelProperty("证书类型ID")
     private Long certificateTypeId;
     /** 证书ID */
-    @Excel(name = "证书ID")
     @ApiModelProperty("证书ID")
     private Long certificateId;
     /** 证书模板ID */
-    @Excel(name = "证书模板ID")
     @ApiModelProperty("证书模板ID")
     private Long certificateTpId;
-    @ApiModelProperty("公共标识:1公共章 0非公共章")
-    private Integer commonSign;
+
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/bo/CourseModuleEditBo.java

@@ -63,6 +63,7 @@ public class CourseModuleEditBo {
     /** 赠送卷ID */
     @ApiModelProperty("赠送卷ID")
     private Long freeExamId;
+
     /** 证书类型ID */
     @Excel(name = "证书类型ID")
     @ApiModelProperty("证书类型ID")
@@ -77,4 +78,5 @@ public class CourseModuleEditBo {
     private Long certificateTpId;
     @ApiModelProperty("公共标识:1公共章 0非公共章")
     private Integer commonSign;
+
 }

+ 2 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/domain/CourseModule.java

@@ -51,6 +51,7 @@ private static final long serialVersionUID=1L;
     private Long tenantId;
     @TableField(exist = false)
     private Long oId;
+
     /** 证书类型ID */
     @TableField(updateStrategy=FieldStrategy.IGNORED)
     private Long certificateTypeId;
@@ -62,4 +63,5 @@ private static final long serialVersionUID=1L;
     private Long certificateTpId;
     /** 公共标识:1公共章 0非公共章 */
     private String commonSign;
+
 }

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

@@ -304,9 +304,9 @@ public class CourseServiceImpl extends ServiceImpl<CourseMapper, Course> impleme
             }
         }
         if(entity.getCourseId()!=null){
-            if(baseMapper.checkCourseHaveStudy(entity.getCourseId()).longValue()>0){
+           /* if(baseMapper.checkCourseHaveStudy(entity.getCourseId()).longValue()>0){
                 throw new CustomException("该课程绑定的商品已有学习数据,无法操作");
-            }
+            }*/
         }
     }
 

+ 3 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/course/vo/CourseModuleVo.java

@@ -82,6 +82,7 @@ public class CourseModuleVo {
 	private Long freeExamId;
 	@ApiModelProperty("赠送卷名称")
 	private String freeExamName;
+
 	/** 证书类型ID */
 	@Excel(name = "证书类型ID")
 	@ApiModelProperty("证书类型ID")
@@ -94,6 +95,8 @@ public class CourseModuleVo {
 	@Excel(name = "证书模板ID")
 	@ApiModelProperty("证书模板ID")
 	private Long certificateTpId;
+
 	@ApiModelProperty("公共标识:1公共章 0非公共章")
 	private Integer commonSign;
+
 }

Разница между файлами не показана из-за своего большого размера
+ 459 - 458
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/service/impl/GoodsServiceImpl.java


+ 4 - 0
zhongzheng-system/src/main/java/com/zhongzheng/modules/goods/vo/GoodsVo.java

@@ -129,6 +129,10 @@ public class GoodsVo {
 	@Excel(name = "学时")
 	@ApiModelProperty("学时")
 	private BigDecimal classHours;
+
+	@Excel(name = "公共学时")
+	@ApiModelProperty("公共学时")
+	private BigDecimal publicClassHours;
 	/** 标准价格详情json */
 	@Excel(name = "标准价格详情json")
 	@ApiModelProperty("标准价格详情json")

+ 0 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/grade/bo/ClassGradeUserQueryBo.java

@@ -307,5 +307,4 @@ public class ClassGradeUserQueryBo extends BaseEntity {
 	@ApiModelProperty("1单证书 2多证书")
 	private Integer moreCertificateStatus;
 
-
 }

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

@@ -191,6 +191,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
     @Autowired
     private ISysOldOrgService sysOldOrgService;
 
+
     private String SEVEN_OFFICIALPUSH_INFOACCOUNT;
     private String SEVEN_OFFICIALPUSH_TOKEN;
 
@@ -749,6 +750,9 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         if (Validator.isEmpty(orderGoods.getSevenYear())) {
             return "商品年份缺失";
         }
+        if (orderGoods.getSevenYear().equals("2021")||orderGoods.getSevenYear().equals("2022")) {
+            return "2021/2022无法报名";
+        }
         if(Validator.isNotEmpty(configService.selectConfigByKeyNoCache("seven.office.account"))){
             SEVEN_OFFICIALPUSH_INFOACCOUNT = configService.selectConfigByKeyNoCache("seven.office.account");
             SEVEN_OFFICIALPUSH_TOKEN = configService.selectConfigByKeyNoCache("seven.office.token");
@@ -833,7 +837,14 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         if (Validator.isEmpty(datetime)) {
             throw new CustomException("数据错误");
         }
+        if(Validator.isNotEmpty(idCard)){
+            idCard = idCard.trim();
+        }
+        if(Validator.isNotEmpty(datetime)){
+            datetime = datetime.trim();
+        }
         String datetimeStr = datetime.substring(0, 8);
+        log.info("学时抽查"+idCard+"RR"+datetime);
         if (!DateUtils.dateTimeNow(DateUtils.YYYYMMDD).equals(datetimeStr)) {
             throw new CustomException("数据错误");
         }
@@ -921,6 +932,16 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         if (Validator.isEmpty(datetime)) {
             throw new CustomException("数据错误");
         }
+        if(Validator.isNotEmpty(idCard)){
+            idCard = idCard.trim();
+        }
+        if(Validator.isNotEmpty(datetime)){
+            datetime = datetime.trim();
+        }
+        if(Validator.isNotEmpty(year)){
+            year = year.trim();
+        }
+        log.info("七大员学时抽查"+idCard+"RR"+datetime+"RR"+year);
         String datetimeStr = datetime.substring(0, 8);
         if (!DateUtils.dateTimeNow(DateUtils.YYYYMMDD).equals(datetimeStr)) {
             throw new CustomException("数据错误");
@@ -975,14 +996,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         studentVo.setGoodsName(goods.getGoodsName());
         studentVo.setFullName(fullName);
         studentVo.setOrderGoodsId(orderGoods.getOrderGoodsId());
-        String userName = "erjian";
-        if(fullName.equals("继续教育二级建造师")){
-            studentVo.setGradeType(1);
-        }
-        if(fullName.equals("继续教育二级造价师")){
-            studentVo.setGradeType(2);
-            userName = "erzao";
-        }
+        String userName = "施工继教";
         SysUser sysUser = iSysUserService.getOne(new LambdaQueryWrapper<SysUser>()
                 .eq(SysUser::getUserName, userName).last("limit 1"));
         LoginUser loginUser = new LoginUser();
@@ -1199,7 +1213,9 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
         if (Validator.isEmpty(orderGoods)) {
             return "班级商品不存在";
         }
-
+        if (orderGoods.getSevenYear().equals("2021")||orderGoods.getSevenYear().equals("2022")) {
+            return "2021/2022无法报名";
+        }
        /* UserProfile userProfile = iUserProfileService.getOne(new LambdaQueryWrapper<UserProfile>()
                 .eq(UserProfile::getUserId, bo.getUserId()).eq(UserProfile::getGoodsId, orderGoods.getGoodsId())
                 .eq(UserProfile::getCurrentStatus, 1).eq(UserProfile::getTypeStatus, 1)
@@ -2986,7 +3002,7 @@ public class ClassGradeUserServiceImpl extends ServiceImpl<ClassGradeUserMapper,
                         if (Validator.isNotEmpty(classPeriodSectionVo.getStudyEndTime()) && ChapterEndTime.longValue() < classPeriodSectionVo.getStudyEndTime().longValue()) {
                             ChapterEndTime = classPeriodSectionVo.getStudyEndTime();
                         }
-                        if (ChapterStartTime == 0L || ChapterStartTime.longValue() > classPeriodSectionVo.getStudyStartTime().longValue()) {
+                        if ((ChapterStartTime == 0L&&Validator.isNotEmpty(classPeriodSectionVo.getStudyStartTime()) )|| (Validator.isNotEmpty(classPeriodSectionVo.getStudyStartTime())&&ChapterStartTime.longValue() > classPeriodSectionVo.getStudyStartTime().longValue())) {
                             ChapterStartTime = classPeriodSectionVo.getStudyStartTime();
                         }
                     }

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

@@ -76,6 +76,7 @@ import com.zhongzheng.modules.user.service.IUserService;
 import com.zhongzheng.modules.user.service.IUserStudyRecordPhotoService;
 import com.zhongzheng.modules.user.vo.UserVo;
 import com.zhongzheng.modules.wx.service.IWxLoginService;
+import org.apache.commons.lang3.StringUtils;
 import org.apache.commons.lang3.time.DateFormatUtils;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
@@ -970,6 +971,9 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
             respone = HttpUtils.postFormBody(SYNC_PATH, params);
             log.info("学时推送业务系统结果"+respone,"");
             if (!respone.contains("\"Status\":true")) {
+                if(Validator.isNotEmpty(respone)){
+                    respone = StringUtils.left(respone,300);
+                }
                 objectLambdaUpdateWrapper.set(ClassGradeUser::getToOldResult, respone);
                 objectLambdaUpdateWrapper.set(ClassGradeUser::getToOldStatus, -1);
                 iClassGradeUserService.update(null, objectLambdaUpdateWrapper);
@@ -1113,7 +1117,7 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
         if (bo.getStatus().equals(1)) {
             InformRemindVo informRemindVo = informRemindService.queryByName("二建继教学时初审通过");
             String content = "";
-            if (!CollectionUtils.isEmpty(informRemindVo.getInformRemindBusiness()) && !CollectionUtils.isEmpty(informRemindVo.getInformRemindBusiness().stream().filter(informRemindBusinessVo -> informRemindBusinessVo.getBusinessId().equals(goodsVo1.getBusinessId())).collect(Collectors.toList()))) {
+            if (Validator.isNotEmpty(informRemindVo)&&!CollectionUtils.isEmpty(informRemindVo.getInformRemindBusiness()) && !CollectionUtils.isEmpty(informRemindVo.getInformRemindBusiness().stream().filter(informRemindBusinessVo -> informRemindBusinessVo.getBusinessId().equals(goodsVo1.getBusinessId())).collect(Collectors.toList()))) {
                 if (informRemindVo.getWayStatus().equals(1)) {
                     InformUserAddBo informUserAddBo = new InformUserAddBo();
                     informUserAddBo.setUserId(bo.getUserId());
@@ -1158,7 +1162,7 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
             }
         } else {
             InformRemindVo informRemindTwoVo = informRemindService.queryByName("二建继教学时初审不通过");
-            if (!CollectionUtils.isEmpty(informRemindTwoVo.getInformRemindBusiness()) && !CollectionUtils.isEmpty(informRemindTwoVo.getInformRemindBusiness().stream().filter(informRemindBusinessVo -> informRemindBusinessVo.getBusinessId().equals(goodsVo1.getBusinessId())).collect(Collectors.toList()))) {
+            if (Validator.isNotEmpty(informRemindTwoVo)&&!CollectionUtils.isEmpty(informRemindTwoVo.getInformRemindBusiness()) && !CollectionUtils.isEmpty(informRemindTwoVo.getInformRemindBusiness().stream().filter(informRemindBusinessVo -> informRemindBusinessVo.getBusinessId().equals(goodsVo1.getBusinessId())).collect(Collectors.toList()))) {
                 String content = "";
                 if (informRemindTwoVo.getWayStatus().equals(1)) {
                     InformUserAddBo informUserAddBo = new InformUserAddBo();
@@ -1223,7 +1227,7 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
         GoodsVo goodsVo1 = iGoodsService.queryById(bo.getGoodsId());
         if (bo.getStatus().equals(1)) {
             InformRemindVo informRemindVo = informRemindService.queryByName("七大员新考学时初审通过");
-            if (!CollectionUtils.isEmpty(informRemindVo.getInformRemindBusiness()) && !CollectionUtils.isEmpty(informRemindVo.getInformRemindBusiness().stream().filter(informRemindBusinessVo -> informRemindBusinessVo.getBusinessId().equals(goodsVo1.getBusinessId())).collect(Collectors.toList()))) {
+            if (Validator.isNotEmpty(informRemindVo)&&!CollectionUtils.isEmpty(informRemindVo.getInformRemindBusiness()) && !CollectionUtils.isEmpty(informRemindVo.getInformRemindBusiness().stream().filter(informRemindBusinessVo -> informRemindBusinessVo.getBusinessId().equals(goodsVo1.getBusinessId())).collect(Collectors.toList()))) {
                 if (informRemindVo.getWayStatus().equals(1)) {
                     InformUserAddBo informUserAddBo = new InformUserAddBo();
                     informUserAddBo.setUserId(bo.getUserId());
@@ -1294,7 +1298,7 @@ public class UserPeriodServiceImpl extends ServiceImpl<UserPeriodMapper, UserPer
             }
         } else {
             InformRemindVo informRemindTwoVo = informRemindService.queryByName("七大员新考学时初审不通过");
-            if (!CollectionUtils.isEmpty(informRemindTwoVo.getInformRemindBusiness()) && !CollectionUtils.isEmpty(informRemindTwoVo.getInformRemindBusiness().stream().filter(informRemindBusinessVo -> informRemindBusinessVo.getBusinessId().equals(goodsVo1.getBusinessId())).collect(Collectors.toList()))) {
+            if (Validator.isNotEmpty(informRemindTwoVo)&&!CollectionUtils.isEmpty(informRemindTwoVo.getInformRemindBusiness()) && !CollectionUtils.isEmpty(informRemindTwoVo.getInformRemindBusiness().stream().filter(informRemindBusinessVo -> informRemindBusinessVo.getBusinessId().equals(goodsVo1.getBusinessId())).collect(Collectors.toList()))) {
                 String content = "";
                 if (informRemindTwoVo.getWayStatus().equals(1)) {
                     InformUserAddBo informUserAddBo = new InformUserAddBo();

+ 15 - 6
zhongzheng-system/src/main/java/com/zhongzheng/modules/schedule/service/impl/ScheduleServiceImpl.java

@@ -42,6 +42,7 @@ import com.zhongzheng.modules.distribution.domain.DistributionSeller;
 import com.zhongzheng.modules.distribution.service.IDistributionCashLogService;
 import com.zhongzheng.modules.distribution.service.IDistributionRebateService;
 import com.zhongzheng.modules.distribution.service.IDistributionSellerService;
+import com.zhongzheng.modules.distribution.service.impl.DistributionLinkServiceImpl;
 import com.zhongzheng.modules.distribution.vo.DistributionRebateVo;
 import com.zhongzheng.modules.exam.bo.*;
 import com.zhongzheng.modules.exam.domain.*;
@@ -129,6 +130,8 @@ import net.polyv.common.v1.util.StringUtils;
 import net.polyv.live.v1.entity.channel.playback.LiveChannelVideoListResponse;
 import net.polyv.live.v1.entity.channel.playback.LiveListChannelVideoLibraryResponse;
 import org.apache.commons.lang3.time.DateFormatUtils;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.beans.factory.annotation.Value;
 import org.springframework.stereotype.Service;
@@ -161,6 +164,8 @@ import java.util.stream.Stream;
 @Service
 public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVideo> implements IScheduleService {
 
+    private static Logger log = LoggerFactory.getLogger(ScheduleServiceImpl.class);
+
     @Autowired
     private IInformService informService;
 
@@ -488,10 +493,12 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
                     UserVo userVo = iUserService.queryById(goodsVo.getUserId());
                     Map<String, Object> param = new HashMap<>();
                     param.put("goods", goodsVo1.getGoodsName());
+                    log.info("购买发送短信:"+JSON.toJSONString(informUserAddBo));
+                    iInformUserService.insertByAddBo(informUserAddBo);
                     ResultBean rb = IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), OpenTheGoodsCode);
-                    if (Validator.isNotEmpty(rb)) {
-                        iInformUserService.insertByAddBo(informUserAddBo);
-                    }
+                    /*if (Validator.isNotEmpty(rb)) {
+
+                    }*/
                     if (voList.stream().allMatch(x -> !x.getGoodsId().equals(goodsVo.getGoodsId()))) {
                         goodsVo.setContext("尊敬的用户:您购买的" + goodsVo1.getGoodsName() + "已经开通,请尽快去学习吧。");
                         goodsVo.setGoodsName(goodsVo1.getGoodsName());
@@ -517,10 +524,12 @@ public class ScheduleServiceImpl extends ServiceImpl<PolyvVideoMapper, PolyvVide
                     Map<String, Object> param = new HashMap<>();
                     param.put("goods", goodsVo1.getGoodsName());
                     param.put("name", "");
+                    log.info("购买资料发送短信:"+JSON.toJSONString(informUserAddBo));
+                    iInformUserService.insertByAddBo(informUserAddBo);
                     ResultBean rb = IAliSmsService.sendInformSms(userVo.getTelphone(), JSON.toJSONString(param), informationNotificationCode);
-                    if (Validator.isNotEmpty(rb)) {
-                        iInformUserService.insertByAddBo(informUserAddBo);
-                    }
+                    /*if (Validator.isNotEmpty(rb)) {
+
+                    }*/
                     if (voList.stream().allMatch(x -> !x.getGoodsId().equals(goodsVo.getGoodsId()))) {
                         goodsVo.setContext("尊敬的用户:已为您开通了" + goodsVo1.getGoodsName() + "课程,本课程需完善信息方可学习,请尽快去完善资料吧。");
                         goodsVo.setGoodsName(goodsVo1.getGoodsName());

+ 8 - 3
zhongzheng-system/src/main/java/com/zhongzheng/modules/system/service/impl/SysWebServiceImpl.java

@@ -439,6 +439,11 @@ public class SysWebServiceImpl implements ISysWebService {
         else if(plat==3){
             filePath = "/www/public/live";
         }
+        String[] split = host.split("\\.");
+        String rootHost = "gdzzkj.net";
+        if(split.length==3){
+            rootHost = split[1]+'.'+split[2];
+        }
         String configParam = " server {\n" +
                 "    listen       80; # 同时支持HTTP\n" +
                 "    listen       443 ssl; # 添加HTTPS支持\n" +
@@ -449,8 +454,8 @@ public class SysWebServiceImpl implements ISysWebService {
                 "    }\n" +
                 "\n" +
                 "    #SSL配置\n" +
-                "    ssl_certificate      /mydata/nginx/ssl/gdzzkj.net.pem; # 配置证书\n" +
-                "    ssl_certificate_key  /mydata/nginx/ssl/gdzzkj.net.key; # 配置证书私钥\n" +
+                "    ssl_certificate      /mydata/nginx/ssl/%s.pem; # 配置证书\n" +
+                "    ssl_certificate_key  /mydata/nginx/ssl/%s.key; # 配置证书私钥\n" +
                 "    ssl_protocols        TLSv1 TLSv1.1 TLSv1.2; # 配置SSL协议版本 # 配置SSL加密算法\n" +
                 "    ssl_ciphers          ECDHE-RSA-AES128-GCM-SHA256:HIGH:!aNULL:!MD5:!RC4:!DHE;\n" +
                 "    ssl_prefer_server_ciphers  on; # 优先采取服务器算法\n" +
@@ -469,7 +474,7 @@ public class SysWebServiceImpl implements ISysWebService {
                     "        }\n" ;
         }
         configParam+="}\n";
-        String param = String.format(configParam, host, filePath);
+        String param = String.format(configParam, host, filePath,rootHost,rootHost);
         return param;
     }
 }

+ 5 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserCertificateAddBo.java

@@ -79,10 +79,14 @@ public class UserCertificateAddBo {
     /** 章名,拼接 */
     @ApiModelProperty("章名,拼接")
     private String chapterStr;
-    /** 课程id */
+
     @ApiModelProperty("模块id")
     private Long moduleId;
     /** 1单证书 2多证书 */
     @ApiModelProperty("1单证书 2多证书")
     private Integer moreCertificateStatus;
+
+    @ApiModelProperty("公共学时")
+    private BigDecimal publicClassHours;
+
 }

+ 2 - 2
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/bo/UserCertificateEditBo.java

@@ -88,8 +88,8 @@ public class UserCertificateEditBo {
     /** 章名,拼接 */
     @ApiModelProperty("章名,拼接")
     private String chapterStr;
-    /** 课程id */
-    @ApiModelProperty("课程id")
+    /** 模块id */
+    @ApiModelProperty("模块id")
     private Long moduleId;
     /** 1单证书 2多证书 */
     @ApiModelProperty("1单证书 2多证书")

+ 6 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/domain/UserCertificate.java

@@ -1,6 +1,7 @@
 package com.zhongzheng.modules.user.domain;
 
 import com.baomidou.mybatisplus.annotation.*;
+import io.swagger.annotations.ApiModelProperty;
 import lombok.Data;
 import lombok.NoArgsConstructor;
 import lombok.experimental.Accessors;
@@ -66,8 +67,12 @@ private static final long serialVersionUID=1L;
     private String pushDate;
     /** 章名,拼接 */
     private String chapterStr;
-    /** 课程id */
+
+    /** 模块id */
     private Long moduleId;
     /** 1单证书 2多证书 */
     private Integer moreCertificateStatus;
+
+    private BigDecimal publicClassHours;
+
 }

+ 1 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/mapper/UserMapper.java

@@ -32,7 +32,7 @@ public interface UserMapper extends BaseMapper<User> {
 
     List<User> selectListByBo(UserQueryBo bo);
 
-    @InterceptorIgnore(tenantLine = "true")
+//    @InterceptorIgnore(tenantLine = "true")
     List<User> selectListNoTenant(UserQueryBo bo);
 
     List<UserStudyRecordVo> selectStudyRecordList(UserStudyRecordQueryBo bo);

+ 10 - 5
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/service/impl/UserBankRecordServiceImpl.java

@@ -6,6 +6,7 @@ import cn.hutool.core.lang.Validator;
 import cn.hutool.core.util.StrUtil;
 import com.baomidou.mybatisplus.core.toolkit.ObjectUtils;
 import com.baomidou.mybatisplus.core.toolkit.StringUtils;
+import com.zhongzheng.common.core.redis.RedisCache;
 import com.zhongzheng.common.exception.CustomException;
 import com.zhongzheng.common.utils.DateUtils;
 import com.zhongzheng.common.utils.ServletUtils;
@@ -17,6 +18,7 @@ import com.zhongzheng.modules.course.service.ICourseBusinessService;
 import com.zhongzheng.modules.distribution.domain.DistributionCashWithdrawal;
 import com.zhongzheng.modules.exam.domain.ExamPaper;
 import com.zhongzheng.modules.exam.service.IExamPaperService;
+import com.zhongzheng.modules.goods.domain.GoodsAttached;
 import com.zhongzheng.modules.goods.service.IGoodsService;
 import com.zhongzheng.modules.goods.vo.GoodsVo;
 import com.zhongzheng.modules.grade.domain.UserPeriod;
@@ -51,6 +53,7 @@ import java.util.Calendar;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
+import java.util.concurrent.TimeUnit;
 import java.util.stream.Collectors;
 
 /**
@@ -96,10 +99,12 @@ public class UserBankRecordServiceImpl extends ServiceImpl<UserBankRecordMapper,
     @Autowired
     private IGoodsService iGoodsService;
 
-
     @Autowired
     private ICourseBusinessService iCourseBusinessService;
 
+    @Autowired
+    private RedisCache redisCache;
+
     private static Logger log = LoggerFactory.getLogger(UserBankRecordServiceImpl.class);
 
 
@@ -231,9 +236,9 @@ public class UserBankRecordServiceImpl extends ServiceImpl<UserBankRecordMapper,
             bakVo.setOrderGoodsId(null);
         }
         if(userBankRecordVo.getType()==1||userBankRecordVo.getType()==3){ //章卷 模块卷才进来
-            if (userStudyRecordMapper.selectStudyExamRecord(bakVo)  < 1 && Validator.isNotEmpty(add.getReportStatus())&& add.getReportStatus().equals(1)){
-                UserStudyRecordPhoto recordPhoto = userStudyRecordPhotoService.getOne(new LambdaQueryWrapper<UserStudyRecordPhoto>().eq(UserStudyRecordPhoto::getRecordId, userBankRecordVo.getRecordId()).eq(UserStudyRecordPhoto::getStatus,2).last("limit 1"));
-                if(Validator.isEmpty(recordPhoto)){
+            if (userStudyRecordMapper.selectStudyExamRecord(userBankRecordVo)  < 1 && Validator.isNotEmpty(add.getReportStatus())&& add.getReportStatus().equals(1)) {
+                UserStudyRecordPhoto recordPhoto = userStudyRecordPhotoService.getOne(new LambdaQueryWrapper<UserStudyRecordPhoto>().eq(UserStudyRecordPhoto::getRecordId, userBankRecordVo.getRecordId()).eq(UserStudyRecordPhoto::getStatus, 2).last("limit 1"));
+                if (Validator.isEmpty(recordPhoto)) {
                     GoodsVo goodsVo = iGoodsService.queryById(add.getGoodsId());
                     String fullName;
                     CourseBusinessQueryBo queryBusinessBo = new CourseBusinessQueryBo();
@@ -285,7 +290,7 @@ public class UserBankRecordServiceImpl extends ServiceImpl<UserBankRecordMapper,
             }
 
             //待重修
-            if (userStudyRecordMapper.selectStudyExamRecordOr(bakVo) > 0 && add.getReportStatus().equals(1)){
+            if (userStudyRecordMapper.selectStudyExamRecordOr(userBankRecordVo) > 0 && add.getReportStatus().equals(1)){
                 UserStudyRecordPhoto recordPhoto = userStudyRecordPhotoService.getOne(new LambdaQueryWrapper<UserStudyRecordPhoto>().eq(UserStudyRecordPhoto::getRecordId, userBankRecordVo.getRecordId()).eq(UserStudyRecordPhoto::getStatus,2).last("limit 1"));
                 if(Validator.isEmpty(recordPhoto)){
                     throw new CustomException("拍照次数不达标",559);

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

@@ -111,7 +111,7 @@ public class UserExamWrongRecordServiceImpl extends ServiceImpl<UserExamWrongRec
     public Boolean insertByAddBo(UserExamWrongRecordAddBo bo) {
         if(bo.getQuestionIds()==null||bo.getQuestionIds().size()==0){
 //            throw new CustomException("题目数组错误");
-            return false;
+            return true;
         }
         if(Validator.isEmpty(bo.getOrderGoodsId())){
             throw new CustomException("缺失订单商品ID");

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

@@ -1636,7 +1636,7 @@ public class UserStudyRecordServiceImpl extends ServiceImpl<UserStudyRecordMappe
             }
         }
         redisCache.setCacheObject(key, 100L,2, TimeUnit.SECONDS);
-        // 学习无记录加一条学时审核 记录
+
         if ( baseMapper.selectStudyRecord(bakStudyRecord) < 1) {
             UserPeriod userPeriod = new UserPeriod();
             userPeriod.setUserId(entity.getUserId());

+ 9 - 1
zhongzheng-system/src/main/java/com/zhongzheng/modules/user/vo/UserCertificateVo.java

@@ -114,8 +114,16 @@ public class UserCertificateVo {
 	@Excel(name = "章名,拼接")
 	@ApiModelProperty("章名,拼接")
 	private String chapterStr;
-	/** 课程id */
+
+	/** 模块id */
+	@Excel(name = "模块id")
+	@ApiModelProperty("模块id")
 	private Long moduleId;
 	/** 1单证书 2多证书 */
+	@Excel(name = "1单证书 2多证书")
+	@ApiModelProperty("1单证书 2多证书")
 	private Integer moreCertificateStatus;
+
+	private BigDecimal publicClassHours;
+
 }

+ 2 - 2
zhongzheng-system/src/main/resources/mapper/modules/course/CourseModuleMapper.xml

@@ -16,10 +16,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="code" column="code"/>
         <result property="examType" column="exam_type"/>
         <result property="freeExamId" column="free_exam_id"/>
+        <result property="commonSign" column="common_sign"/>
         <result property="certificateTypeId" column="certificate_type_id"/>
         <result property="certificateId" column="certificate_id"/>
         <result property="certificateTpId" column="certificate_tp_id"/>
-        <result property="commonSign" column="common_sign"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.course.vo.CourseModuleVo" id="CourseModuleResultVo">
@@ -38,10 +38,10 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="examType" column="exam_type"/>
         <result property="freeExamId" column="free_exam_id"/>
         <result property="freeExamName" column="free_exam_name"/>
+        <result property="commonSign" column="common_sign"/>
         <result property="certificateTypeId" column="certificate_type_id"/>
         <result property="certificateId" column="certificate_id"/>
         <result property="certificateTpId" column="certificate_tp_id"/>
-        <result property="commonSign" column="common_sign"/>
         <collection property="businessList" column="module_id" select="findBusinessList" />
         <collection property="courseList" column="module_id" select="findCourseList"/>
     </resultMap>

+ 33 - 29
zhongzheng-system/src/main/resources/mapper/modules/grade/ClassGradeUserMapper.xml

@@ -240,6 +240,7 @@
     <resultMap type="com.zhongzheng.modules.course.vo.CourseChapterVo" id="CourseChapterResultVo">
         <result property="chapterId" column="chapter_id"/>
         <result property="name" column="name"/>
+        <result property="commonSign" column="common_sign"/>
     </resultMap>
 
     <select id="selectUser" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo"
@@ -881,20 +882,20 @@
         order_goods og on og.goods_id = c.goods_id where og.order_goods_id=cgu.order_goods_id and m.type in (1,3) ) as exam_num,
         (SELECT COUNT(DISTINCT ubr.module_id,ubr.chapter_id, ubr.exam_id) FROM user_bank_record ubr  where ubr.`status` = 1 and ubr.`type` in (1,3) and ubr.report_status =1 and ubr.user_id=#{userId} and ubr.grade_id=cgu.grade_id and ubr.order_goods_id=cgu.order_goods_id and ubr.current_status=1) as record_num,
         (SELECT COUNT(DISTINCT up.course_id,up.module_id,up.chapter_id,up.section_id) FROM user_period up LEFT JOIN user_period_status ups on up.id = ups.period_id where
-        ups.`status` =1 and ups.period_status = 1 and up.goods_id=#{goodsId} and up.user_id = #{userId} and up.grade_id = cgu.grade_id and up.order_goods_id=cgu.order_goods_id and up.`type` = 1) as pass,
+        ups.`status` =1 and ups.period_status = 1 and up.goods_id=#{goodsId} and up.user_id = #{userId} and up.grade_id = cgu.grade_id and (up.order_goods_id=cgu.order_goods_id or up.order_goods_id is null) and up.`type` = 1) as pass,
         (SELECT COUNT(DISTINCT up.course_id,up.module_id,up.chapter_id,up.section_id) FROM user_period up LEFT JOIN user_period_status ups on up.id = ups.period_id where
-        ups.`status` =2 and up.grade_id = cg.grade_id  and ups.period_status = 1 and up.goods_id=#{goodsId} and up.grade_id = cg.grade_id and up.order_goods_id=cgu.order_goods_id and up.user_id = #{userId} and up.`type` = 1) as pending,
+        ups.`status` =2 and up.grade_id = cg.grade_id  and ups.period_status = 1 and up.goods_id=#{goodsId} and up.grade_id = cg.grade_id and (up.order_goods_id=cgu.order_goods_id or up.order_goods_id is null) and up.user_id = #{userId} and up.`type` = 1) as pending,
         (SELECT
         COUNT(DISTINCT up.course_id,up.module_id,up.chapter_id,up.section_id) FROM user_period up LEFT JOIN user_period_status ups on up.id = ups.period_id where ups.`status`
-        =0 and ups.period_status = 1 and up.goods_id=#{goodsId} and up.grade_id = cg.grade_id and up.order_goods_id=cgu.order_goods_id and  up.user_id = #{userId} and up.`type` = 1) as cheat,
+        =0 and ups.period_status = 1 and up.goods_id=#{goodsId} and up.grade_id = cg.grade_id and (up.order_goods_id=cgu.order_goods_id or up.order_goods_id is null) and  up.user_id = #{userId} and up.`type` = 1) as cheat,
         (SELECT COUNT(DISTINCT up.course_id,up.module_id,up.chapter_id,up.exam_id) FROM user_period up LEFT JOIN user_period_status ups on up.id = ups.period_id where
-        ups.`status` =1 and ups.period_status = 1 and up.goods_id=#{goodsId} and up.user_id = #{userId} and up.order_goods_id=cgu.order_goods_id and up.grade_id = cg.grade_id and up.`type` in (2,3)) as exam_pass,
+        ups.`status` =1 and ups.period_status = 1 and up.goods_id=#{goodsId} and up.user_id = #{userId} and (up.order_goods_id=cgu.order_goods_id or up.order_goods_id is null) and up.grade_id = cg.grade_id and up.`type` in (2,3)) as exam_pass,
         (SELECT
         COUNT(DISTINCT up.course_id,up.module_id,up.chapter_id,up.exam_id) FROM user_period up LEFT JOIN user_period_status ups on up.id = ups.period_id where ups.`status`
-        =0 and ups.period_status = 1 and up.goods_id=#{goodsId} and up.grade_id = cg.grade_id and up.order_goods_id=cgu.order_goods_id and up.user_id = #{userId} and up.`type`  in (2,3)) as exam_cheat,
+        =0 and ups.period_status = 1 and up.goods_id=#{goodsId} and up.grade_id = cg.grade_id and (up.order_goods_id=cgu.order_goods_id or up.order_goods_id is null) and up.user_id = #{userId} and up.`type`  in (2,3)) as exam_cheat,
         (SELECT
         COUNT(DISTINCT up.course_id,up.module_id,up.chapter_id,up.exam_id) FROM user_period up LEFT JOIN user_period_status ups on up.id = ups.period_id where ups.`status`
-        =2 and ups.period_status = 1 and up.goods_id=#{goodsId} and up.grade_id = cg.grade_id and up.order_goods_id=cgu.order_goods_id and up.user_id = #{userId} and up.`type`  in (2,3)) as exam_pending,
+        =2 and ups.period_status = 1 and up.goods_id=#{goodsId} and up.grade_id = cg.grade_id and (up.order_goods_id=cgu.order_goods_id or up.order_goods_id is null) and up.user_id = #{userId} and up.`type`  in (2,3)) as exam_pending,
         (SELECT up.key_value FROM user_profile up where up.goods_id = #{goodsId} and up.user_id =#{userId} and up.order_goods_id = cgu.order_goods_id and up.current_status = 1 and up.`status` = 1 and up.type_status =1 LIMIT 1) as key_value,
         (SELECT og.seven_year FROM order_goods og  where og.order_goods_id = cgu.order_goods_id ) as seven_year
         <if test="userId != null and userId !='' ">
@@ -1529,34 +1530,37 @@
 
     <select id="findChapterList" parameterType="com.zhongzheng.modules.grade.bo.ClassGradeUserQueryBo" resultMap="CourseChapterResultVo">
         SELECT ui.* from (SELECT
-            cc.chapter_id,
-            cc.`name`,
-            m.sort
+        cc.chapter_id,
+        cc.`name`,
+        m.sort,
+        cm.common_sign
         FROM
-            course_module_chapter p
-                LEFT JOIN course_chapter cc ON p.chapter_id = cc.chapter_id
-                LEFT JOIN course_menu m ON m.menu_id = p.module_id
-                LEFT JOIN goods_course gc ON gc.course_id = m.course_id
+        course_module_chapter p
+        LEFT JOIN course_chapter cc ON p.chapter_id = cc.chapter_id
+        LEFT JOIN course_menu m ON m.menu_id = p.module_id
+        LEFT JOIN goods_course gc ON gc.course_id = m.course_id
+        LEFT JOIN course_module cm ON p.module_id = cm.module_id
         WHERE
-            gc.goods_id = #{goodsId}
-            <if test="moduleId != null and moreCertificateStatus == 2 ">
-                AND p.module_id = #{moduleId}
-            </if>
-          AND m.type =  1 UNION
+        gc.goods_id = #{goodsId}
+        <if test="moduleId != null and moreCertificateStatus == 2 ">
+            AND p.module_id = #{moduleId}
+        </if>
+        AND m.type =  1 UNION ALL
         SELECT
-            cc.chapter_id,
-            cc.`name`,
-            m.sort
+        cc.chapter_id,
+        cc.`name`,
+        m.sort,
+         0 as common_sign
         FROM
-            course_menu m
-                LEFT JOIN course_chapter cc ON m.menu_id = cc.chapter_id
-                LEFT JOIN goods_course gc ON gc.course_id = m.course_id
+        course_menu m
+        LEFT JOIN course_chapter cc ON m.menu_id = cc.chapter_id
+        LEFT JOIN goods_course gc ON gc.course_id = m.course_id
         WHERE
-            gc.goods_id = #{goodsId}
-            <if test="moduleId != null and moreCertificateStatus == 2 ">
-                AND 1 = 0
-            </if>
-          AND m.type =  2)ui
+        gc.goods_id = #{goodsId}
+        <if test="moduleId != null and moreCertificateStatus == 2 ">
+            AND 1 = 0
+        </if>
+        AND m.type =  2)ui
         ORDER BY ui.sort
     </select>
 

+ 4 - 0
zhongzheng-system/src/main/resources/mapper/modules/user/UserCertificateMapper.xml

@@ -25,6 +25,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="year" column="year"/>
         <result property="pushDate" column="push_date"/>
         <result property="chapterStr" column="chapter_str"/>
+        <result property="moduleId" column="module_id"/>
+        <result property="moreCertificateStatus" column="more_certificate_status"/>
     </resultMap>
 
     <resultMap type="com.zhongzheng.modules.user.vo.UserCertificateVo" id="UserCertificateVoResult">
@@ -55,6 +57,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
         <result property="certificateName" column="certificate_name"/>
         <result property="keyValue" column="key_value"/>
         <result property="chapterStr" column="chapter_str"/>
+        <result property="moduleId" column="module_id"/>
+        <result property="moreCertificateStatus" column="more_certificate_status"/>
     </resultMap>
 
     <select id="selectMaxId"   resultType="Long">

+ 2 - 2
zhongzheng-system/src/main/resources/mapper/modules/user/UserStudyRecordMapper.xml

@@ -1215,7 +1215,7 @@
             and up.type = 3
         </if>
         <if test="orderGoodsId != null and orderGoodsId != '' ">
-            AND up.order_goods_id =  #{orderGoodsId}
+            AND (up.order_goods_id =  #{orderGoodsId} or up.order_goods_id is null)
         </if>
         AND up.user_id = #{userId}
     </select>
@@ -1292,7 +1292,7 @@
             and up.type = 3
         </if>
         <if test="orderGoodsId != null and orderGoodsId != '' ">
-            AND up.order_goods_id =  #{orderGoodsId}
+            AND (up.order_goods_id =  #{orderGoodsId} or up.order_goods_id is null)
         </if>
         AND up.user_id = #{userId}
         AND ups.period_status = 1

Некоторые файлы не были показаны из-за большого количества измененных файлов