Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
V
vehicle-quality-review
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
王飞
vehicle-quality-review
Commits
0ed84579
Commit
0ed84579
authored
Feb 29, 2024
by
盖献康
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
PDF - 检验报告模板 (一半)、通过角色名查询用户信息接口
parent
d88f7418
Changes
10
Show whitespace changes
Inline
Side-by-side
Showing
10 changed files
with
556 additions
and
106 deletions
+556
-106
InspectionReportPdfVO.java
.../main/java/com/ruoyi/domain/vo/InspectionReportPdfVO.java
+153
-0
PdfTemplateManagementService.java
.../java/com/ruoyi/service/PdfTemplateManagementService.java
+17
-0
BookServiceImpl.java
...src/main/java/com/ruoyi/service/impl/BookServiceImpl.java
+82
-82
PdfTemplateManagementServiceImpl.java
.../ruoyi/service/impl/PdfTemplateManagementServiceImpl.java
+180
-0
PdfTemplateManagementController.java
...n/java/com/ruoyi/web/PdfTemplateManagementController.java
+42
-0
StandardController.java
...eview/src/main/java/com/ruoyi/web/StandardController.java
+1
-0
UserByRoleRequest.java
...rc/main/java/com/ruoyi/web/request/UserByRoleRequest.java
+29
-0
receipt_template_02_27.pdf
...ew/src/main/resources/template/receipt_template_02_27.pdf
+0
-0
SysUserController.java
...va/com/ruoyi/web/controller/system/SysUserController.java
+28
-1
ISysUserService.java
...c/main/java/com/ruoyi/system/service/ISysUserService.java
+24
-23
No files found.
quality-review/src/main/java/com/ruoyi/domain/vo/InspectionReportPdfVO.java
0 → 100644
View file @
0ed84579
package
com
.
ruoyi
.
domain
.
vo
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
/**
* 检验报告PDF VO类
* @author gxk
*/
@Data
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
class
InspectionReportPdfVO
{
/**
* 报告编号
*/
private
String
reportNumber
;
/**
* 产品名称
*/
private
String
productName
;
/**
* 产品型号
*/
private
String
productModel
;
/**
* 委托单位
*/
private
String
entrustedUnit
;
/**
* 检验中心名称
*/
private
String
inspectionCenterName
;
/**
* 检验中心地址
*/
private
String
inspectionCenterAddress
;
/**
* 检验中心电话
*/
private
String
inspectionCenterTelephone
;
/**
* 检验中心邮编
*/
private
String
inspectionCenterPostcode
;
/**
* 委托单位地址
*/
private
String
clientAddress
;
/**
* 委托单位电话
*/
private
String
entrustedUnitTelephone
;
/**
* 委托单位邮编
*/
private
String
clientPostalCode
;
/**
* 样品名称
*/
private
String
sampleName
;
/**
* 型号规格
*/
private
String
typeSpecification
;
/**
* 生产企业
*/
private
String
productionEnterprise
;
/**
* 送样者
*/
private
String
sampleSender
;
/**
* 送样日期
*/
private
String
sampleDeliveryDate
;
/**
* 样品数量
*/
private
String
sampleQuantity
;
/**
* 生产日期
*/
private
String
productionDate
;
/**
* 检验项目
*/
private
String
inspectionItem
;
/**
* 检验结论
*/
private
String
testConclusion
;
/**
* 签发日期
*/
private
String
issueDate
;
/**
* 备注
*/
private
String
remark
;
/**
* 任务编号
*/
private
String
taskNumber
;
/**
*
*/
private
String
sampleSum
;
/**
* 车辆类型
*/
private
String
vehicleType
;
/**
* 车辆识别码
*/
private
String
vehicleIdentificationNumber
;
/**
* 样品编号汇总
*/
private
String
sampleNumberSummary
;
}
quality-review/src/main/java/com/ruoyi/service/PdfTemplateManagementService.java
0 → 100644
View file @
0ed84579
package
com
.
ruoyi
.
service
;
import
javax.servlet.http.HttpServletResponse
;
/**
* PDF模板管理Service接口
* @author gxk
*/
public
interface
PdfTemplateManagementService
{
/**
* 检验报告PDF下载
* @param response
* @throws Exception
*/
void
generateInspectionReport
(
HttpServletResponse
response
)
throws
Exception
;
}
quality-review/src/main/java/com/ruoyi/service/impl/BookServiceImpl.java
View file @
0ed84579
...
@@ -270,60 +270,60 @@ public class BookServiceImpl extends ServiceImpl<BookMapper, Book> implements Bo
...
@@ -270,60 +270,60 @@ public class BookServiceImpl extends ServiceImpl<BookMapper, Book> implements Bo
@Override
@Override
public
void
generateTempPDF
(
HttpServletResponse
response
)
throws
Exception
{
public
void
generateTempPDF
(
HttpServletResponse
response
)
throws
Exception
{
PdfReader
reader
=
null
;
//
PdfReader reader = null;
PdfStamper
ps
=
null
;
//
PdfStamper ps = null;
OutputStream
fos
=
null
;
//
OutputStream fos = null;
ByteArrayOutputStream
bos
=
null
;
//
ByteArrayOutputStream bos = null;
Base64
.
InputStream
fin
=
null
;
//
Base64.InputStream fin = null;
ServletOutputStream
out
=
null
;
//
ServletOutputStream out = null;
try
{
//
try {
// 模板绝对路径--服务器
//
// 模板绝对路径--服务器
String
fileName
=
"/template/receipt_template.pdf"
;
//
String fileName = "/template/receipt_template.pdf";
// 读取现有模板内容
//
// 读取现有模板内容
reader
=
new
PdfReader
(
fileName
);
//
reader = new PdfReader(fileName);
// 创建输出流
//
// 创建输出流
bos
=
new
ByteArrayOutputStream
();
//
bos = new ByteArrayOutputStream();
// 实例化PdfStamper准备编辑pdf内容
//
// 实例化PdfStamper准备编辑pdf内容
ps
=
new
PdfStamper
(
reader
,
bos
);
//
ps = new PdfStamper(reader, bos);
//
// 获取表单所有元素
//
// 获取表单所有元素
AcroFields
fields
=
ps
.
getAcroFields
();
//
AcroFields fields = ps.getAcroFields();
//
// 设置具体字体格式的编码, 不设置的话中文可能不会显示
//
// 设置具体字体格式的编码, 不设置的话中文可能不会显示
BaseFont
bf
=
BaseFont
.
createFont
(
"STSongStd-Light"
,
"UniGB-UCS2-H"
,
BaseFont
.
NOT_EMBEDDED
);
//
BaseFont bf = BaseFont.createFont("STSongStd-Light", "UniGB-UCS2-H", BaseFont.NOT_EMBEDDED);
fields
.
addSubstitutionFont
(
bf
);
//
fields.addSubstitutionFont(bf);
//
// 动态添加所需要的数据,key跟模板中对应文本域名称一致
//
// 动态添加所需要的数据,key跟模板中对应文本域名称一致
Map
<
String
,
String
>
map
=
new
HashMap
<>();
//
Map<String, String> map = new HashMap<>();
map
.
put
(
"code"
,
"1234567890fjdksjfdsfdsffdsjfdssssssttttttttttttttt"
);
//
map.put("code", "1234567890fjdksjfdsfdsffdsjfdssssssttttttttttttttt");
map
.
put
(
"table_image"
,
"C:/Users/gxk/Pictures/Saved Pictures/nvm.png"
);
//
map.put("table_image", "C:/Users/gxk/Pictures/Saved Pictures/nvm.png");
//
// 渲染
//
// 渲染
fillData
(
fields
,
map
,
ps
);
//
fillData(fields, map, ps);
//
//必须要调用这个,否则文档不会生成的
//
//必须要调用这个,否则文档不会生成的
ps
.
setFormFlattening
(
true
);
//
ps.setFormFlattening(true);
if
(
ps
!=
null
){
//
if(ps != null){
ps
.
close
();
//
ps.close();
}
//
}
//生成pdf路径存放的路径
//
//生成pdf路径存放的路径
fos
=
response
.
getOutputStream
();
//
fos = response.getOutputStream();
fos
.
write
(
bos
.
toByteArray
());
//
fos.write(bos.toByteArray());
//
}
catch
(
Exception
e
){
//
}catch (Exception e){
e
.
printStackTrace
();
//
e.printStackTrace();
}
finally
{
//
}finally {
if
(
fos
!=
null
){
//
if(fos!=null){
fos
.
flush
();
//
fos.flush();
fos
.
close
();
//
fos.close();
}
//
}
if
(
bos
!=
null
){
//
if (bos != null){
bos
.
close
();
//
bos.close();
}
//
}
if
(
reader
!=
null
){
//
if(reader != null){
reader
.
close
();
//
reader.close();
}
//
}
}
//
}
}
}
/**
/**
...
@@ -333,19 +333,19 @@ public class BookServiceImpl extends ServiceImpl<BookMapper, Book> implements Bo
...
@@ -333,19 +333,19 @@ public class BookServiceImpl extends ServiceImpl<BookMapper, Book> implements Bo
* @param ps
* @param ps
*/
*/
public
void
fillData
(
AcroFields
fields
,
Map
<
String
,
String
>
data
,
PdfStamper
ps
)
{
public
void
fillData
(
AcroFields
fields
,
Map
<
String
,
String
>
data
,
PdfStamper
ps
)
{
try
{
//
try {
for
(
String
key
:
data
.
keySet
())
{
//
for (String key : data.keySet()) {
String
value
=
data
.
get
(
key
);
//
String value = data.get(key);
if
(
key
.
contains
(
"image"
))
{
//
if (key.contains("image")) {
addImageToPdf
(
key
,
fields
,
ps
,
value
);
//
addImageToPdf(key, fields, ps, value);
continue
;
//
continue;
}
//
}
// 为字段赋值,注意字段名称是区分大小写的
//
// 为字段赋值,注意字段名称是区分大小写的
fields
.
setField
(
key
,
value
);
//
fields.setField(key, value);
}
//
}
}
catch
(
Exception
e
)
{
//
} catch (Exception e) {
e
.
printStackTrace
();
//
e.printStackTrace();
}
//
}
}
}
/**
/**
...
@@ -360,21 +360,21 @@ public class BookServiceImpl extends ServiceImpl<BookMapper, Book> implements Bo
...
@@ -360,21 +360,21 @@ public class BookServiceImpl extends ServiceImpl<BookMapper, Book> implements Bo
*/
*/
private
static
void
addImageToPdf
(
String
key
,
AcroFields
form
,
PdfStamper
stamper
,
String
filePath
)
throws
DocumentException
,
IOException
,
IOException
{
private
static
void
addImageToPdf
(
String
key
,
AcroFields
form
,
PdfStamper
stamper
,
String
filePath
)
throws
DocumentException
,
IOException
,
IOException
{
// 通过图片域名获取所在页和坐标,左下角为起点
//
// 通过图片域名获取所在页和坐标,左下角为起点
int
pageNo
=
form
.
getFieldPositions
(
key
).
get
(
0
).
page
;
//
int pageNo = form.getFieldPositions(key).get(0).page;
Rectangle
signRect
=
form
.
getFieldPositions
(
key
).
get
(
0
).
position
;
//
Rectangle signRect = form.getFieldPositions(key).get(0).position;
float
x
=
signRect
.
getLeft
();
//
float x = signRect.getLeft();
float
y
=
signRect
.
getBottom
();
//
float y = signRect.getBottom();
//
// 读图片
//
// 读图片
Image
image
=
Image
.
getInstance
(
filePath
);
//
Image image = Image.getInstance(filePath);
// 获取操作的页面
//
// 获取操作的页面
PdfContentByte
under
=
stamper
.
getOverContent
(
pageNo
);
//
PdfContentByte under = stamper.getOverContent(pageNo);
// 根据域的大小缩放图片
//
// 根据域的大小缩放图片
image
.
scaleToFit
(
signRect
.
getWidth
()
*
2
,
signRect
.
getHeight
());
//
image.scaleToFit(signRect.getWidth() * 2, signRect.getHeight());
// 添加图片并设置位置(个人通过此设置使得图片垂直水平居中,可参考,具体情况已实际为准)
//
// 添加图片并设置位置(个人通过此设置使得图片垂直水平居中,可参考,具体情况已实际为准)
image
.
setAbsolutePosition
(
x
,
y
);
//
image.setAbsolutePosition(x, y);
under
.
addImage
(
image
);
//
under.addImage(image);
}
}
}
}
...
...
quality-review/src/main/java/com/ruoyi/service/impl/PdfTemplateManagementServiceImpl.java
0 → 100644
View file @
0ed84579
package
com
.
ruoyi
.
service
.
impl
;
import
com.itextpdf.text.DocumentException
;
import
com.itextpdf.text.Image
;
import
com.itextpdf.text.Rectangle
;
import
com.itextpdf.text.pdf.*
;
import
com.ruoyi.domain.vo.PhotoStorageVO
;
import
com.ruoyi.service.PdfTemplateManagementService
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
import
javax.servlet.http.HttpServletResponse
;
import
java.io.ByteArrayOutputStream
;
import
java.io.IOException
;
import
java.io.OutputStream
;
import
java.lang.reflect.Field
;
import
java.util.Map
;
/**
* PDF模板管理Service业务层处理
* @author gxk
*/
@Service
@Transactional
public
class
PdfTemplateManagementServiceImpl
implements
PdfTemplateManagementService
{
/**
* 检验报告PDF下载
* @param response
*/
@Override
public
void
generateInspectionReport
(
HttpServletResponse
response
)
throws
Exception
{
PdfReader
reader
=
null
;
PdfStamper
ps
=
null
;
OutputStream
fos
=
null
;
ByteArrayOutputStream
bos
=
null
;
try
{
// 模板绝对路径--服务器
String
fileName
=
"/template/receipt_template_02_27.pdf"
;
// 读取现有模板内容
reader
=
new
PdfReader
(
fileName
);
// 创建输出流
bos
=
new
ByteArrayOutputStream
();
// 实例化PdfStamper准备编辑pdf内容
ps
=
new
PdfStamper
(
reader
,
bos
);
// 获取表单所有元素
AcroFields
fields
=
ps
.
getAcroFields
();
// 设置具体字体格式的编码, 不设置的话中文可能不会显示
BaseFont
bf
=
BaseFont
.
createFont
(
"STSongStd-Light"
,
"UniGB-UCS2-H"
,
BaseFont
.
NOT_EMBEDDED
);
fields
.
addSubstitutionFont
(
bf
);
// 渲染
// fillData(fields, map, ps);
renderData
(
fields
);
PhotoStorageVO
photoStorageVO
=
new
PhotoStorageVO
();
Class
<?
extends
PhotoStorageVO
>
aClass
=
photoStorageVO
.
getClass
();
Field
[]
declaredFields
=
aClass
.
getDeclaredFields
();
for
(
Field
field
:
declaredFields
)
{
String
name
=
field
.
getName
();
System
.
out
.
println
(
name
);
}
//必须要调用这个,否则文档不会生成的
ps
.
setFormFlattening
(
true
);
if
(
ps
!=
null
){
ps
.
close
();
}
//生成pdf路径存放的路径
fos
=
response
.
getOutputStream
();
fos
.
write
(
bos
.
toByteArray
());
}
catch
(
Exception
e
){
e
.
printStackTrace
();
}
finally
{
if
(
fos
!=
null
){
fos
.
flush
();
fos
.
close
();
}
if
(
bos
!=
null
){
bos
.
close
();
}
if
(
reader
!=
null
){
reader
.
close
();
}
}
}
/**
* 渲染数据
* @param fields
*/
private
void
renderData
(
AcroFields
fields
)
{
}
/**
* 填充模板中的数据
* @param fields
* @param data 是一个Map<String,String> 主要存储 key 表单模板中的单元格名 value为想要赋的值,遍历
* @param ps
*/
public
void
fillData
(
AcroFields
fields
,
Map
<
String
,
String
>
data
,
PdfStamper
ps
)
{
try
{
for
(
String
key
:
data
.
keySet
())
{
String
value
=
data
.
get
(
key
);
if
(
key
.
contains
(
"image"
))
{
addImageToPdf
(
key
,
fields
,
ps
,
value
);
continue
;
}
// 为字段赋值,注意字段名称是区分大小写的
fields
.
setField
(
key
,
value
);
}
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
/**
* 添加图片
* @param key 应为模板名
* @param form 动态字段
* @param stamper
* @param filePath 本地图片路径
* @throws DocumentException
* @throws IOException
* @throws IOException
*/
private
static
void
addImageToPdf
(
String
key
,
AcroFields
form
,
PdfStamper
stamper
,
String
filePath
)
throws
DocumentException
,
IOException
,
IOException
{
// 通过图片域名获取所在页和坐标,左下角为起点
int
pageNo
=
form
.
getFieldPositions
(
key
).
get
(
0
).
page
;
Rectangle
signRect
=
form
.
getFieldPositions
(
key
).
get
(
0
).
position
;
float
x
=
signRect
.
getLeft
();
float
y
=
signRect
.
getBottom
();
// 读图片
Image
image
=
Image
.
getInstance
(
filePath
);
// 获取操作的页面
PdfContentByte
under
=
stamper
.
getOverContent
(
pageNo
);
// 根据域的大小缩放图片
image
.
scaleToFit
(
signRect
.
getWidth
()
*
2
,
signRect
.
getHeight
());
// 添加图片并设置位置(个人通过此设置使得图片垂直水平居中,可参考,具体情况已实际为准)
image
.
setAbsolutePosition
(
x
,
y
);
under
.
addImage
(
image
);
}
/**
* 通过属性名获取属性在对象里的值
* @param obj
* @param propertyName
* @return
* @param <T>
*/
public
static
<
T
>
T
getPropertyValue
(
Object
obj
,
String
propertyName
)
{
try
{
// 获取对象的类
Class
<?>
objClass
=
obj
.
getClass
();
// 获取类的指定属性
Field
field
=
objClass
.
getDeclaredField
(
propertyName
);
// 设置属性为可访问
field
.
setAccessible
(
true
);
// 获取属性的值
@SuppressWarnings
(
"unchecked"
)
T
value
=
(
T
)
field
.
get
(
obj
);
return
value
;
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
return
null
;
}
}
}
quality-review/src/main/java/com/ruoyi/web/PdfTemplateManagementController.java
0 → 100644
View file @
0ed84579
package
com
.
ruoyi
.
web
;
import
com.ruoyi.common.annotation.Anonymous
;
import
com.ruoyi.service.PdfTemplateManagementService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.springframework.beans.factory.annotation.Autowired
;
import
org.springframework.web.bind.annotation.GetMapping
;
import
org.springframework.web.bind.annotation.RequestMapping
;
import
org.springframework.web.bind.annotation.RestController
;
import
javax.servlet.http.HttpServletResponse
;
/**
* @author gxk
*/
@Api
(
tags
=
"PDF模板管理"
)
@RestController
@RequestMapping
(
"/pdf"
)
public
class
PdfTemplateManagementController
{
@Autowired
private
PdfTemplateManagementService
pdfTemplateManagementService
;
/**
* 检验报告PDF下载
* @param response
*/
@Anonymous
@ApiOperation
(
"检验报告PDF下载"
)
@GetMapping
(
value
=
"/inspectionReport"
,
produces
=
"application/json"
)
public
void
download
(
HttpServletResponse
response
)
{
response
.
setHeader
(
"content-disposition"
,
"attachment;fileName="
+
"ReceiptPrinter.pdf"
);
try
{
// demo-模板
pdfTemplateManagementService
.
generateInspectionReport
(
response
);
}
catch
(
Exception
e
)
{
e
.
printStackTrace
();
}
}
}
quality-review/src/main/java/com/ruoyi/web/StandardController.java
View file @
0ed84579
package
com
.
ruoyi
.
web
;
package
com
.
ruoyi
.
web
;
import
com.ruoyi.common.annotation.Anonymous
;
import
com.ruoyi.common.annotation.Log
;
import
com.ruoyi.common.annotation.Log
;
import
com.ruoyi.common.core.controller.BaseController
;
import
com.ruoyi.common.core.controller.BaseController
;
import
com.ruoyi.common.core.domain.R
;
import
com.ruoyi.common.core.domain.R
;
...
...
quality-review/src/main/java/com/ruoyi/web/request/UserByRoleRequest.java
0 → 100644
View file @
0ed84579
package
com
.
ruoyi
.
web
.
request
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.Builder
;
import
lombok.Data
;
import
lombok.NoArgsConstructor
;
import
javax.validation.constraints.NotEmpty
;
import
javax.validation.constraints.NotNull
;
/**
* 通过角色查询用户信息DTO
* @author gxk
*/
@Data
@ApiModel
@Builder
@NoArgsConstructor
@AllArgsConstructor
public
class
UserByRoleRequest
{
@ApiModelProperty
(
"角色名称"
)
@NotNull
(
message
=
"角色名称不能为空"
)
@NotEmpty
(
message
=
"角色名称不能为空"
)
private
String
roleName
;
}
quality-review/src/main/resources/template/receipt_template_02_27.pdf
0 → 100644
View file @
0ed84579
File added
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java
View file @
0ed84579
...
@@ -3,6 +3,12 @@ package com.ruoyi.web.controller.system;
...
@@ -3,6 +3,12 @@ package com.ruoyi.web.controller.system;
import
java.util.List
;
import
java.util.List
;
import
java.util.stream.Collectors
;
import
java.util.stream.Collectors
;
import
javax.servlet.http.HttpServletResponse
;
import
javax.servlet.http.HttpServletResponse
;
import
cn.hutool.core.collection.CollUtil
;
import
com.ruoyi.common.core.domain.R
;
import
com.ruoyi.web.request.UserByRoleRequest
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.apache.commons.lang3.ArrayUtils
;
import
org.apache.skywalking.apm.toolkit.trace.Tag
;
import
org.apache.skywalking.apm.toolkit.trace.Tag
;
import
org.apache.skywalking.apm.toolkit.trace.Tags
;
import
org.apache.skywalking.apm.toolkit.trace.Tags
;
...
@@ -40,6 +46,7 @@ import com.ruoyi.system.service.ISysUserService;
...
@@ -40,6 +46,7 @@ import com.ruoyi.system.service.ISysUserService;
*
*
* @author ruoyi
* @author ruoyi
*/
*/
@Api
(
tags
=
"用户信息"
)
@RestController
@RestController
@RequestMapping
(
"/system/user"
)
@RequestMapping
(
"/system/user"
)
public
class
SysUserController
extends
BaseController
public
class
SysUserController
extends
BaseController
...
@@ -70,6 +77,26 @@ public class SysUserController extends BaseController
...
@@ -70,6 +77,26 @@ public class SysUserController extends BaseController
return
getDataTable
(
list
);
return
getDataTable
(
list
);
}
}
/**
* 通过角色名获取用户信息
* @param request
* @return
*/
@ApiOperation
(
"通过角色名获取用户信息"
)
@PostMapping
(
"/getUserByRole"
)
public
R
<
List
<
SysUser
>>
getUserByRole
(
@Validated
@RequestBody
UserByRoleRequest
request
)
{
// 通过角色名获取角色信息
SysRole
role
=
new
SysRole
();
role
.
setRoleName
(
request
.
getRoleName
());
List
<
SysRole
>
roleList
=
roleService
.
selectRoleList
(
role
);
if
(
CollUtil
.
isNotEmpty
(
roleList
))
{
List
<
SysUser
>
list
=
userService
.
selectUserListByRoleId
(
roleList
.
get
(
0
).
getRoleId
());
return
R
.
ok
(
list
);
}
else
{
return
R
.
fail
(
"角色不存在"
);
}
}
@Trace
@Trace
@Tags
({
@Tag
(
key
=
"param"
,
value
=
"arg[0]"
),
@Tag
(
key
=
"param1"
,
value
=
"arg[1]"
),
@Tag
(
key
=
"result"
,
value
=
"returnedObj"
)})
@Tags
({
@Tag
(
key
=
"param"
,
value
=
"arg[0]"
),
@Tag
(
key
=
"param1"
,
value
=
"arg[1]"
),
@Tag
(
key
=
"result"
,
value
=
"returnedObj"
)})
@Log
(
title
=
"用户管理"
,
businessType
=
BusinessType
.
EXPORT
)
@Log
(
title
=
"用户管理"
,
businessType
=
BusinessType
.
EXPORT
)
...
...
ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java
View file @
0ed84579
...
@@ -218,4 +218,5 @@ public interface ISysUserService
...
@@ -218,4 +218,5 @@ public interface ISysUserService
* @return 结果
* @return 结果
*/
*/
public
String
importUser
(
List
<
SysUser
>
userList
,
Boolean
isUpdateSupport
,
String
operName
);
public
String
importUser
(
List
<
SysUser
>
userList
,
Boolean
isUpdateSupport
,
String
operName
);
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment