Register

  • 点击获取
  •   

已有账号直接登录    

公告:

最新文章 测试文章

时间:2023-12-6 作者:RainFly   分类:   热度: 7°  评论:0  
时间:2023-12-6   分类:    热度:7   评论:0
package com.jq.web.controller.common; import com.baomidou.mybatisplus.core.toolkit.CollectionUtils; import com.itextpdf.text.pdf.PdfReader; import com.jq.common.config.JqConfig; import com.jq.common.core.domain.BaseEntity; import com.jq.common.core.domain.entity.SysAttachmentInfo; import com.jq.common.utils.DateUtils; import com.jq.common.utils.EmptyUtil; import com.jq.common.utils.RotateImage; import com.jq.common.utils.WordToPdfUtil; import com.jq.common.utils.file.FileUploadUtils; import com.jq.common.utils.pdf.PdfUtil; import com.jq.common.utils.poi.CustomXWPFDocument; import com.jq.project.domain.BaseCompanyUserCertFile; import com.jq.project.domain.HighProductCertFile; import com.jq.project.domain.HighResultCertFile; import com.jq.project.mapper.BaseCompanyUserCertFileMapper; import com.jq.project.mapper.HighProductCertFileMapper; import com.jq.project.mapper.HighResultCertFileMapper; import com.jq.system.mapper.SysAttachmentInfoMapper; import com.jq.system.service.SysAttachmentInfoService; import com.lowagie.text.exceptions.InvalidPdfException; import com.zhuozhengsoft.pageoffice.OfficeVendorType; import com.zhuozhengsoft.pageoffice.PageOfficeCtrl; import org.slf4j.Logger; import org.slf4j.LoggerFactory; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Component; import javax.imageio.ImageIO; import java.awt.*; import java.awt.image.BufferedImage; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.time.LocalDate; import java.util.*; import java.util.List; @Component public class BaseFileController { protected final Logger logger = LoggerFactory.getLogger(BaseFileController.class); @Autowired private SysAttachmentInfoService sysAttachmentInfoService; @Autowired private SysAttachmentInfoMapper sysAttachmentInfoMapper; @Autowired private HighProductCertFileMapper highProductCertFileMapper; @Autowired private HighResultCertFileMapper highResultCertFileMapper; @Autowired private BaseCompanyUserCertFileMapper baseCompanyUserCertFileMapper; @Autowired private JqConfig jqConfig; //100 -500 dpi private static int dpi = 230; /** * 创建唯一的附件数据。 返回附件实例对象。 * * @param relatePage * @param relateKey * @param relateId * @param fileOrgName * @return * @throws Exception */ public SysAttachmentInfo genDocxFilePath(String relatePage, String relateKey, Long relateId, String fileOrgName, int fileSize) throws Exception { JqConfig jqConfig = new JqConfig(); String diskPath = jqConfig.getDisk() + jqConfig.getUploadPath(); //清除相关数据 sysAttachmentInfoService.deleteByRelate(relatePage, relateKey, relateId); String extension = "docx"; SysAttachmentInfo sysAttachmentInfo = new SysAttachmentInfo(); sysAttachmentInfo.setRelatePage(relatePage); sysAttachmentInfo.setRelateKey(relateKey); sysAttachmentInfo.setRelateId(relateId); sysAttachmentInfo.setFileOrgName(fileOrgName); String fileName = UUID.randomUUID().toString().replaceAll("-", "") + "." + extension; String filePath = DateUtils.datePath(); sysAttachmentInfo.setFilePath(filePath + "/"); String location = filePath + "/" + fileName; String savePath = diskPath + filePath; File file = new File(savePath); if (!file.exists()) { file.mkdirs(); } sysAttachmentInfo.setFileType(extension); sysAttachmentInfo.setLocation(location); // 相对路径 sysAttachmentInfo.setFileName(fileName); sysAttachmentInfo.setFileSize(FileUploadUtils.getPrintSize(fileSize)); sysAttachmentInfo.setFileOrgName(fileOrgName); sysAttachmentInfo.setRelateId(relateId); sysAttachmentInfo.setUploadDate(new Date()); sysAttachmentInfo.setDelFlag("0"); sysAttachmentInfo.setUploadType("1"); //本地上传 // sysAttachmentInfo.setCreateBy(SecurityUtils.getUserName()); sysAttachmentInfo.setCreateTime(new Date()); Long attachId = sysAttachmentInfoService.insertSysattach(sysAttachmentInfo).getId(); sysAttachmentInfo.setId(attachId); return sysAttachmentInfo; } /** * @description 产品说明书将word转成pdf * @author liuxj * @date 2023/2/21 0021 */ public SysAttachmentInfo wordToPdfFile(SysAttachmentInfo sysAttachmentInfo) throws Exception { JqConfig jqConfig = new JqConfig(); //清除相关数据 sysAttachmentInfoService.deleteByRelate(sysAttachmentInfo.getRelatePage(), sysAttachmentInfo.getRelateKey(), sysAttachmentInfo.getRelateId()); String diskPath = jqConfig.getDisk() + jqConfig.getUploadPath(); String extension = "pdf"; SysAttachmentInfo attachmentInfo = new SysAttachmentInfo(); attachmentInfo.setRelatePage(sysAttachmentInfo.getRelatePage()); attachmentInfo.setRelateKey(sysAttachmentInfo.getRelateKey()); attachmentInfo.setRelateId(sysAttachmentInfo.getRelateId()); attachmentInfo.setFileOrgName(sysAttachmentInfo.getFileOrgName().replace(".docx", ".pdf")); String fileName = UUID.randomUUID().toString().replaceAll("-", "") + "." + extension; String filePath = DateUtils.datePath(); attachmentInfo.setFilePath(filePath + "/"); String location = filePath + "/" + fileName; String savePath = diskPath + filePath; WordToPdfUtil.word2pdf(diskPath + sysAttachmentInfo.getLocation(), savePath + "/" + fileName); File file = new File(savePath); if (!file.exists()) { file.mkdirs(); } attachmentInfo.setFileType(extension); attachmentInfo.setLocation(location); // 相对路径 attachmentInfo.setFileName(fileName); attachmentInfo.setUploadDate(new Date()); attachmentInfo.setDelFlag("0"); attachmentInfo.setUploadType("1"); //本地上传 attachmentInfo.setCreateTime(new Date()); Long attachId = sysAttachmentInfoService.insertSysattach(attachmentInfo).getId(); attachmentInfo.setId(attachId); return attachmentInfo; } public <T> List<String> genImgListFormAttach(List<T> list, String relateKey) throws Exception { List<SysAttachmentInfo> attachList = new ArrayList<>(); for (Object obj : list) { BaseEntity baseEntity = (BaseEntity) obj; List<SysAttachmentInfo> sysAttachmentInfoList = baseEntity.getAttachmentList(); for (SysAttachmentInfo sysAttachmentInfo : sysAttachmentInfoList) { if (sysAttachmentInfo.getRelateKey().equals(relateKey)) { attachList.add(sysAttachmentInfo); } } } //启用多线程, pdfImgList 转成 img List List<String> imgPathList = attachToImgList(attachList); return imgPathList; } public <T> List<SysAttachmentInfo> genAttachListFormAttach(List<T> list, String relateKey) throws Exception { List<SysAttachmentInfo> attachList = new ArrayList<>(); for (Object obj : list) { BaseEntity baseEntity = (BaseEntity) obj; List<SysAttachmentInfo> sysAttachmentInfoList = baseEntity.getAttachmentList(); for (SysAttachmentInfo sysAttachmentInfo : sysAttachmentInfoList) { if (sysAttachmentInfo.getRelateKey().equals(relateKey)) { attachList.add(sysAttachmentInfo); } } } return attachList; } /** * sysAttachmentInfo pdf 转 imgPathList * * @param sysAttachmentInfo * @return */ public List<String> attachToImgList(SysAttachmentInfo sysAttachmentInfo) throws Exception { List<SysAttachmentInfo> sysAttachmentInfoList = new ArrayList<>(); sysAttachmentInfoList.add(sysAttachmentInfo); return attachToImgList(sysAttachmentInfoList); } /** * pdf 文件列表转移 * * @param * @return */ public List<String> attachToImgList(List<SysAttachmentInfo> attachList) throws Exception { final String path = jqConfig.getDisk() + jqConfig.getUploadPath(); final String tempPath = jqConfig.getDisk() + jqConfig.getFolder() + DateUtils.datePath() + "/"; final List<String> imgPathList = new ArrayList<>(); String[] fileTypeArr = {"pdf", "png", "jpg", "jpeg", "PDF"}; List<String> fileTypeList = Arrays.asList(fileTypeArr); //先校验,增加效率 for (SysAttachmentInfo sysAttachmentInfo : attachList) { String filePath = path + sysAttachmentInfo.getLocation(); if (!new File(filePath).exists()) { throw new Exception("文件不存在: " + (null == sysAttachmentInfo.getFileBase() ? "" : sysAttachmentInfo.getFileBase()) + sysAttachmentInfo.getFileOrgName() + "," + sysAttachmentInfo.getLocation() + "!"); } if (!fileTypeList.contains(sysAttachmentInfo.getFileType())) { throw new Exception("文件类型不支持: " + sysAttachmentInfo.getFileName() + "," + sysAttachmentInfo.getLocation() + "!"); } if ("pdf".equals(sysAttachmentInfo.getFileType()) || "PDF".equals(sysAttachmentInfo.getFileType())) { try { PdfReader reader = new PdfReader(filePath); reader.unethicalreading = true; // 新加这段代码, 就能将密码报错问题解决 } catch (InvalidPdfException e) { throw new Exception("文件无法解密: " + sysAttachmentInfo.getFileName() + "," + sysAttachmentInfo.getFilePath() + "!"); } catch (Exception e) { e.printStackTrace(); throw new Exception("PDF解析错误: " + sysAttachmentInfo.getFileName() + "," + sysAttachmentInfo.getFilePath() + "!"); } } } //获取上传的所有附件 for (SysAttachmentInfo sysAttachmentInfo : attachList) { String filePath = path + sysAttachmentInfo.getLocation(); logger.info("【PDF转IMG】执行文件" + sysAttachmentInfo.getFileOrgName()); if (sysAttachmentInfo.getFileType().equals("pdf")) { if (EmptyUtil.isNullOrEmpty(sysAttachmentInfo.getImgFilePath())) { // 未解析图片 String imgFilePath = sysAttachmentInfo.getLocation().split(".pdf")[0]; int imgFileSize = PdfUtil.pdf2Png(path + sysAttachmentInfo.getLocation(), path + imgFilePath, dpi); sysAttachmentInfo.setImgFilePath(imgFilePath); sysAttachmentInfo.setImgFileSize(Long.valueOf(imgFileSize)); sysAttachmentInfoMapper.updateByPrimaryKeySelective(sysAttachmentInfo); } //拼接图片数据到imgPathList for (long i = 1; i <= sysAttachmentInfo.getImgFileSize(); i++) { String imgPath = path + sysAttachmentInfo.getImgFilePath() + "/" + i + ".png"; imgPathList.add(imgPath); } } else if (sysAttachmentInfo.getFileType().equals("PDF")) { if (EmptyUtil.isNullOrEmpty(sysAttachmentInfo.getImgFilePath())) { // 未解析图片 String imgFilePath = sysAttachmentInfo.getLocation().split(".PDF")[0]; int imgFileSize = PdfUtil.pdf2Png(path + sysAttachmentInfo.getLocation(), path + imgFilePath, dpi); sysAttachmentInfo.setImgFilePath(imgFilePath); sysAttachmentInfo.setImgFileSize(Long.valueOf(imgFileSize)); sysAttachmentInfoMapper.updateByPrimaryKeySelective(sysAttachmentInfo); } //拼接图片数据到imgPathList for (long i = 1; i <= sysAttachmentInfo.getImgFileSize(); i++) { String imgPath = path + sysAttachmentInfo.getImgFilePath() + "/" + i + ".png"; imgPathList.add(imgPath); } } else if (sysAttachmentInfo.getFileType().equals("png") || sysAttachmentInfo.getFileType().equals("jpg") || sysAttachmentInfo.getFileType().equals("jpeg")) { imgPathList.add(filePath); } } return formatImgList(imgPathList); } /** * @Description: pdfToImgList * @Author: xzl * @Date: 2023/5/15 10:49 */ public List<String> pdfToImgList(String pdfPath) throws Exception { if (!new File(pdfPath).exists()) { throw new Exception("文件不存在!"); } final List<String> imgPathList = new ArrayList<>(); String imgFilePath = pdfPath.split(".pdf")[0]; int imgFileSize = PdfUtil.pdf2Png(pdfPath, imgFilePath, dpi); //拼接图片数据到imgPathList for (long i = 1; i <= imgFileSize; i++) { String imgPath = imgFilePath + "/" + i + ".png"; imgPathList.add(imgPath); } return formatImgList(imgPathList); } public <T> List<String> genImgListFormCertFile(List<T> list) throws Exception { List<BaseEntity> baseEntityList = new ArrayList<>(); for (Object obj : list) { BaseEntity baseEntity = (BaseEntity) obj; baseEntityList.add(baseEntity); } //启用多线程, pdfImgList 转成 img List List<String> imgPathList = certToImgList(baseEntityList); return imgPathList; } /** * pdf 文件列表转移 * * @param * @return */ public List<String> certToImgList(List<BaseEntity> baseEntityList) throws Exception { final String path = jqConfig.getDisk() + jqConfig.getUploadPath(); final List<String> imgPathList = new ArrayList<>(); String[] fileTypeArr = {"pdf", "png", "jpg", "jpeg", "PDF"}; List<String> fileTypeList = Arrays.asList(fileTypeArr); //文件校验 for (BaseEntity certFileEntity : baseEntityList) { String filePath = path + certFileEntity.getFilePath(); if (!new File(filePath).exists()) { throw new Exception("文件不存在: " + (null == certFileEntity.getFileBase() ? "" : certFileEntity.getFileBase()) + certFileEntity.getFileName() + "," + certFileEntity.getFilePath() + "!"); } if (!fileTypeList.contains(certFileEntity.getFileType())) { throw new Exception("文件类型不支持: " + certFileEntity.getFileName() + "," + certFileEntity.getFilePath() + "!"); } if ("pdf".equals(certFileEntity.getFileType())) { try { PdfReader reader = new PdfReader(filePath); reader.unethicalreading = true; // 新加这段代码, 就能将密码报错问题解决 } catch (InvalidPdfException e) { throw new Exception("文件无法解密: " + certFileEntity.getFileName() + "," + certFileEntity.getFilePath() + "!"); } catch (Exception e) { e.printStackTrace(); throw new Exception("PDF解析错误: " + certFileEntity.getFileName() + "," + certFileEntity.getFilePath() + "!"); } } } //获取上传的所有附件 for (BaseEntity certFileEntity : baseEntityList) { logger.info("【PDF转IMG】执行文件" + certFileEntity.getFileName()); String filePath = path + certFileEntity.getFilePath(); if (certFileEntity.getFileType().equals("pdf")) { if (HighProductCertFile.class.equals(certFileEntity.getClass())) { //科技成果材料 HighProductCertFile highProductCertFile = (HighProductCertFile) certFileEntity; if (EmptyUtil.isNullOrEmpty(highProductCertFile.getImgFilePath())) { // 未解析图片 String imgFilePath = highProductCertFile.getFilePath().split(".pdf")[0]; int imgFileSize = PdfUtil.pdf2Png(filePath, path + imgFilePath, dpi); highProductCertFile.setImgFilePath(imgFilePath); highProductCertFile.setImgFileSize(Long.valueOf(imgFileSize)); highProductCertFileMapper.updateByPrimaryKeySelective(highProductCertFile); } //拼接图片数据到imgPathList for (long i = 1; i <= highProductCertFile.getImgFileSize(); i++) { String imgPath = path + highProductCertFile.getImgFilePath() + "/" + i + ".png"; imgPathList.add(imgPath); } } else if (HighResultCertFile.class.equals(certFileEntity.getClass())) { //证明文件材料 HighResultCertFile highResultCertFile = (HighResultCertFile) certFileEntity; if (EmptyUtil.isNullOrEmpty(highResultCertFile.getImgFilePath())) { // 未解析图片 String imgFilePath = highResultCertFile.getFilePath().split(".pdf")[0]; int imgFileSize = PdfUtil.pdf2Png(filePath, path + imgFilePath, dpi); highResultCertFile.setImgFilePath(imgFilePath); highResultCertFile.setImgFileSize(Long.valueOf(imgFileSize)); highResultCertFileMapper.updateByPrimaryKeySelective(highResultCertFile); } //拼接图片数据到imgPathList for (long i = 1; i <= highResultCertFile.getImgFileSize(); i++) { String imgPath = path + highResultCertFile.getImgFilePath() + "/" + i + ".png"; imgPathList.add(imgPath); } } else if (BaseCompanyUserCertFile.class.equals(certFileEntity.getClass())) { //证明文件材料 BaseCompanyUserCertFile userCertFile = (BaseCompanyUserCertFile) certFileEntity; if (EmptyUtil.isNullOrEmpty(userCertFile.getImgFilePath())) { // 未解析图片 String imgFilePath = userCertFile.getFilePath().split(".pdf")[0]; int imgFileSize = PdfUtil.pdf2Png(filePath, path + imgFilePath, dpi); userCertFile.setImgFilePath(imgFilePath); userCertFile.setImgFileSize(Long.valueOf(imgFileSize)); baseCompanyUserCertFileMapper.updateByPrimaryKeySelective(userCertFile); } //拼接图片数据到imgPathList for (long i = 1; i <= userCertFile.getImgFileSize(); i++) { String imgPath = path + userCertFile.getImgFilePath() + "/" + i + ".png"; imgPathList.add(imgPath); } } } else if (certFileEntity.getFileType().equals("png") || certFileEntity.getFileType().equals("jpg") || certFileEntity.getFileType().equals("jpeg")) { imgPathList.add(filePath); } } return formatImgList(imgPathList); } /** * 格式化图片尺寸,将长宽比大于1的图片 重新转档存储 ,位置不变 * * @return */ public List<String> formatImgList(List<String> imgPathList) throws Exception { final String tempPath = jqConfig.getDisk() + jqConfig.getFolder() + DateUtils.datePath() + "/"; File folder = new File(tempPath); if (!folder.exists()) { folder.mkdirs(); } List<String> reImgList = new ArrayList<>(); for (String path : imgPathList) { File file = new File(path); BufferedImage image = ImageIO.read(file); // 宽度 int width = image.getWidth(); // 高度 int height = image.getHeight(); logger.info("该解析文件的长宽比," + width + ":" + height); if (width - height > 0) { String imgFilePath = tempPath + UUID.randomUUID().toString().replaceAll("-", "") + ".png"; File newFile = new File(imgFilePath); image = RotateImage.Rotate(image, 270); ImageIO.write(image, "png", newFile); reImgList.add(imgFilePath); } else { reImgList.add(path); } } return reImgList; } public void insertImgToDoc(String docPath, String regionName, List<String> imgPath) throws Exception { new CustomXWPFDocument().runImg(docPath, regionName, imgPath); } public void insertImgListToDoc(String docPath, String regionName, List<String> imgPathList) throws Exception { long startTime = System.currentTimeMillis(); //获取开始时间 logger.info("Img插入Docx【正在执行】:" + imgPathList.size() + "张," + docPath); new CustomXWPFDocument().runImg(docPath, regionName, imgPathList); long endTime = System.currentTimeMillis(); //获取结束时间 logger.info("Img插入Docx【运行时间】: " + (endTime - startTime) / 1000 + "s"); //主要运行时间在磁盘保存时间较慢 图片尺寸较大 logger.info("Img插入Docx【完成】:" + imgPathList.size() + "张"); } public void updateFileSize(SysAttachmentInfo sysAttachmentInfo) throws Exception { if (!EmptyUtil.isNullOrEmpty(sysAttachmentInfo)) { String filePath = jqConfig.getDisk() + jqConfig.getUploadPath(); File file = new File(filePath + sysAttachmentInfo.getLocation()); sysAttachmentInfo.setFileSize(FileUploadUtils.getPrintSize(file.length())); sysAttachmentInfoService.saveOrUpdate(sysAttachmentInfo); } } /** * proportion 裁减比例 1代表裁剪百分之一 */ public List<String> cutImg(List<String> imagePath, int proportion) throws Exception { List<String> saveList = new ArrayList<>(); String tempPath = jqConfig.getDisk() + jqConfig.getFolder() + LocalDate.now() + "/"; for (String imageName : imagePath) { // 读取原图 File sourcePic = new File(imageName); try { BufferedImage sourceImage = ImageIO.read(sourcePic); int width = sourceImage.getWidth(); int height = sourceImage.getHeight(); // 边框裁减比例 int cutWidth = width * proportion / 100; int cutHeight = height * proportion / 100; // 左上角为原点 左边框多裁剪 右边框少裁剪 上下等比例裁剪 BufferedImage subImage = sourceImage.getSubimage(cutWidth * 6 / 5, cutHeight * 3 / 5, width - cutWidth * 2, height - cutHeight * 2); // 输出图片 String fileName = UUID.randomUUID().toString().replaceAll("-", "") + ".png"; File targetImage = new File(tempPath + fileName); if (!targetImage.exists()) { targetImage.mkdirs(); } ImageIO.write(subImage, "png", targetImage); saveList.add(tempPath + fileName); } catch (IOException e) { e.printStackTrace(); } } return saveList; } /** * 设置office默认类型 * * @param poCtrl * @param officeType 0/null 自动选择 1 WPS 2 Office */ public void setOfficeType(PageOfficeCtrl poCtrl, String officeType) { //客户端启动wps打开文件 if (EmptyUtil.isNullOrEmpty(officeType)) { poCtrl.setOfficeVendor(OfficeVendorType.AutoSelect); //自动启动客户机上最先安装的Office软件 } else if ("1".equals(officeType)) { poCtrl.setOfficeVendor(OfficeVendorType.WPSOffice); //客户端启动wps打开文件 } else if ("2".equals(officeType)) { poCtrl.setOfficeVendor(OfficeVendorType.MSOffice); //客户端启动word打开文件(默认值) } else { poCtrl.setOfficeVendor(OfficeVendorType.AutoSelect); //自动启动客户机上最先安装的Office软件 } } }

热门文章 联想拯救者R720安装黑苹果

时间:2022-7-30 作者:RainFly   分类: 计算机知识   热度: 3074°  评论:2  
时间:2022-7-30   分类: 计算机知识    热度:3074   评论:2
联想拯救者R720安装黑苹果

 CPU  核心显卡 Intel HD Graphics 630 2048 MB  独立显卡1050TI  蓝牙  声卡(支持HDMI音频输出)  WiFi  HDMI  睡眠唤醒 (HDMI外接显示器睡眠唤醒失效,需要热插拔)  隔空投送 安装前小知识

EFI系统分区 : 支持EFI模式的电脑需要从 ESP 启动系统,EFI固件可从ESP加载EFI启动程序或者应用。ESP是系统引导分区。

简而言之: 就是引导系统的一段汇编指令代码。

引导程序:

变色龙

Clover(四叶草)

[OpenCore](OpenCore Install Guide)

Windows PE

主要是用OpenCore 引导系统 。

一、基本参数:

CPU: I5-7300HQ

核心显卡: HD630

独立显卡 N1050Ti

MacOS : macOS Monterey 12.4

OpenCore:0.8.0

二、安装步骤: a)教程及相关资源:

