Merge remote-tracking branch 'origin/fix_bug_first_stage' into fix_bug_first_stage
This commit is contained in:
+32
-6
@@ -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();
|
||||
|
||||
+2
-2
@@ -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);
|
||||
|
||||
@@ -404,9 +404,8 @@
|
||||
color: rgb(0, 0, 0);
|
||||
font-size: 22px;
|
||||
position: absolute;
|
||||
left: 230px;
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
left: 200px;
|
||||
bottom: 20px;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
|
||||
@@ -414,9 +413,8 @@
|
||||
color: rgb(0, 0, 0);
|
||||
font-size: 22px;
|
||||
position: absolute;
|
||||
left: 56px;
|
||||
top: 50%;
|
||||
transform: translate(-50%, -50%);
|
||||
left: 22px;
|
||||
bottom: 20px;
|
||||
transition: all 0.2s;
|
||||
}
|
||||
</style>
|
||||
@@ -232,39 +232,39 @@
|
||||
@cancel="handleCancel"
|
||||
>
|
||||
<a-spin :spinning="confirmLoading">
|
||||
<a-form-model :model="formInline" class="formAdd" :rules="rules" ref="ruleForm">
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="24">
|
||||
<div class="box-title-text-index">
|
||||
<div class="title-text-index">
|
||||
<span class="Required">*</span>
|
||||
<span class="title-text-text"
|
||||
:title="$t('TaskCutOffTime')">{{ $t('TaskCutOffTime') }}</span>
|
||||
<a-form-model :model="formInline" class="formAdd" :rules="rules" ref="ruleForm">
|
||||
<a-row :gutter="24">
|
||||
<a-col :span="24">
|
||||
<div class="box-title-text-index">
|
||||
<div class="title-text-index">
|
||||
<span class="Required">*</span>
|
||||
<span class="title-text-text"
|
||||
: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>
|
||||
<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>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form-model>
|
||||
</a-col>
|
||||
</a-row>
|
||||
</a-form-model>
|
||||
</a-spin>
|
||||
</a-modal>
|
||||
<a-modal
|
||||
@@ -1220,10 +1220,10 @@
|
||||
this.getList()
|
||||
},
|
||||
searchReset() {
|
||||
this.queryParam = {}
|
||||
this.$refs.globalAdvancedQueryRef.resetLine()
|
||||
this.$refs.globalAdvancedQueryRef.emitCallback()
|
||||
this.queryParam = {}
|
||||
this.getList()
|
||||
// this.getList()
|
||||
},
|
||||
addModelList() {
|
||||
this.getList()
|
||||
@@ -1258,8 +1258,8 @@
|
||||
roleCode: roleCode
|
||||
}
|
||||
this.loading = true
|
||||
this.getRoleByUserId()
|
||||
getAction(this.url.list, query).then((res) => {
|
||||
this.getRoleByUserId()
|
||||
if (res.success) {
|
||||
this.dataSource = res.result
|
||||
this.loading = false
|
||||
|
||||
@@ -107,10 +107,10 @@
|
||||
<a-icon type="plus"/>
|
||||
{{$t('newlyAdded')}}
|
||||
</div>
|
||||
<div @click="handleDel" class="operator-text" v-has="'projectLibraryBase:deleteBatch'">
|
||||
<a-icon type="delete"/>
|
||||
{{$t('BatchDelete')}}
|
||||
</div>
|
||||
<!-- <div @click="handleDel" class="operator-text" v-has="'projectLibraryBase:deleteBatch'">-->
|
||||
<!-- <a-icon type="delete"/>-->
|
||||
<!-- {{$t('BatchDelete')}}-->
|
||||
<!-- </div>-->
|
||||
</div>
|
||||
<div>
|
||||
<a-table
|
||||
@@ -129,7 +129,10 @@
|
||||
</span>
|
||||
<span slot="operation" slot-scope="text,record">
|
||||
<!-- <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>-->
|
||||
</span>
|
||||
</a-table>
|
||||
@@ -153,6 +156,7 @@
|
||||
import { getAction, postAction, downloadFile, deleteAction } from '@/api/manage'
|
||||
import addModel from '../components/addModel'
|
||||
import PersonnelSelection from '@/components/PersonnelSelection/index'
|
||||
import { mapGetters } from 'vuex'
|
||||
|
||||
export default {
|
||||
name: 'index',
|
||||
@@ -240,13 +244,16 @@
|
||||
scopedSlots: { customRender: 'operation' }
|
||||
}
|
||||
],
|
||||
userInfoQuery: {},
|
||||
queryParam: {}
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.getList()
|
||||
this.userInfoQuery = this.userInfo()
|
||||
},
|
||||
methods: {
|
||||
...mapGetters(['userInfo']),
|
||||
handleToggleSearch() {
|
||||
this.toggleSearchStatus = !this.toggleSearchStatus
|
||||
},
|
||||
|
||||
@@ -71,11 +71,11 @@
|
||||
<div class="process-content-right-xian"></div>
|
||||
<div class="process-content-content" :style="val.left"
|
||||
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">
|
||||
<template slot="title">
|
||||
<span>{{val.time.slice(0,11)}}</span>
|
||||
</template>
|
||||
<div class="process-content-right-top">{{val.name}}</div>
|
||||
<img v-if="val.status == 1" src="../../../assets/done.svg" class="process-content-left"
|
||||
alt="">
|
||||
<img v-else-if="val.status == 2" src="../../../assets/open.svg"
|
||||
@@ -242,6 +242,7 @@
|
||||
this.handlingTime = moment(new Date()).format('YYYY-MM-DD')
|
||||
},
|
||||
methods: {
|
||||
|
||||
getTimeline() {
|
||||
let query = {
|
||||
startTime: this.startTime,
|
||||
@@ -506,7 +507,7 @@
|
||||
}
|
||||
|
||||
.box-top-content-left {
|
||||
width: 160px;
|
||||
width: 140px;
|
||||
float: left;
|
||||
padding-top: 100px;
|
||||
margin-right: 20px;
|
||||
@@ -515,8 +516,8 @@
|
||||
.box-top-content-left-text {
|
||||
color: #191E29;
|
||||
font-weight: bold;
|
||||
font-size: 14px;
|
||||
height: 104px;
|
||||
font-size: 12px;
|
||||
height: 84px;
|
||||
letter-spacing: 0px;
|
||||
text-align: left;
|
||||
text-overflow: ellipsis;
|
||||
@@ -525,7 +526,7 @@
|
||||
}
|
||||
|
||||
.box-top-content-right {
|
||||
width: calc(100% - 180px);
|
||||
width: calc(100% - 160px);
|
||||
float: left;
|
||||
}
|
||||
|
||||
@@ -544,7 +545,7 @@
|
||||
padding-left: 10px;
|
||||
color: #54565A;
|
||||
font-weight: bold;
|
||||
font-size: 14px;
|
||||
font-size: 13px;
|
||||
line-height: 36px;
|
||||
letter-spacing: 0px;
|
||||
text-align: center;
|
||||
@@ -561,7 +562,7 @@
|
||||
|
||||
.process-content {
|
||||
position: relative;
|
||||
height: 104px;
|
||||
height: 84px;
|
||||
|
||||
.process-content-content {
|
||||
background: #fff;
|
||||
@@ -582,15 +583,22 @@
|
||||
}
|
||||
|
||||
.process-content-right-top {
|
||||
font-size: 14px;
|
||||
font-size: 12px;
|
||||
color: #040B29;
|
||||
max-width: 155px;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
width: 50px;
|
||||
overflow: hidden;
|
||||
position: absolute;
|
||||
top: -8px;
|
||||
top: -14px;
|
||||
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%);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user