Merge remote-tracking branch 'origin/fix_bug_first_stage' into fix_bug_first_stage

This commit is contained in:
wangzhijiang
2022-06-30 15:47:51 +08:00
6 changed files with 105 additions and 66 deletions
@@ -4,10 +4,10 @@ import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject; import com.alibaba.fastjson.JSONObject;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.jero.common.api.vo.Result; import com.jero.common.api.vo.Result;
import com.jero.common.constant.CommonConstant;
import com.jero.common.constant.enums.CutEnum; import com.jero.common.constant.enums.CutEnum;
import com.jero.common.exception.JeroBootException; import com.jero.common.exception.JeroBootException;
import com.jero.common.system.api.ISysBaseAPI; 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.RestUtil;
import com.jero.common.util.TokenUtils; import com.jero.common.util.TokenUtils;
import com.jero.common.util.oConvertUtils; import com.jero.common.util.oConvertUtils;
@@ -19,6 +19,7 @@ import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation; import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.StringUtils;
import org.apache.shiro.SecurityUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value; import org.springframework.beans.factory.annotation.Value;
import org.springframework.http.HttpHeaders; import org.springframework.http.HttpHeaders;
@@ -47,6 +48,8 @@ import java.io.IOException;
import java.io.InputStream; import java.io.InputStream;
import java.io.OutputStream; import java.io.OutputStream;
import java.net.URLDecoder; import java.net.URLDecoder;
import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.List; import java.util.List;
/** /**
@@ -341,7 +344,7 @@ public class CommonController {
* @param response * @param response
*/ */
@GetMapping(value = "/downLoadFile") @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)){ if(StringUtils.isBlank(id)){
throw new JeroBootException("参数信息不全"); throw new JeroBootException("参数信息不全");
} }
@@ -355,6 +358,7 @@ public class CommonController {
} }
InputStream inputStream = null; InputStream inputStream = null;
OutputStream outputStream = null; OutputStream outputStream = null;
File newFile =null;
try { try {
String fileName = ""; String fileName = "";
//本地下载 //本地下载
@@ -367,9 +371,18 @@ public class CommonController {
fileName = ossFile.getFileName(); fileName = ossFile.getFileName();
response.setContentType("application/force-download");// 设置强制下载不打开 response.setContentType("application/force-download");// 设置强制下载不打开
response.addHeader("Content-Disposition", "attachment;fileName=" + new String(fileName.getBytes("UTF-8"),"iso-8859-1")); 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(); outputStream = response.getOutputStream();
inputStream = CosBootUtil.download(filePath);
byte[] buf = new byte[1024]; byte[] buf = new byte[1024];
int len; int len;
while ((len = inputStream.read(buf)) > 0) { while ((len = inputStream.read(buf)) > 0) {
@@ -394,7 +407,17 @@ public class CommonController {
} catch (IOException e) { } catch (IOException e) {
log.error(e.getMessage(), 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 * @param response
*/ */
@GetMapping(value = "/pdf/viewFile") @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<>(); LambdaQueryWrapper<OSSFile> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(OSSFile::getId,id); queryWrapper.eq(OSSFile::getId,id);
@@ -490,7 +513,10 @@ public class CommonController {
InputStream download = CosBootUtil.download(filePath); InputStream download = CosBootUtil.download(filePath);
File file = new File(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); File newFile = PDFUtils.PDFWatermark(download,uploadpath,file.getName(),waterContent);
// 文件名称 // 文件名称
fileName = file.getName(); fileName = file.getName();
@@ -73,9 +73,9 @@ public class PDFUtils {
PdfTilingBrush brush = new PdfTilingBrush(dimension2D); PdfTilingBrush brush = new PdfTilingBrush(dimension2D);
brush.getGraphics().setTransparency(0.4F); brush.getGraphics().setTransparency(0.4F);
brush.getGraphics().save(); 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().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)); PdfBrushes.getViolet(), 0 , 0 , new PdfStringFormat(PdfTextAlignment.Center));
brush.getGraphics().restore(); brush.getGraphics().restore();
brush.getGraphics().setTransparency(1); brush.getGraphics().setTransparency(1);
@@ -404,9 +404,8 @@
color: rgb(0, 0, 0); color: rgb(0, 0, 0);
font-size: 22px; font-size: 22px;
position: absolute; position: absolute;
left: 230px; left: 200px;
top: 50%; bottom: 20px;
transform: translate(-50%, -50%);
transition: all 0.2s; transition: all 0.2s;
} }
@@ -414,9 +413,8 @@
color: rgb(0, 0, 0); color: rgb(0, 0, 0);
font-size: 22px; font-size: 22px;
position: absolute; position: absolute;
left: 56px; left: 22px;
top: 50%; bottom: 20px;
transform: translate(-50%, -50%);
transition: all 0.2s; transition: all 0.2s;
} }
</style> </style>
@@ -232,39 +232,39 @@
@cancel="handleCancel" @cancel="handleCancel"
> >
<a-spin :spinning="confirmLoading"> <a-spin :spinning="confirmLoading">
<a-form-model :model="formInline" class="formAdd" :rules="rules" ref="ruleForm"> <a-form-model :model="formInline" class="formAdd" :rules="rules" ref="ruleForm">
<a-row :gutter="24"> <a-row :gutter="24">
<a-col :span="24"> <a-col :span="24">
<div class="box-title-text-index"> <div class="box-title-text-index">
<div class="title-text-index"> <div class="title-text-index">
<span class="Required">*</span> <span class="Required">*</span>
<span class="title-text-text" <span class="title-text-text"
:title="$t('TaskCutOffTime')">{{ $t('TaskCutOffTime') }}</span> :title="$t('TaskCutOffTime')">{{ $t('TaskCutOffTime') }}</span>
</div>
<a-form-model-item v-if="this.timeName == '清单'" class="itemModel" prop="inventoryAffirmDueDate">
<a-date-picker class="box-input"
:placeholder="$t('PleaseSelect')+$t('TaskCutOffTime')"
@change="dateChange({db_field_name:'inventoryAffirmDueDate'})"
format="YYYY-MM-DD"
:disabledDate="disabledDate"
:getCalendarContainer="(trigger) => trigger.parentNode"
v-model="formInline.inventoryAffirmDueDate"
style="width: 100%"/>
</a-form-model-item>
<a-form-model-item v-else-if="this.timeName == '任务'" class="itemModel" prop="taskAffirmDueDate">
<a-date-picker class="box-input"
:placeholder="$t('PleaseSelect')+$t('TaskCutOffTime')"
@change="dateChange({db_field_name:'taskAffirmDueDate'})"
format="YYYY-MM-DD"
:disabledDate="disabledDate"
:getCalendarContainer="(trigger) => trigger.parentNode"
v-model="formInline.taskAffirmDueDate"
style="width: 100%"/>
</a-form-model-item>
</div> </div>
<a-form-model-item v-if="this.timeName == '清单'" class="itemModel" prop="inventoryAffirmDueDate"> </a-col>
<a-date-picker class="box-input" </a-row>
:placeholder="$t('PleaseSelect')+$t('TaskCutOffTime')" </a-form-model>
@change="dateChange({db_field_name:'inventoryAffirmDueDate'})"
format="YYYY-MM-DD"
:disabledDate="disabledDate"
:getCalendarContainer="(trigger) => trigger.parentNode"
v-model="formInline.inventoryAffirmDueDate"
style="width: 100%"/>
</a-form-model-item>
<a-form-model-item v-else-if="this.timeName == '任务'" class="itemModel" prop="taskAffirmDueDate">
<a-date-picker class="box-input"
:placeholder="$t('PleaseSelect')+$t('TaskCutOffTime')"
@change="dateChange({db_field_name:'taskAffirmDueDate'})"
format="YYYY-MM-DD"
:disabledDate="disabledDate"
:getCalendarContainer="(trigger) => trigger.parentNode"
v-model="formInline.taskAffirmDueDate"
style="width: 100%"/>
</a-form-model-item>
</div>
</a-col>
</a-row>
</a-form-model>
</a-spin> </a-spin>
</a-modal> </a-modal>
<a-modal <a-modal
@@ -1220,10 +1220,10 @@
this.getList() this.getList()
}, },
searchReset() { searchReset() {
this.queryParam = {}
this.$refs.globalAdvancedQueryRef.resetLine() this.$refs.globalAdvancedQueryRef.resetLine()
this.$refs.globalAdvancedQueryRef.emitCallback() this.$refs.globalAdvancedQueryRef.emitCallback()
this.queryParam = {} // this.getList()
this.getList()
}, },
addModelList() { addModelList() {
this.getList() this.getList()
@@ -1258,8 +1258,8 @@
roleCode: roleCode roleCode: roleCode
} }
this.loading = true this.loading = true
this.getRoleByUserId()
getAction(this.url.list, query).then((res) => { getAction(this.url.list, query).then((res) => {
this.getRoleByUserId()
if (res.success) { if (res.success) {
this.dataSource = res.result this.dataSource = res.result
this.loading = false this.loading = false
@@ -107,10 +107,10 @@
<a-icon type="plus"/> <a-icon type="plus"/>
{{$t('newlyAdded')}} {{$t('newlyAdded')}}
</div> </div>
<div @click="handleDel" class="operator-text" v-has="'projectLibraryBase:deleteBatch'"> <!-- <div @click="handleDel" class="operator-text" v-has="'projectLibraryBase:deleteBatch'">-->
<a-icon type="delete"/> <!-- <a-icon type="delete"/>-->
{{$t('BatchDelete')}} <!-- {{$t('BatchDelete')}}-->
</div> <!-- </div>-->
</div> </div>
<div> <div>
<a-table <a-table
@@ -129,7 +129,10 @@
</span> </span>
<span slot="operation" slot-scope="text,record"> <span slot="operation" slot-scope="text,record">
<!-- <a class="text-operation" @click="edit(record)">{{$t('edit')}}</a>--> <!-- <a class="text-operation" @click="edit(record)">{{$t('edit')}}</a>-->
<a class="text-operation" v-has="'projectLibraryBase:delete'" @click="deleteLib(record)">{{$t('deleteLib')}}</a> <a class="text-operation"
v-has="'projectLibraryBase:delete'"
v-if="record.createBy == userInfoQuery.username"
@click="deleteLib(record)">{{$t('deleteLib')}}</a>
<!-- <a class="text-operation" @click="entryNameClick(record)">{{$t('see')}}</a>--> <!-- <a class="text-operation" @click="entryNameClick(record)">{{$t('see')}}</a>-->
</span> </span>
</a-table> </a-table>
@@ -153,6 +156,7 @@
import { getAction, postAction, downloadFile, deleteAction } from '@/api/manage' import { getAction, postAction, downloadFile, deleteAction } from '@/api/manage'
import addModel from '../components/addModel' import addModel from '../components/addModel'
import PersonnelSelection from '@/components/PersonnelSelection/index' import PersonnelSelection from '@/components/PersonnelSelection/index'
import { mapGetters } from 'vuex'
export default { export default {
name: 'index', name: 'index',
@@ -240,13 +244,16 @@
scopedSlots: { customRender: 'operation' } scopedSlots: { customRender: 'operation' }
} }
], ],
userInfoQuery: {},
queryParam: {} queryParam: {}
} }
}, },
mounted() { mounted() {
this.getList() this.getList()
this.userInfoQuery = this.userInfo()
}, },
methods: { methods: {
...mapGetters(['userInfo']),
handleToggleSearch() { handleToggleSearch() {
this.toggleSearchStatus = !this.toggleSearchStatus this.toggleSearchStatus = !this.toggleSearchStatus
}, },
@@ -71,11 +71,11 @@
<div class="process-content-right-xian"></div> <div class="process-content-right-xian"></div>
<div class="process-content-content" :style="val.left" <div class="process-content-content" :style="val.left"
v-for="(val,indexOne) in item.data[0]" :key="indexOne"> v-for="(val,indexOne) in item.data[0]" :key="indexOne">
<div class="process-content-right-top" :title="val.name">{{val.name}}</div>
<a-tooltip placement="topLeft"> <a-tooltip placement="topLeft">
<template slot="title"> <template slot="title">
<span>{{val.time.slice(0,11)}}</span> <span>{{val.time.slice(0,11)}}</span>
</template> </template>
<div class="process-content-right-top">{{val.name}}</div>
<img v-if="val.status == 1" src="../../../assets/done.svg" class="process-content-left" <img v-if="val.status == 1" src="../../../assets/done.svg" class="process-content-left"
alt=""> alt="">
<img v-else-if="val.status == 2" src="../../../assets/open.svg" <img v-else-if="val.status == 2" src="../../../assets/open.svg"
@@ -242,6 +242,7 @@
this.handlingTime = moment(new Date()).format('YYYY-MM-DD') this.handlingTime = moment(new Date()).format('YYYY-MM-DD')
}, },
methods: { methods: {
getTimeline() { getTimeline() {
let query = { let query = {
startTime: this.startTime, startTime: this.startTime,
@@ -506,7 +507,7 @@
} }
.box-top-content-left { .box-top-content-left {
width: 160px; width: 140px;
float: left; float: left;
padding-top: 100px; padding-top: 100px;
margin-right: 20px; margin-right: 20px;
@@ -515,8 +516,8 @@
.box-top-content-left-text { .box-top-content-left-text {
color: #191E29; color: #191E29;
font-weight: bold; font-weight: bold;
font-size: 14px; font-size: 12px;
height: 104px; height: 84px;
letter-spacing: 0px; letter-spacing: 0px;
text-align: left; text-align: left;
text-overflow: ellipsis; text-overflow: ellipsis;
@@ -525,7 +526,7 @@
} }
.box-top-content-right { .box-top-content-right {
width: calc(100% - 180px); width: calc(100% - 160px);
float: left; float: left;
} }
@@ -544,7 +545,7 @@
padding-left: 10px; padding-left: 10px;
color: #54565A; color: #54565A;
font-weight: bold; font-weight: bold;
font-size: 14px; font-size: 13px;
line-height: 36px; line-height: 36px;
letter-spacing: 0px; letter-spacing: 0px;
text-align: center; text-align: center;
@@ -561,7 +562,7 @@
.process-content { .process-content {
position: relative; position: relative;
height: 104px; height: 84px;
.process-content-content { .process-content-content {
background: #fff; background: #fff;
@@ -582,15 +583,22 @@
} }
.process-content-right-top { .process-content-right-top {
font-size: 14px; font-size: 12px;
color: #040B29; color: #040B29;
max-width: 155px; width: 50px;
text-overflow: ellipsis;
white-space: nowrap;
overflow: hidden; overflow: hidden;
position: absolute; position: absolute;
top: -8px; top: -14px;
left: 50%; left: 50%;
line-height: 1.2;
display: -webkit-box;
text-overflow: ellipsis;
/*! autoprefixer: off */
-webkit-box-orient: vertical;
-webkit-line-clamp: 2;
/*! autoprefixer: on;*/
text-justify: inter-ideograph;
word-break: break-all;
transform: translate(-50%, -50%); transform: translate(-50%, -50%);
} }