新手挑战黑苹果-超详细的OpenCore黑苹果安装教程

视频下面参考资源地址:

1、macOS镜像下载:黑果小兵的部落阁 2、启动盘制作工具balenaEtcher下载:https://www.balena.io/etcher/ 3、OpenCore下载:https://github.com/acidanthera/OpenCorePkg/releases 4、OpenCore驱动下载:Gathering files | OpenCore Install Guide 5、OpenCore编辑器:Releases · ic005k/OCAuxiliaryTools · GitHub 6、OpenCore排错:https://opencore.slowgeek.com/ 7、磁盘精灵:数据恢复软件,硬盘分区工具,系统备份软件 - DiskGenius官方网站

黑果小兵的DMG镜像下载要注意使用以下这个版本

macOS Monterey 12.4 21F79 Installer for OpenCore 0.8.0 and CLOVER 5142 and FirPE.dmg

b) 参考EFI

EFI/1.zip

EFI/2.zip

参考上述两个大佬的EFI, 拿到1 进行引导启动安装都可以正常进入系统, 注意 三个分区选择openCore 启动引导 , 但是进入系统后 发现 蓝牙 WIFI HDMI外接 全部无法驱动。

c) 解决相关上述缺陷

WiFi 和蓝牙主要参考

关于在macOS 12 Monterey上驱动Intel网卡、蓝牙_华米OV的博客-CSDN博客_黑苹果intel蓝牙驱动

上述示例中主要注明 12系统中 可以提供多种驱动合集。 主要是引入以下两个驱动

显卡HDMI 驱动异常主要参考一下:

i7-9700k,UHD630核显,HDMI接口,usb3.0,成功黑苹果!-远景论坛-微软极客社区

自动更新关闭,并取消红点

如何取消Mac的小红点和忽略版本升级?

EFI 资源地址:

https://github.com/Rain-Fly/Lenovo-R720-MaoOs-OpenCore

热门文章 升级IDEA后Lombok失效

时间:2022-7-25 作者:RainFly   分类: Java   热度: 1045°  评论:1  
时间:2022-7-25   分类: Java    热度:1045   评论:1

搜索一番,是由于IDEA版本导致的Lombok失效,不过这个问题后来解决了。 所以,我们只需要更新lombok版本,使用1.18.14及之后的版本即可:

<dependency> <groupId>org.projectlombok</groupId> <artifactId>lombok</artifactId> <version>1.18.14</version> <scope>provided</scope> </dependency>

IDEA 插件 正常安装,需要升级 Lombok 版本 

参考 链接: https://blog.csdn.net/chinaherolts2008/article/details/118711313

热门文章 你们公司的 CTO(技术总监)平时都在做些什么?

时间:2022-6-16 作者:RainFly   分类: 生活哲理   热度: 1057°  评论:0  
时间:2022-6-16   分类: 生活哲理    热度:1057   评论:0

