合并分支 'dev_third_stage' 到 'master'
Dev third stage 查看合并请求 laws-nio/laws-weilai!191
This commit is contained in:
@@ -1179,10 +1179,10 @@ update onl_cgform_field set is_query = '1', is_read_only = '1' where id = '09fa6
|
|||||||
-- 配置表,增加问题知识库预览图片配置 2022-09-27 已同步生产环境
|
-- 配置表,增加问题知识库预览图片配置 2022-09-27 已同步生产环境
|
||||||
INSERT INTO `laws_weilai`.`sys_config` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `sys_org_code`, `config`, `config_name`) VALUES ('4', 'admin', '2022-09-28 14:35:30', NULL, NULL, 'A01', 'http://grp.nioint.com/', 'domianWebImgURL');
|
INSERT INTO `laws_weilai`.`sys_config` (`id`, `create_by`, `create_time`, `update_by`, `update_time`, `sys_org_code`, `config`, `config_name`) VALUES ('4', 'admin', '2022-09-28 14:35:30', NULL, NULL, 'A01', 'http://grp.nioint.com/', 'domianWebImgURL');
|
||||||
|
|
||||||
--问题知识库,增加字段 发布状态 2022-10-13 未同步生产环境
|
--问题知识库,增加字段 发布状态 2022-10-13 已同步生产环境
|
||||||
ALTER TABLE `laws_weilai`.`problem_knowledge_base`
|
ALTER TABLE `laws_weilai`.`problem_knowledge_base`
|
||||||
ADD COLUMN `release_status` varchar(50) NULL COMMENT '发布状态' AFTER `release_time`;
|
ADD COLUMN `release_status` varchar(50) NULL COMMENT '发布状态' AFTER `release_time`;
|
||||||
|
|
||||||
--处理问题知识库数据,发布人,发布时间,发布状态数据sql 2022-10-13 未同步生产环境
|
--处理问题知识库数据,发布人,发布时间,发布状态数据sql 2022-10-13 已同步生产环境
|
||||||
update problem_knowledge_base pkd set pkd.release_status = 'Have released',pkd.release_time = pkd.create_time,pkd.release_user_id = (select su.id from sys_user su where su.username = pkd.create_by)
|
update problem_knowledge_base pkd set pkd.release_status = 'Have released',pkd.release_time = pkd.create_time,pkd.release_user_id = (select su.id from sys_user su where su.username = pkd.create_by)
|
||||||
|
|
||||||
|
|||||||
+81
-15
@@ -7,7 +7,6 @@ import com.jero.common.api.vo.Result;
|
|||||||
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,7 +18,6 @@ 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;
|
||||||
@@ -27,12 +25,7 @@ import org.springframework.http.HttpMethod;
|
|||||||
import org.springframework.http.ResponseEntity;
|
import org.springframework.http.ResponseEntity;
|
||||||
import org.springframework.http.server.ServletServerHttpRequest;
|
import org.springframework.http.server.ServletServerHttpRequest;
|
||||||
import org.springframework.util.AntPathMatcher;
|
import org.springframework.util.AntPathMatcher;
|
||||||
import org.springframework.web.bind.annotation.GetMapping;
|
import org.springframework.web.bind.annotation.*;
|
||||||
import org.springframework.web.bind.annotation.PathVariable;
|
|
||||||
import org.springframework.web.bind.annotation.PostMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestMapping;
|
|
||||||
import org.springframework.web.bind.annotation.RequestParam;
|
|
||||||
import org.springframework.web.bind.annotation.RestController;
|
|
||||||
import org.springframework.web.multipart.MultipartFile;
|
import org.springframework.web.multipart.MultipartFile;
|
||||||
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
import org.springframework.web.multipart.MultipartHttpServletRequest;
|
||||||
import org.springframework.web.servlet.HandlerMapping;
|
import org.springframework.web.servlet.HandlerMapping;
|
||||||
@@ -41,12 +34,7 @@ import org.springframework.web.servlet.ModelAndView;
|
|||||||
import javax.annotation.Resource;
|
import javax.annotation.Resource;
|
||||||
import javax.servlet.http.HttpServletRequest;
|
import javax.servlet.http.HttpServletRequest;
|
||||||
import javax.servlet.http.HttpServletResponse;
|
import javax.servlet.http.HttpServletResponse;
|
||||||
import java.io.BufferedInputStream;
|
import java.io.*;
|
||||||
import java.io.File;
|
|
||||||
import java.io.FileInputStream;
|
|
||||||
import java.io.IOException;
|
|
||||||
import java.io.InputStream;
|
|
||||||
import java.io.OutputStream;
|
|
||||||
import java.net.URLDecoder;
|
import java.net.URLDecoder;
|
||||||
import java.text.SimpleDateFormat;
|
import java.text.SimpleDateFormat;
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
@@ -382,12 +370,13 @@ 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);
|
File file = new File(filePath);
|
||||||
if(file.getName().endsWith(".pdf") || file.getName().endsWith(".PDF")){
|
if(file.getName().endsWith(".pdf") || file.getName().endsWith(".PDF")){
|
||||||
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");
|
||||||
String currentTime = sdf.format(new Date());
|
String currentTime = sdf.format(new Date());
|
||||||
String waterContent = userName+" "+currentTime;
|
String waterContent = userName+" "+currentTime;
|
||||||
|
InputStream download = CosBootUtil.download(filePath);
|
||||||
newFile = PDFUtils.PDFWatermark(download,uploadpath,file.getName(),waterContent);
|
newFile = PDFUtils.PDFWatermark(download,uploadpath,file.getName(),waterContent);
|
||||||
inputStream = new FileInputStream(newFile.getPath());
|
inputStream = new FileInputStream(newFile.getPath());
|
||||||
}else{
|
}else{
|
||||||
@@ -432,6 +421,83 @@ public class CommonController {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* word,excel预览 cos -pdf无水印
|
||||||
|
*
|
||||||
|
* @param id 传入文件id
|
||||||
|
* @param request
|
||||||
|
* @param response
|
||||||
|
*/
|
||||||
|
@GetMapping(value = "/downLoadFileNOMark")
|
||||||
|
public void downLoadFileNoPDFWatermarkCos(String id,HttpServletRequest request, HttpServletResponse response,String userName) {
|
||||||
|
if(StringUtils.isBlank(id)){
|
||||||
|
throw new JeroBootException("参数信息不全");
|
||||||
|
}
|
||||||
|
id = id.split("\\.")[0];
|
||||||
|
// 查询数据表数据是否存在
|
||||||
|
LambdaQueryWrapper<OSSFile> queryWrapper = new LambdaQueryWrapper<>();
|
||||||
|
queryWrapper.eq(OSSFile::getId,id);
|
||||||
|
OSSFile ossFile = ossFileService.getOne(queryWrapper);
|
||||||
|
if( null == ossFile){
|
||||||
|
throw new JeroBootException("文件不存在");
|
||||||
|
}
|
||||||
|
InputStream inputStream = null;
|
||||||
|
OutputStream outputStream = null;
|
||||||
|
File newFile =null;
|
||||||
|
try {
|
||||||
|
String fileName = "";
|
||||||
|
//本地下载
|
||||||
|
String filePath = ossFile.getUrl();
|
||||||
|
if(!CosBootUtil.doesObjectExist(filePath)){
|
||||||
|
response.setStatus(404);
|
||||||
|
throw new RuntimeException("文件不存在..");
|
||||||
|
}
|
||||||
|
// 文件名称
|
||||||
|
fileName = ossFile.getFileName();
|
||||||
|
response.setContentType("application/force-download");// 设置强制下载不打开
|
||||||
|
response.addHeader("Content-Disposition", "attachment;fileName=" + new String(fileName.getBytes("UTF-8"),"iso-8859-1"));
|
||||||
|
|
||||||
|
File file = new File(filePath);
|
||||||
|
inputStream = CosBootUtil.download(filePath);
|
||||||
|
outputStream = response.getOutputStream();
|
||||||
|
byte[] buf = new byte[1024];
|
||||||
|
int len;
|
||||||
|
while ((len = inputStream.read(buf)) > 0) {
|
||||||
|
outputStream.write(buf, 0, len);
|
||||||
|
}
|
||||||
|
response.flushBuffer();
|
||||||
|
} catch (IOException e) {
|
||||||
|
log.error("文件下载失败" + e.getMessage());
|
||||||
|
response.setStatus(404);
|
||||||
|
e.printStackTrace();
|
||||||
|
} finally {
|
||||||
|
if (inputStream != null) {
|
||||||
|
try {
|
||||||
|
inputStream.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
log.error(e.getMessage(), e);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (outputStream != null) {
|
||||||
|
try {
|
||||||
|
outputStream.close();
|
||||||
|
} catch (IOException e) {
|
||||||
|
log.error(e.getMessage(), e);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
if (newFile != null) {
|
||||||
|
try {
|
||||||
|
newFile.delete();
|
||||||
|
} catch (Exception e) {
|
||||||
|
log.error(e.getMessage(), e);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 文件下载
|
* 文件下载
|
||||||
*
|
*
|
||||||
|
|||||||
+22
-2
@@ -127,10 +127,24 @@ public class SysUserController {
|
|||||||
public Result<IPage<SysUser>> queryPageList(SysUser user, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
public Result<IPage<SysUser>> queryPageList(SysUser user, @RequestParam(name = "pageNo", defaultValue = "1") Integer pageNo,
|
||||||
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
|
@RequestParam(name = "pageSize", defaultValue = "10") Integer pageSize, HttpServletRequest req) {
|
||||||
Result<IPage<SysUser>> result = new Result<IPage<SysUser>>();
|
Result<IPage<SysUser>> result = new Result<IPage<SysUser>>();
|
||||||
QueryWrapper<SysUser> queryWrapper = QueryGenerator.initQueryWrapper(user, req.getParameterMap());
|
Map<String, String[]> reqMap = req.getParameterMap();
|
||||||
|
Map<String, String[]> newReqMap = new HashMap<>();
|
||||||
|
for (String key : reqMap.keySet()){
|
||||||
|
if(!key.equals("orgCode")){
|
||||||
|
newReqMap.put(key,reqMap.get(key));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
user.setOrgCode(null);
|
||||||
|
QueryWrapper<SysUser> queryWrapper = QueryGenerator.initQueryWrapper(user, newReqMap);
|
||||||
//TODO 外部模拟登陆临时账号,列表不显示
|
//TODO 外部模拟登陆临时账号,列表不显示
|
||||||
queryWrapper.ne("username", "_reserve_user_external");
|
queryWrapper.ne("username", "_reserve_user_external");
|
||||||
Page<SysUser> page = new Page<SysUser>(pageNo, pageSize);
|
String[] orgCode = reqMap.get("orgCode");
|
||||||
|
if(null != orgCode && orgCode.length > 0){
|
||||||
|
List<String> orgCodeList = sysDepartService.getSubDepIdsByDepId(orgCode[0]);
|
||||||
|
orgCodeList.add(orgCode[0]);
|
||||||
|
queryWrapper.in("org_code",orgCodeList);
|
||||||
|
}
|
||||||
|
Page<SysUser> page = new Page<>(pageNo, pageSize);
|
||||||
IPage<SysUser> pageList = sysUserService.page(page, queryWrapper);
|
IPage<SysUser> pageList = sysUserService.page(page, queryWrapper);
|
||||||
|
|
||||||
//批量查询用户的所属部门
|
//批量查询用户的所属部门
|
||||||
@@ -1549,6 +1563,12 @@ public class SysUserController {
|
|||||||
for (SysDepartTreeModel sdtm: departTreeModelList) {
|
for (SysDepartTreeModel sdtm: departTreeModelList) {
|
||||||
dutList.addAll(findChildNode(sdtm));
|
dutList.addAll(findChildNode(sdtm));
|
||||||
}
|
}
|
||||||
|
SysUser admin = sysUserService.getUserByName("admin");
|
||||||
|
DepartUserTree dut = new DepartUserTree();
|
||||||
|
dut.setId(admin.getId());
|
||||||
|
dut.setName(admin.getUsername());
|
||||||
|
dut.setType("User");
|
||||||
|
dutList.add(dut);
|
||||||
result.setResult(dutList);
|
result.setResult(dutList);
|
||||||
result.setSuccess(true);
|
result.setSuccess(true);
|
||||||
return result;
|
return result;
|
||||||
|
|||||||
@@ -652,7 +652,7 @@
|
|||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<uploadFileChangeDown ref="uploadFile" @uploadSuccess="uploadSuccess"
|
<uploadFileChangeDown ref="uploadFile" @uploadSuccess="uploadSuccess"
|
||||||
:detailDate='detailDate'></uploadFileChangeDown>
|
:detailDate='detailDate' watermark='download'></uploadFileChangeDown>
|
||||||
</div>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
@@ -667,6 +667,10 @@
|
|||||||
type: Object,
|
type: Object,
|
||||||
default: {},
|
default: {},
|
||||||
require: true
|
require: true
|
||||||
|
},
|
||||||
|
watermark: {
|
||||||
|
type: String,
|
||||||
|
default: ''
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
data() {
|
data() {
|
||||||
|
|||||||
@@ -43,7 +43,7 @@ import { mapGetters } from 'vuex'
|
|||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'file',
|
name: 'file',
|
||||||
props: ['disableds', 'thisFileUploadUrl', 'readonly', 'thisFileType', 'isUploadFile', 'detailDate'],
|
props: ['disableds', 'thisFileUploadUrl', 'readonly', 'thisFileType', 'isUploadFile', 'detailDate','watermark'],
|
||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
visible: false,
|
visible: false,
|
||||||
@@ -91,7 +91,11 @@ import { mapGetters } from 'vuex'
|
|||||||
methods: {
|
methods: {
|
||||||
...mapGetters(['userInfo']),
|
...mapGetters(['userInfo']),
|
||||||
download() {
|
download() {
|
||||||
downloadFile('/sys/common/downLoadFile', this.template.templateName, { id: this.template.templateId })
|
if(this.watermark == 'download'){
|
||||||
|
downloadFile('/sys/common/downLoadFileNOMark', this.template.templateName, { id: this.template.templateId })
|
||||||
|
} else {
|
||||||
|
downloadFile('/sys/common/downLoadFile', this.template.templateName, { id: this.template.templateId })
|
||||||
|
}
|
||||||
},
|
},
|
||||||
perentHandleFunc(data) {
|
perentHandleFunc(data) {
|
||||||
this.myfileList = data
|
this.myfileList = data
|
||||||
@@ -220,7 +224,11 @@ import { mapGetters } from 'vuex'
|
|||||||
// let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix)
|
// let url = window._CONFIG['onlinePreviewDomainURL'] + '?url=' + Base64.encode(this.downLoadFileUrl + '/' + fileQuery.id + fileSuffix)
|
||||||
// window.open(url, '_blank')
|
// window.open(url, '_blank')
|
||||||
// } else {
|
// } else {
|
||||||
|
if(this.watermark == 'download'){
|
||||||
|
downloadFile('/sys/common/downLoadFileNOMark', fileQuery.fileName, { id: fileQuery.id })
|
||||||
|
}else {
|
||||||
downloadFile('/sys/common/downLoadFile', fileQuery.fileName, { id: fileQuery.id })
|
downloadFile('/sys/common/downLoadFile', fileQuery.fileName, { id: fileQuery.id })
|
||||||
|
}
|
||||||
// }
|
// }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user