change vor 3 Jahren
Ursprung
Commit
8776396c14

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

@@ -1,8 +1,12 @@
 package com.zhongzheng.modules.base.service.impl;
 
 import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.io.FileUtil;
 import cn.hutool.core.util.StrUtil;
+import cn.hutool.poi.word.Word07Writer;
 import com.zhongzheng.common.utils.DateUtils;
+import org.apache.poi.xwpf.usermodel.BreakType;
+import org.apache.poi.xwpf.usermodel.ParagraphAlignment;
 import org.springframework.stereotype.Service;
 import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
 import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
@@ -16,6 +20,7 @@ import com.zhongzheng.modules.base.mapper.UserProfileMapper;
 import com.zhongzheng.modules.base.vo.UserProfileVo;
 import com.zhongzheng.modules.base.service.IUserProfileService;
 
+import java.awt.*;
 import java.util.Collection;
 import java.util.Collections;
 import java.util.List;
@@ -102,4 +107,18 @@ public class UserProfileServiceImpl extends ServiceImpl<UserProfileMapper, UserP
         }
         return this.removeByIds(ids);
     }
+
+    public static void main(String[] args) {
+        Word07Writer writer =new Word07Writer();
+        // 添加段落(标题)
+        writer.addText(new Font("宋体",Font.BOLD,20),"我是第一部分","我是第二部分");
+        // 添加段落(正文)
+        writer.addText(new Font("宋体",Font.BOLD,20),"我是正文第一部分","我是正文第二部分");
+        // 关闭
+
+        // 写出到文件
+        writer.flush(FileUtil.file("D:\\Download/wordWrite.docx"));
+        // 关闭
+        writer.close();
+    }
 }

+ 3 - 0
zhongzheng-system/src/main/resources/mapper/modules/course/CourseMapper.xml

@@ -401,6 +401,9 @@
             g.*,
             cgu.grade_id,
                cgu.user_id,
+        (SELECT cet.education_name FROM  course_education_type cet  where cet.id = g.education_type_id) as education_name,
+        (SELECT cet.project_name FROM  course_project_type cet where cet.id = g.project_id) as project_name,
+        (SELECT cet.business_name FROM  course_business cet  where cet.id = g.business_id) as business_name,
         (SELECT COUNT(1) FROM goods_course gc where gc.goods_id = g.goods_id) as course_num,
         (case WHEN (SELECT COUNT(1) FROM exam_apply_goods eag LEFT JOIN exam_apply ea on eag.apply_id = ea.apply_id where eag.goods_id = cgg.goods_id and ea.`status` = 1 and unix_timestamp(now()) BETWEEN ea.apply_start_time and ea.apply_end_time) >0 then 1 ELSE 0 end) as apply_status,
         (case WHEN (SELECT COUNT(1) FROM exam_before_goods ebg LEFT JOIN exam_before eb on ebg.before_id = eb.before_id where ebg.goods_id = cgg.goods_id and eb.`status` = 1 and unix_timestamp(now()) BETWEEN eb.before_start_time and eb.before_end_time) >0 then 1 ELSE 0 end) as before_status,