一. 创业初期

       在创业初期,我是那个亲手做东西的人,而且全面负责,从理论到实现,从加工到调试,什么要做做什么,什么不会学什么。第一代原型机就是在我手上诞生的。那时候我非常兴奋,每天睡4-6个小时,不用闹钟,是兴奋醒的。

我既是技术副总,又是技术总监,又是部门主管,又是一线员工。

二. 小团队

后来,招了几个人,就有了分工。

我给结构工程师讲了我的想法,让他去实现,他画好了给我看,我定稿。 告诉电路工程师仪器原理,让他改进我的电路,我帮他把关。 告诉软件工程师我想要什么样的功能,我设计构架,他来写软件。 告诉算法工程师我想实现什么效果,他实现了之后问我是不是这样的。 告诉调试工程师如何去调试,因为我最懂原理。 告诉应用工程师客户的需求,让他去尝试方法。

这个阶段,面临的是切割工作接口、协调分工合作、解决工作之间的冲突。

我的做法是民主集中,讨论畅所欲言,结束我来拍板。

这个阶段,一些工程师总是喜欢在我的设计上挑毛病。当然,只要他是想着把事情做好,这个我是包容的,就怕有的二逼在那里砸锅。记得有个FPGA工程师,我给他讲思路,他从一开始就怀着一种挑战对抗心理,以找我的毛病为工作目标。甚至在私下说我不懂瞎指挥。好,砸锅?那显然不是我们队伍里的人,我们之间无缘,你去挑战下一任雇主吧。

