he2802 3 anos atrás
pai
commit
1ae6fdb379

+ 14 - 12
zhongzheng-system/src/main/java/com/zhongzheng/modules/base/service/impl/CertificateTpServiceImpl.java

@@ -159,6 +159,8 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
         //获取章列表
         List<CourseChapterVo> chapterList =  iClassGradeUserService.findChapterList(bo);
         UserVo userVo = iUserService.queryById(bo.getUserId());
+        System.out.println("培训开始时间");
+        System.out.println(studyRecordVo.getFirstStartTime());
         if(Validator.isNotEmpty(goodsVo.getCertificateIds())){
             String[] s = goodsVo.getCertificateIds().split(",");
             List<Long> tpIds = new ArrayList<>();
@@ -186,7 +188,7 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
                     vo.setDateM(nowDate.substring(5, 7));
                     vo.setDateD(nowDate.substring(8, 10));
                     vo.setTrainStartTime(studyRecordVo.getFirstStartTime()); //培训开始时间
-                    vo.setTrainStartTime(classGradeUser.getPeriodWaitTime());//学时变为待审核时间,也是学习完成时间
+                    vo.setTrainEndTime(classGradeUser.getPeriodWaitTime());//学时变为待审核时间,也是学习完成时间
                     List<String> chapterListTxt = changeChapterList(chapterList);
                     vo.setChapterList(chapterListTxt);
                     String ossPath = drawPic(vo);
@@ -209,7 +211,7 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
                     vo.setDateM(nowDate.substring(5, 7));
                     vo.setDateD(nowDate.substring(8, 10));
                     vo.setTrainStartTime(studyRecordVo.getFirstStartTime()); //培训开始时间
-                    vo.setTrainStartTime(classGradeUser.getPeriodWaitTime());//学时变为待审核时间,也是学习完成时间
+                    vo.setTrainEndTime(classGradeUser.getPeriodWaitTime());//学时变为待审核时间,也是学习完成时间
                     List<String> chapterListTxt = changeChapterList(chapterList);
                     vo.setChapterList(chapterListTxt);
                     String ossPath = drawPic(vo);
@@ -240,7 +242,7 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
                     vo.setRemark1("其中必修");
                     vo.setRemark2("课 "+goodsVo.getClassHours()+" 学时,测试成绩合格。");
                     vo.setTrainStartTime(studyRecordVo.getFirstStartTime()); //培训开始时间
-                    vo.setTrainStartTime(classGradeUser.getPeriodWaitTime());//学时变为待审核时间,也是学习完成时间
+                    vo.setTrainEndTime(classGradeUser.getPeriodWaitTime());//学时变为待审核时间,也是学习完成时间
                     List<String> chapterListTxt = changeChapterList(chapterList);
                     vo.setChapterList(chapterListTxt);
                     String ossPath =drawPicOneBuild(vo);
@@ -270,7 +272,7 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
                     vo.setRemark1("其中建");
                     vo.setRemark2("筑工程课 "+goodsVo.getClassHours()+" 学时,测试成绩合格。");
                     vo.setTrainStartTime(studyRecordVo.getFirstStartTime()); //培训开始时间
-                    vo.setTrainStartTime(classGradeUser.getPeriodWaitTime());//学时变为待审核时间,也是学习完成时间
+                    vo.setTrainEndTime(classGradeUser.getPeriodWaitTime());//学时变为待审核时间,也是学习完成时间
                     List<String> chapterListTxt = changeChapterList(chapterList);
                     vo.setChapterList(chapterListTxt);
                     String ossPath =drawPicOneBuild(vo);
@@ -300,7 +302,7 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
                     vo.setRemark1("其中机");
                     vo.setRemark2("电工程课 "+goodsVo.getClassHours()+" 学时,测试成绩合格。");
                     vo.setTrainStartTime(studyRecordVo.getFirstStartTime()); //培训开始时间
-                    vo.setTrainStartTime(classGradeUser.getPeriodWaitTime());//学时变为待审核时间,也是学习完成时间
+                    vo.setTrainEndTime(classGradeUser.getPeriodWaitTime());//学时变为待审核时间,也是学习完成时间
                     List<String> chapterListTxt = changeChapterList(chapterList);
                     vo.setChapterList(chapterListTxt);
                     String ossPath =drawPicOneBuild(vo);
@@ -330,7 +332,7 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
                     vo.setRemark1("其中市");
                     vo.setRemark2("政公用工程课 "+goodsVo.getClassHours()+" 学时,测试成绩合格。");
                     vo.setTrainStartTime(studyRecordVo.getFirstStartTime()); //培训开始时间
-                    vo.setTrainStartTime(classGradeUser.getPeriodWaitTime());//学时变为待审核时间,也是学习完成时间
+                    vo.setTrainEndTime(classGradeUser.getPeriodWaitTime());//学时变为待审核时间,也是学习完成时间
                     List<String> chapterListTxt = changeChapterList(chapterList);
                     vo.setChapterList(chapterListTxt);
                     String ossPath =drawPicOneBuild(vo);
@@ -360,7 +362,7 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
                     vo.setRemark1("其中公");
                     vo.setRemark2("路工程课 "+goodsVo.getClassHours()+" 学时,测试成绩合格。");
                     vo.setTrainStartTime(studyRecordVo.getFirstStartTime()); //培训开始时间
-                    vo.setTrainStartTime(classGradeUser.getPeriodWaitTime());//学时变为待审核时间,也是学习完成时间
+                    vo.setTrainEndTime(classGradeUser.getPeriodWaitTime());//学时变为待审核时间,也是学习完成时间
                     List<String> chapterListTxt = changeChapterList(chapterList);
                     vo.setChapterList(chapterListTxt);
                     String ossPath =drawPicOneBuild(vo);
@@ -446,7 +448,7 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
             BufferedImage imageLocal = ImageIO.read(imgStream);
             // 以本地图片为模板
             Graphics2D g = imageLocal.createGraphics();
-
+            g.setRenderingHint(RenderingHints.KEY_ANTIALIASING,RenderingHints.VALUE_ANTIALIAS_ON);
             // 设置文本样式
             g.setFont(font);
             g.setColor(Color.DARK_GRAY);
@@ -506,7 +508,7 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
     }
 
     private  String drawPicOneBuild(CertificatePhotoVo entity){
-        Font font = new Font("宋体", Font.PLAIN, 20);// 添加字体的属性设置 微软雅黑
+        Font font = new Font("宋体", Font.BOLD, 20);// 添加字体的属性设置 微软雅黑
 
         String projectUrl = "D:\\test\\";
         String imgName = projectUrl + "out02.jpg";
@@ -518,7 +520,7 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
             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);
@@ -529,9 +531,9 @@ public class CertificateTpServiceImpl extends ServiceImpl<CertificateTpMapper, C
             g.drawString(entity.getIdCard(), 833, 315);
             g.drawString(entity.getDateY(), 780, 365);
             g.drawString(entity.getDateM(), 905, 365);
-            g.drawString(entity.getMajor(), 736, 408);
+            g.drawString(entity.getMajor(), 728, 408);
             g.drawString(entity.getRemark1(), 1035, 408);
-            g.drawString(entity.getRemark2(), 730, 460);
+            g.drawString(entity.getRemark2(), 728, 460);
 
             g.drawString(entity.getDateY(), 707, 677);
             g.drawString(entity.getDateM(), 783, 677);