Merge remote-tracking branch 'origin/master'

# Conflicts:
#	jero-boot/jero-boot-module-certification/src/main/java/com/jero/modules/cert/template/service/impl/ParamsInfoEOServiceImpl.java
#	jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/job/InventoryAffirmJob.java
#	jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectLawsInventoryEOServiceImpl.java
#	jero-boot/jero-boot-modules/src/main/java/com/jero/modules/project/service/impl/ProjectTaskInventoryEOServiceImpl.java
#	jero-boot/jero-boot-modules/src/main/java/com/jero/modules/split/service/impl/FileSplitItemsEOServiceImpl.java
#	jero-web/src/common/lang/en-us.js
#	jero-web/src/common/lang/zh-cn.js
#	jero-web/src/components/uploadFileChangeDown/file.vue
This commit is contained in:
zer0Black
2022-07-01 15:12:31 +08:00
74 changed files with 1796 additions and 722 deletions
@@ -4,10 +4,10 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.jero.common.api.vo.Result;
import com.jero.common.constant.CommonConstant;
import com.jero.common.constant.enums.CutEnum;
import com.jero.common.exception.JeroBootException;
import com.jero.common.system.api.ISysBaseAPI;
import com.jero.common.system.vo.LoginUser;
import com.jero.common.util.RestUtil;
import com.jero.common.util.TokenUtils;
import com.jero.common.util.oConvertUtils;
@@ -19,6 +19,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpHeaders;
@@ -47,6 +48,8 @@ import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.URLDecoder;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List;
/**
@@ -341,7 +344,7 @@ public class CommonController {
* @param response
*/
@GetMapping(value = "/downLoadFile")
public void downLoadFromCos(String id,HttpServletRequest request, HttpServletResponse response) {
public void downLoadFromCos(String id,HttpServletRequest request, HttpServletResponse response,String userName) {
if(StringUtils.isBlank(id)){
throw new JeroBootException("参数信息不全");
}
@@ -355,6 +358,7 @@ public class CommonController {
}
InputStream inputStream = null;
OutputStream outputStream = null;
File newFile =null;
try {
String fileName = "";
//本地下载
@@ -367,9 +371,18 @@ public class CommonController {
fileName = ossFile.getFileName();
response.setContentType("application/force-download");// 设置强制下载不打开
response.addHeader("Content-Disposition", "attachment;fileName=" + new String(fileName.getBytes("UTF-8"),"iso-8859-1"));
InputStream download = CosBootUtil.download(filePath);
File file = new File(filePath);
if(file.getName().endsWith(".pdf") || file.getName().endsWith(".PDF")){
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String currentTime = sdf.format(new Date());
String waterContent = userName+" "+currentTime;
newFile = PDFUtils.PDFWatermark(download,uploadpath,file.getName(),waterContent);
inputStream = new FileInputStream(newFile.getPath());
}else{
inputStream = CosBootUtil.download(filePath);
}
outputStream = response.getOutputStream();
inputStream = CosBootUtil.download(filePath);
byte[] buf = new byte[1024];
int len;
while ((len = inputStream.read(buf)) > 0) {
@@ -394,7 +407,17 @@ public class CommonController {
} catch (IOException e) {
log.error(e.getMessage(), e);
}
}
if (newFile != null) {
try {
newFile.delete();
} catch (Exception e) {
log.error(e.getMessage(), e);
}
}
}
}
@@ -468,7 +491,7 @@ public class CommonController {
* @param response
*/
@GetMapping(value = "/pdf/viewFile")
public void viewFile(String id,HttpServletRequest request, HttpServletResponse response) {
public void viewFile(String id,HttpServletRequest request, HttpServletResponse response,String userName) {
// 查询数据表数据是否存在
LambdaQueryWrapper<OSSFile> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(OSSFile::getId,id);
@@ -490,7 +513,10 @@ public class CommonController {
InputStream download = CosBootUtil.download(filePath);
File file = new File(filePath);
//水印内容
String waterContent = "water mark";//临时定义(水印信息通过传过来)
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
String currentTime = sdf.format(new Date());
String waterContent = userName+" "+currentTime;
// String waterContent = "water mark";//临时定义(水印信息通过传过来)
File newFile = PDFUtils.PDFWatermark(download,uploadpath,file.getName(),waterContent);
// 文件名称
fileName = file.getName();
@@ -23,7 +23,7 @@ public interface SysDictItemMapper extends BaseMapper<SysDictItem> {
@Select("SELECT sys_dict_item.* FROM sys_dict_item LEFT JOIN sys_dict ON sys_dict_item.dict_id = sys_dict.id WHERE sys_dict_item.DEL_FLAG = 0 and DICT_CODE = #{dictCode} order by sort_order asc, item_value asc")
public List<SysDictItem> selectItemsByDictCode(String dictCode);
@Select("SELECT sys_dict_item.* FROM sys_dict_item LEFT JOIN sys_dict ON sys_dict_item.dict_id = sys_dict.id WHERE DICT_CODE = #{dictCode} order by sys_dict_item.sort_order asc")
@Select("SELECT sys_dict_item.* FROM sys_dict_item LEFT JOIN sys_dict ON sys_dict_item.dict_id = sys_dict.id WHERE DICT_CODE = #{dictCode} order by sys_dict_item.item_text asc")
public List<SysDictItem> selectItemsOrderBySortOrder(String dictCode);
@Select("SELECT sys_dict.dict_code,sys_dict_item.* from sys_dict_item LEFT JOIN sys_dict ON sys_dict_item.dict_id = sys_dict.id where status = 1")
@@ -195,8 +195,8 @@ public class SyncDataServiceImpl implements ISyncDataService{
ppEmployeeList.addAll(currentPPEmployeeList);
}
}
// 处理同步过来的数据id不同,username相同的情况
ppEmployeeList.sort(Comparator.comparing(PPEmployee::getCreation_time).reversed());
// 处理同步过来的数据id不同,username相同的情况 creation_time不能为空
// ppEmployeeList.sort(Comparator.comparing(PPEmployee::getCreation_time).reversed());
//此处获取全部pp用户信息
List<SysUser> sysUserList = sysUserService.getPPEmployeeList();
@@ -73,9 +73,9 @@ public class PDFUtils {
PdfTilingBrush brush = new PdfTilingBrush(dimension2D);
brush.getGraphics().setTransparency(0.4F);
brush.getGraphics().save();
brush.getGraphics().translateTransform((float) brush.getSize().getWidth() / 5, (float) brush.getSize().getHeight() / 5);
brush.getGraphics().translateTransform((float) brush.getSize().getWidth() / 1.5, (float) brush.getSize().getHeight() / 3);
brush.getGraphics().rotateTransform(-45);
brush.getGraphics().drawString(watermark, new PdfFont(PdfFontFamily.Helvetica, 15),
brush.getGraphics().drawString(watermark, new PdfFont(PdfFontFamily.Helvetica, 10),
PdfBrushes.getViolet(), 0 , 0 , new PdfStringFormat(PdfTextAlignment.Center));
brush.getGraphics().restore();
brush.getGraphics().setTransparency(1);