总之,那个阶段,我带领他们去完成我大脑中勾勒的那个蓝图。革命尚未成功,同志们去完成我所没有完成的那部分工作。

这样。第一代研发样机就做出来了。样机比原型机要好很多了,既稳定又漂亮,毕竟是专业的人做的专业的事。

这个阶段,我既是技术副总,又是技术总监,又是部门主管。参与和指导一线工作,但是不再负责一线工作,我褪掉了「一线员工」这个角色。

我的工作理念开始从管好自己向管好他人转变。主要工作就是想好做什么、做好规划、带领大家奔着一个目标努力。当然少不了还是要在一线指导。

这个阶段我睡的更少,既要靠激情、责任,还要靠闹钟。

三. 分级

再后来,队伍又大起来了,有了20多个人。

基本上每个岗位有几个人了。

这个时候的研发工作基于样机了,我亲手做的那台丑陋的原型机已经被放到了展厅。经过第二阶段,熟悉样机的人已经有好几个人了,而我却不能熟悉到每个细节,我把那些有组织能力而且技术水平较高的人提拔为部门主管。

这个时候,我不再去参与每一个细节(太多了顾不过来),基本上就是开会和追进度,不去一线战斗了。只有遇到原理的问题,部门主管才来找我探讨技术问题,找我支招。

我既是技术副总,又技术总监。我又褪掉了「部门主管」的角色。

我这个阶段的工作理念就是物色合适的人来做部门主管,我和他们一起来设计产品,做工作计划,监督实施。

我选拔的人越优秀,我参与具体研发工作就越少。我的计划定的越合理,大家工作的越和谐。

这个时候结构工程师说结构是他设计的,电路工程师说电路是他开发的,软件工程师说软件是他写的,算法工程师说算法是她研究的,调试工程师发现也有很多我解决不了的问题需要他们自己去琢磨……新来的员工感觉,他们的部门主管和老员工比我厉害多了,我对样机都不如他们主管熟悉。他们除了觉得职务上我比他们高外,其他的我啥都不行。甚至在他们眼里,这台仪器的研制我作为技术老大什么都没做。面对这种想法,我很开心,说明我选的主管很优秀,我留下的员工很能干。

在部门主管们的努力下,α版本的仪器出来了!我开始组建测试团队和生产团队,沟通市场团队去做客户试用,和生产团队对接试产。

这个阶段我睡觉更少了,因为要想的事情很多,我的考虑不合适会累死三军,每一步都如履薄冰,我不得不买了厚厚的一摞书,学习科学的管理方法。经常我睡到半夜就醒了,起来点上一根烟,接着工作。

四. 保证流程运转,物色优质人才,做甩手掌柜

经过α版本的试用迭代,产品完善很快,队伍进步也很快,转产流程也走通了,整个工作流程可以完整的运行。

就这样,β版本产品很快出炉!

面对这台仪器,我已经不能像了解我的手一样了解它了。员工们都认为这台仪器不是我做的,是大家集体智慧的结晶。当我感到大家有这种想法的时候,我很高兴,说明大家参与感很强,团队很凝聚。

我物色了一个非常靠谱,而且很机灵的员工,让他做了测试部门的主管。仪器能不能过关,我只问他,他只对我负责。这样我对产品的品质也不用自己亲自去把关了。

我依然担任着技术副总,兼任技术总监的工作,工作理念已经基本转换到管人。等到物色到合适的人,时机合适的时候我再褪去技术总监的角色。

现在,我的工作就是和总经理开会制订年度计划,和产品经理们开会对接需求,和部门主管开会制订工作计划、听汇报,和人事部门主管一起物色优秀人才。顺带作为公司技术负责人带带实习生,在适当的时候给大家鼓鼓劲。

只要工作流程能顺利运转,所有的开发工作都像水一样在各部门流动,最终流出来就是合格的产品。我协调各方保证流通的顺畅,就可以下班回家休息了。

实际上是可以这样的,但是我没有。我还在加班加点,很多时候是看书和想事情,完全是爱好和个人的工作态度。

我越来越多的在想如何能让这个流程更有效、更简洁、更顺畅,还要思考如何让团队更有战斗力,那就是选对合适的人到合适的岗位。

研发工作,好像工程师们普遍觉得我根本就没干,我已然成为公司中可有可无的那个人。无所谓,评价我的不是员工,而是总经理和董事会。

五. 科学化、新挑战

上面是我野路子方式完成从0到1的CTO成长之路,整个过程不是从顶层设计开始的。

通过学习、实践和思考,现在我已经能够从顶层设计去实现一个团队的组建和管理。

于是,去年我受邀加入一家新的初创公司,出任总经理,自己又是0号员工。

从公司成立,我就开始组建团队,采用IPD研发管理模式。新公司,我一开始好像就没有做具体的研发工作,很多新同事认为我什么都不会,就会制定规则、开会和评审,然后就是写写文档、看看手机,以及喝茶和抽烟。

作者:刘皇叔 链接:https://www.zhihu.com/question/264361601/answer/2344457559 来源:知乎 著作权归作者所有。商业转载请联系作者获得授权,非商业转载请注明出处。

热门文章 Ubuntu14.04如何安装JDK1.7Tomcat7

时间:2019-2-16 作者:RainFly   分类: Java   热度: 5316°  评论:23  
时间:2019-2-16   分类: Java    热度:5316   评论:23

1.首先先准备好    jdk1.7 linux  和tomcat7的安装包(这里使用的是jdk linux 32位的 文章底部奉上需要的安装包)

    

2. 将包文件拷贝到用户目录 我这里是 /home/rain/

3.解压 jdk文件  和tomcat文件

tar -zxvf a*****

4.打开 vim  /etc/profile   在最后一行插入下面的数据

#set java environment JAVA_HOME=/home/rain/jdk1.7.0_80 JRE_HOME=/home/rain/jdk1.7.0_80/jre CLASS_PATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib PATH=$PATH:$JAVA_HOME/bin:$JRE_HOME/bin export JAVA_HOME JRE_HOME CLASS_PATH PATH

注意需要将上面的/home/rain/** 目录替换成自己jdk的目录

5. 输入 source /etc/profile  刷新环境变量后  输入 java -version 查看控制台

    如果显示当前数据表示jdk已经完成安装了

6.进入解压后的tomcat 目录中 找到bin目录并进入

      直接在命令行输入  ./catalina.sh  run   如果出现以下的信息表示启动完成了,直接通过浏览器访问 Http:xxx.xxx.xxx.xxx:8080/

热门文章 浏览器/iframe 全屏、退出全屏

时间:2018-9-21 作者:RainFly   分类: Web程序设计   热度: 8916°  评论:13  
时间:2018-9-21   分类: Web程序设计    热度:8916   评论:13

外面的 html 文件 index.html:

    

<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> <title>fullScreen</title> <style> body { margin: 0; } </style> </head> <body> <iframe allowfullscreen src="iframe.html" frameborder="0" style="width: 500px;height: 500px;background:#aaa"></iframe> </body> </html>

里面嵌套的 iframe.html 文件:

<!DOCTYPE html> <html lang="en"> <head> <meta charset="utf-8"> </head> <body> <h1>iframe</h1> <button id="button">全屏</button> <script> // 判断是否允许全屏 var fullscreenEnabled = document.fullscreenEnabled || document.mozFullScreenEnabled || document.webkitFullscreenEnabled || document.msFullscreenEnabled; // 全屏 function launchFullscreen(element) { if (element.requestFullscreen) { element.requestFullscreen(); } else if (element.mozRequestFullScreen) { element.mozRequestFullScreen(); } else if (element.msRequestFullscreen) { element.msRequestFullscreen(); } else if (element.webkitRequestFullscreen) { element.webkitRequestFullScreen(); } } // 退出全屏 function exitFullscreen() { if (document.exitFullscreen) { document.exitFullscreen(); } else if (document.msExitFullscreen) { document.msExitFullscreen(); } else if (document.mozCancelFullScreen) { document.mozCancelFullScreen(); } else if (document.webkitExitFullscreen) { document.webkitExitFullscreen(); } } var btn = document.querySelector('#button'); if (fullscreenEnabled) { btn.addEventListener('click', function () { var fullscreenElement = document.fullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement; if (fullscreenElement) { exitFullscreen(); btn.innerHTML = '全屏'; } else { launchFullscreen(document.documentElement); btn.innerHTML = '退出全屏'; } }, false); } // 监听全屏事件 document.addEventListener('webkitfullscreenchange', function fullscreenChange() { if (document.fullscreenEnabled || document.webkitIsFullScreen || document.mozFullScreen || document.msFullscreenElement) { console.log('enter fullscreen'); } else { console.log('exit fullscreen'); } }, false); </script> </body> </html>

热门文章 单checkBox选中,和检查是否勾选事件

热门文章 如何提取SVN中Eclipse、maven构建工程导入到IntelligIDEA中?

时间:2018-8-1 作者:RainFly   分类: Java   热度: 4885°  评论:2  
时间:2018-8-1   分类: Java    热度:4885   评论:2

本地有一个工程使用的是Eclipse maven构建的,由于需要将其移动到IDEA中开发,继而将导入步骤做出一下记录,方便查阅

第一步  打开IDEA checkout 源文件

     本地需要先安装SVN工具  command line dient tools 必须安装     -> 传送门

      

    

    

选中一个目录 提取到该目录下面 (一般选择第二个)  E:\idea_project\chouchou

        

直接导入Eclipse 模型 (maven 配置后面会自动检测) 一直下一步 下一步  是

如果导入的工程目录文件夹错误           ,

    

将工程导入到IDEA后 系统会在右下角提示这是一个maven 工程(不要急着构建maven工程 先将lib下面的 包引入到工程中)  put into  WEB-INF/lib  下面

    

点击右侧 导航条 的maven      (此步骤可以省略)    

打开项目结构  (导航栏上方按钮)

   

修改 SDK   我用的是jdk 1.7   及 非maven jar 包  导入

点击 jars 或目录 

添加 Artifacts

查看刚才加入 的外部lib 有没有复制到 WEB-INF/lib/ 下面   如果没用 在右侧加入

打开设置 配置本地的maven

配置一个tomcat 就可以运行启动了

注意上述 完成 需要用 war exploded 来调试   文件发布 ,不要用war 包发布 ,修改 jsp之类的静态文件 不会自动更新

如果导入的工程文件        结构混乱 

按下列步骤操作: 1. 关闭IDEA,  2.然后删除项目文件夹下的.idea文件夹 3.重新用IDEA工具打开项目

如果导入的工程 出现找不到配置文件 (resource)

项目的pom 文件需要 引入以下maven 配置支撑

<build> <finalName>high-tech</finalName> <plugins> <!-- 更改maven默认的打包目录 --> <plugin> <artifactId>maven-war-plugin</artifactId> <configuration> <webappDirectory>${basedir}/src/main/webapp</webappDirectory> <warSourceDirectory>${basedir}/src/main/webapp</warSourceDirectory> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-compiler-plugin</artifactId> <version>2.3.2</version> <configuration> <source>1.7</source> <target>1.7</target> <encoding>utf8</encoding> </configuration> </plugin> <plugin> <groupId>org.apache.maven.plugins</groupId> <artifactId>maven-dependency-plugin</artifactId> <version>2.7</version> <executions> <execution> <phase>package</phase> <goals> <goal>copy-dependencies</goal> </goals> </execution> </executions> <configuration> <includeScope>system</includeScope> <outputDirectory>${basedir}/src/main/webapp/WEB-INF/lib</outputDirectory> </configuration> </plugin> </plugins> <resources> <resource> <directory>src/main/java</directory> <includes> <include>**/*.xml</include> </includes> </resource> </resources> </build>

热门文章 Ubuntu14.04安装jdk7+tomcat7+mysql5

时间:2018-7-31 作者:RainFly   分类: Java   热度: 5960°  评论:0  
时间:2018-7-31   分类: Java    热度:5960   评论:0

一 、官网下载JDK 

    1.进入Oracle 官网下载 jdk   http://www.oracle.com/technetwork/java/javase/downloads/java-archive-downloads-javase7-521261.html

二、解压配置

    将JDK目录解压到 

tar -zxvf jdk-7u80-linux-i586.tar.gz mv jdk-7u80-linux-i586.tar.gz/ /usr/lib/jvm 或者 tar -zxvf jdk-7u60-linux-x64.gz -C /usr/lib/jvm

三、配置环境变量

    vim ~/.bashrc

    文章末尾

    

#set oracle jdk environment export JAVA_HOME=/usr/lib/jvm/jdk1.7.0_60 ## 这里要注意目录要换成自己解压的jdk 目录 export JRE_HOME=${JAVA_HOME}/jre export CLASSPATH=.:${JAVA_HOME}/lib:${JRE_HOME}/lib export PATH=${JAVA_HOME}/bin:$PATH

刷新环境变量

     source ~/.bashrc

 测试

    java -version

下载配置tomcat7

官网下载tomcat   https://tomcat.apache.org/download-70.cgi

解压    cd /usr/local/tomcat/       bin/  目录下面路径可以直接执行

关于 Server.XML  配置 

   https://www.cnblogs.com/kismetv/p/7228274.html

热门文章 SSM框架 spring配置文件

时间:2018-4-18 作者:RainFly   分类: Java   热度: 14659°  评论:5  
时间:2018-4-18   分类: Java    热度:14659   评论:5
<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" xmlns:tx="http://www.springframework.org/schema/tx" xmlns:jdbc="http://www.springframework.org/schema/jdbc" xmlns:context="http://www.springframework.org/schema/context" xmlns:mvc="http://www.springframework.org/schema/mvc" xsi:schemaLocation=" http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.0.xsd http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.0.xsd http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd http://www.springframework.org/schema/tx http://www.springframework.org/schema/tx/spring-tx-3.0.xsd http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-3.0.xsd http://www.springframework.org/schema/mvc http://www.springframework.org/schema/mvc/spring-mvc.xsd"> <!-- spring的配置文件 一般写入数据源 事务控制 mybatis扫描 mapper 文件中 IOC控制器中 --> <!-- 扫描service 层下面所有的 @Server 加入ICO容器中 --> <context:annotation-config /> <context:component-scan base-package="com.rain.service" /> <bean id="dataSource" class="com.alibaba.druid.pool.DruidDataSource" init-method="init" destroy-method="close"> <!-- 基本属性 url、user、password --> <property name="url" value="jdbc:mysql://localhost:3306/power?characterEncoding=UTF-8" /> <property name="username" value="root" /> <property name="password" value="root" /> <property name="driverClassName" value="com.mysql.jdbc.Driver" /> <!-- 配置初始化大小、最小、最大 --> <property name="initialSize" value="3" /> <property name="minIdle" value="3" /> <property name="maxActive" value="20" /> <!-- 配置获取连接等待超时的时间 --> <property name="maxWait" value="60000" /> <!-- 配置间隔多久才进行一次检测,检测需要关闭的空闲连接,单位是毫秒 --> <property name="timeBetweenEvictionRunsMillis" value="60000" /> <!-- 配置一个连接在池中最小生存的时间,单位是毫秒 --> <property name="minEvictableIdleTimeMillis" value="300000" /> <property name="validationQuery" value="SELECT 1" /> <property name="testWhileIdle" value="true" /> <property name="testOnBorrow" value="false" /> <property name="testOnReturn" value="false" /> <!-- 打开PSCache,并且指定每个连接上PSCache的大小 --> <property name="poolPreparedStatements" value="true" /> <property name="maxPoolPreparedStatementPerConnectionSize" value="20" /> </bean> <!-- mybatis 和spring 进行整合 --> <bean id="sqlSession" class="org.mybatis.spring.SqlSessionFactoryBean"> <property name="typeAliasesPackage" value="com.rain.pojo" /> <property name="dataSource" ref="dataSource"/> <!-- 指定mybatis mapper文件的地址 --> <property name="mapperLocations" value="classpath:com/rain/mapper/*.xml"/> <property name="plugins"> <array> <!-- pagehelper --> <bean class="com.github.pagehelper.PageInterceptor"> <property name="properties"> <!--使用下面的pagehelper方式配置参数,一行配置一个 --> <value> </value> </property> </bean> </array> </property> </bean> <!-- 配置扫描器 将 mybatis 接口的实现加入 ioc 容器中 --> <bean class="org.mybatis.spring.mapper.MapperScannerConfigurer"> <!-- 扫描 该包路径下 所有 DAO接口的实现 加入 到 IOC容器中 --> <property name="basePackage" value="com.rain.mapper"/> </bean> <!-- 配置spring的PlatformTransactionManager,名字为默认值 --> <bean id="transactionManager" class="org.springframework.jdbc.datasource.DataSourceTransactionManager"> <property name="dataSource" ref="dataSource" /> </bean> <!-- 开启事务控制的注解支持 比较多的使用 xml配置形式的事务--> <aop:config> <!-- 切入点表达式 --> <aop:pointcut expression="execution(* com.rain.service..*(..))" id="txPoint"/> <!-- 事务增强 --> <aop:advisor advice-ref="txAdvice" pointcut-ref="txPoint"/> </aop:config> <!-- 配置事务增强 如何切入 --> <tx:advice id="txAdvice"> <tx:attributes> <!-- 所有方法都是事务方法 --> <tx:method name="*" /> <!-- 以get开始的所有方法 --> <tx:method name="get*" read-only="true"/> </tx:attributes> <!-- spring配置文件核心点 数据源 与mybatis 整合 --> </tx:advice> </beans>

热门文章 服务器不支持 J2EE Web 模块 规范的版本 3.1 如何解决?

时间:2018-3-21 作者:RainFly   分类: Java   热度: 9345°  评论:3  
时间:2018-3-21   分类: Java    热度:9345   评论:3

环境 :Tomcat 7   JavaEE版本    选择了 Servert 3.1   也就是JavaEE 3.1 

其实遇上这个问题主要是建立Java Web工程时,没有仔细观察

而实际上

我们可以来看看Tomcat最近几个版本分别支持的JavaEE规范。 ------------------------ Tomcat 6: Servlet 2.5、JSP 2.1、EL 2.1 Tomcat7: Servlet 3.0、JSP 2.2、EL 2.2 Tomcat8: Servlet 3.1、JSP 2.3、EL 3.0 ------------------------

继而会出现运行不支持的问题!

返回顶部    首页    捐赠支持    手气不错    友情链接    关于我们    站长工具    站长介绍    手机版本    后台登陆   
版权所有:雨夜轩    站长:RainFly    特别鸣谢   文章归档   皖ICP备15003600号-1   百度统计
Copyright©2015雨夜轩 Powered by emlog强力驱动 七牛CDN全球加速 360站长联盟安全认证 中国博客联盟荣誉成员 可信赖网站 谷歌地图   百度地图   
页面加载耗时:0.312秒 数据库查询次数:59次
背景设置
$