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
1d1b8ff2
Commit
1d1b8ff2
authored
May 11, 2024
by
wdy
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
科恩根据章节查询用例列表&用户管理查看详情&编辑标准
parent
15907749
Changes
13
Hide whitespace changes
Inline
Side-by-side
Showing
13 changed files
with
179 additions
and
9 deletions
+179
-9
TestUseCaseService.java
...w/src/main/java/com/ruoyi/service/TestUseCaseService.java
+9
-0
StandardServiceImpl.java
...main/java/com/ruoyi/service/impl/StandardServiceImpl.java
+11
-3
TestUseCaseServiceImpl.java
...n/java/com/ruoyi/service/impl/TestUseCaseServiceImpl.java
+40
-1
TestUserCaseController.java
...w/src/main/java/com/ruoyi/web/TestUserCaseController.java
+18
-0
StandardEditRequest.java
.../main/java/com/ruoyi/web/request/StandardEditRequest.java
+2
-1
SysUserController.java
...va/com/ruoyi/web/controller/system/SysUserController.java
+11
-4
pom.xml
ruoyi-common/pom.xml
+4
-0
SysUser.java
...ain/java/com/ruoyi/common/core/domain/entity/SysUser.java
+13
-0
SysUserSignaturePicture.java
...yi/common/core/domain/entity/SysUserSignaturePicture.java
+24
-0
SysUserSignaturePictureMapper.java
...om/ruoyi/system/mapper/SysUserSignaturePictureMapper.java
+10
-0
SysUserSignaturePictureService.java
.../ruoyi/system/service/SysUserSignaturePictureService.java
+9
-0
SysUserSignaturePictureServiceImpl.java
...stem/service/impl/SysUserSignaturePictureServiceImpl.java
+15
-0
SysUserSignaturePictureMapper.xml
...resources/mapper/system/SysUserSignaturePictureMapper.xml
+13
-0
No files found.
quality-review/src/main/java/com/ruoyi/service/TestUseCaseService.java
View file @
1d1b8ff2
...
...
@@ -3,6 +3,7 @@ package com.ruoyi.service;
import
com.alibaba.fastjson2.JSONObject
;
import
com.ruoyi.domain.TestUseCase
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.ruoyi.domain.vo.UseCaseUrlVO
;
import
com.ruoyi.web.request.TestUseCaseByScenarioRequest
;
import
com.ruoyi.web.request.TestUseCaseIdListRequest
;
import
com.ruoyi.web.request.TestUserCaseRequest
;
...
...
@@ -64,4 +65,12 @@ public interface TestUseCaseService extends IService<TestUseCase> {
* @throws IOException
*/
UseCaseResponse
getUseCaseMsg
(
String
request
)
throws
IOException
;
/**
* 科恩根据章节查询用例列表
* @param request
* @return
* @throws IOException
*/
List
<
UseCaseUrlVO
>
getUseCaseByChapter
(
String
request
)
throws
IOException
;
}
quality-review/src/main/java/com/ruoyi/service/impl/StandardServiceImpl.java
View file @
1d1b8ff2
...
...
@@ -16,6 +16,7 @@ import org.springframework.beans.factory.annotation.Autowired;
import
org.springframework.stereotype.Service
;
import
com.ruoyi.web.response.StandardResponse
;
import
java.util.ArrayList
;
import
java.util.List
;
@Service
...
...
@@ -65,11 +66,18 @@ public class StandardServiceImpl extends ServiceImpl<StandardMapper, Standard> i
standardInspectionItemRelationMapper
.
deleteBatchIds
(
list
);
}
List
<
StandardInspectionItemRelation
>
relations
=
request
.
getDictList
();
List
<
DictDataVO
>
relations
=
request
.
getDictList
();
List
<
StandardInspectionItemRelation
>
relationList
=
new
ArrayList
<>();
if
(
relations
!=
null
&&
relations
.
size
()
!=
0
)
{
standardInspectionItemRelationService
.
saveBatch
(
relations
);
for
(
DictDataVO
vo
:
relations
)
{
StandardInspectionItemRelation
relation
=
new
StandardInspectionItemRelation
();
relation
.
setStandardId
(
request
.
getId
());
relation
.
setDictCode
(
vo
.
getDictCode
());
relationList
.
add
(
relation
);
}
standardInspectionItemRelationService
.
saveBatch
(
relationList
);
}
standardService
.
updateById
(
standard
);
}
...
...
quality-review/src/main/java/com/ruoyi/service/impl/TestUseCaseServiceImpl.java
View file @
1d1b8ff2
...
...
@@ -108,7 +108,7 @@ public class TestUseCaseServiceImpl extends ServiceImpl<TestUseCaseMapper, TestU
MediaType
mediaType
=
MediaType
.
parse
(
"application/json"
);
// 创建请求体
RequestBody
body
=
RequestBody
.
create
(
mediaType
,
"{\"query\":\"query useCases($offset:OffsetConnectionInput$orderBy:OrderByInput$filter:Map$search:String
){useCases(offset:$offset orderBy:$orderBy filterFields:$filter search:$search
){nodes{id displayID class name description remediation requirements riskLevel method{name}scenario{name}}totalCount}}\",\"variables\":"
+
request
+
"}"
);
RequestBody
body
=
RequestBody
.
create
(
mediaType
,
"{\"query\":\"query useCases($offset:OffsetConnectionInput$orderBy:OrderByInput$filter:Map$search:String
$searchFields:Map){useCases(offset:$offset orderBy:$orderBy filterFields:$filter search:$search searchFields:$searchFields
){nodes{id displayID class name description remediation requirements riskLevel method{name}scenario{name}}totalCount}}\",\"variables\":"
+
request
+
"}"
);
Request
requestKE
=
new
Request
.
Builder
()
.
url
(
"http://10.12.48.80:8089/api/query"
)
...
...
@@ -185,6 +185,45 @@ public class TestUseCaseServiceImpl extends ServiceImpl<TestUseCaseMapper, TestU
return
caseResponse
;
}
/**
* 科恩根据章节查询用例列表
* @param request
* @return
* @throws IOException
*/
@Override
public
List
<
UseCaseUrlVO
>
getUseCaseByChapter
(
String
request
)
throws
IOException
{
OkHttpClient
client
=
new
OkHttpClient
().
newBuilder
().
build
();
MediaType
mediaType
=
MediaType
.
parse
(
"application/json"
);
RequestBody
body
=
RequestBody
.
create
(
mediaType
,
"{\"query\":\"query regulationItemDetail($regulationItemID:ID!){node(id:$regulationItemID){...on RegulationItem{id serialNumber testMethod requirements useCases{id displayID name description scenario{name}method{name}}}}}\",\"variables\":"
+
request
+
"}"
);
Request
requestKE
=
new
Request
.
Builder
()
.
url
(
"http://10.12.48.80:8089/api/query"
)
.
method
(
"POST"
,
body
)
.
addHeader
(
"Content-Type"
,
"application/json"
)
// TODO 连接
// .addHeader("Host", "10.12.48.80:8089")
// .addHeader("Origin", "http://10.12.48.80:8089")
// .addHeader("Referer", "http://10.12.48.80:8089/api/graphql/playground")
// .addHeader("User-Agent", "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36")
.
build
();
Response
response
=
client
.
newCall
(
requestKE
).
execute
();
String
string
=
response
.
body
().
string
();
JSONObject
jsonObject
=
JSONObject
.
parseObject
(
string
);
// 获取测试用例
List
<
UseCaseUrlVO
>
list
=
new
ArrayList
<>();
if
(
jsonObject
.
getJSONObject
(
"data"
).
getJSONObject
(
"node"
)
!=
null
)
{
list
=
jsonObject
.
getJSONObject
(
"data"
).
getJSONObject
(
"node"
).
getList
(
"useCases"
,
UseCaseUrlVO
.
class
);
}
return
list
;
}
}
...
...
quality-review/src/main/java/com/ruoyi/web/TestUserCaseController.java
View file @
1d1b8ff2
...
...
@@ -3,6 +3,7 @@ import com.ruoyi.common.core.controller.BaseController;
import
com.ruoyi.common.core.domain.R
;
import
com.ruoyi.common.core.page.TableDataInfo
;
import
com.ruoyi.domain.TestUseCase
;
import
com.ruoyi.domain.vo.UseCaseUrlVO
;
import
com.ruoyi.service.TestUseCaseService
;
import
com.ruoyi.web.request.TestUseCaseByScenarioRequest
;
import
com.ruoyi.web.request.TestUseCaseIdListRequest
;
...
...
@@ -94,4 +95,21 @@ public class TestUserCaseController extends BaseController{
}
/**
* 科恩根据章节查询用例列表
* @param request
* @return
* @throws IOException
*/
@ApiOperation
(
"科恩根据章节查询用例列表"
)
@Trace
@Tags
({
@Tag
(
key
=
"param"
,
value
=
"arg[0]"
),
@Tag
(
key
=
"result"
,
value
=
"returnedObj"
)})
@RequestMapping
(
method
=
RequestMethod
.
POST
,
value
=
"/getUseCaseByChapter"
,
produces
=
"application/json;charset=UTF-8"
)
public
TableDataInfo
<
UseCaseUrlVO
>
getUseCaseByChapter
(
@Validated
@RequestBody
String
request
)
throws
IOException
{
List
<
UseCaseUrlVO
>
list
=
testUseCaseService
.
getUseCaseByChapter
(
request
);
return
getDataTable
(
list
);
}
}
quality-review/src/main/java/com/ruoyi/web/request/StandardEditRequest.java
View file @
1d1b8ff2
...
...
@@ -2,6 +2,7 @@ package com.ruoyi.web.request;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
com.ruoyi.domain.StandardInspectionItemRelation
;
import
com.ruoyi.domain.vo.DictDataVO
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
...
...
@@ -39,5 +40,5 @@ public class StandardEditRequest {
private
Date
implementationDate
;
@ApiModelProperty
(
"检验项id"
)
List
<
StandardInspectionItemRelation
>
dictList
;
List
<
DictDataVO
>
dictList
;
}
ruoyi-admin/src/main/java/com/ruoyi/web/controller/system/SysUserController.java
View file @
1d1b8ff2
...
...
@@ -6,6 +6,9 @@ import javax.servlet.http.HttpServletResponse;
import
cn.hutool.core.collection.CollUtil
;
import
com.ruoyi.common.core.domain.R
;
import
com.ruoyi.common.core.domain.entity.SysUserSignaturePicture
;
import
com.ruoyi.system.mapper.SysUserSignaturePictureMapper
;
import
com.ruoyi.system.service.*
;
import
com.ruoyi.web.request.UserByRoleRequest
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.ApiOperation
;
...
...
@@ -36,10 +39,6 @@ import com.ruoyi.common.enums.BusinessType;
import
com.ruoyi.common.utils.SecurityUtils
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.common.utils.poi.ExcelUtil
;
import
com.ruoyi.system.service.ISysDeptService
;
import
com.ruoyi.system.service.ISysPostService
;
import
com.ruoyi.system.service.ISysRoleService
;
import
com.ruoyi.system.service.ISysUserService
;
/**
* 用户信息
...
...
@@ -63,6 +62,12 @@ public class SysUserController extends BaseController
@Autowired
private
ISysPostService
postService
;
@Autowired
private
SysUserSignaturePictureService
sysUserSignaturePictureService
;
@Autowired
private
SysUserSignaturePictureMapper
sysUserSignaturePictureMapper
;
/**
* 获取用户列表
*/
...
...
@@ -149,6 +154,8 @@ public class SysUserController extends BaseController
if
(
StringUtils
.
isNotNull
(
userId
))
{
SysUser
sysUser
=
userService
.
selectUserById
(
userId
);
SysUserSignaturePicture
picture
=
sysUserSignaturePictureService
.
getById
(
userId
);
sysUser
.
setSignaturePicture
(
picture
.
getSignaturePicture
());
ajax
.
put
(
AjaxResult
.
DATA_TAG
,
sysUser
);
ajax
.
put
(
"postIds"
,
postService
.
selectPostListByUserId
(
userId
));
ajax
.
put
(
"roleIds"
,
sysUser
.
getRoles
().
stream
().
map
(
SysRole:
:
getRoleId
).
collect
(
Collectors
.
toList
()));
...
...
ruoyi-common/pom.xml
View file @
1d1b8ff2
...
...
@@ -169,6 +169,10 @@
<artifactId>
itext-asian
</artifactId>
<version>
5.2.0
</version>
</dependency>
<dependency>
<groupId>
org.projectlombok
</groupId>
<artifactId>
lombok
</artifactId>
</dependency>
</dependencies>
</project>
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUser.java
View file @
1d1b8ff2
...
...
@@ -3,6 +3,7 @@ package com.ruoyi.common.core.domain.entity;
import
java.util.Date
;
import
java.util.List
;
import
javax.validation.constraints.*
;
import
com.baomidou.mybatisplus.annotation.TableField
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
com.ruoyi.common.annotation.Excel
;
...
...
@@ -89,6 +90,9 @@ public class SysUser extends BaseEntity
/** 角色ID */
private
Long
roleId
;
@TableField
(
exist
=
false
)
private
String
signaturePicture
;
public
SysUser
()
{
...
...
@@ -297,6 +301,14 @@ public class SysUser extends BaseEntity
this
.
roleId
=
roleId
;
}
public
String
getSignaturePicture
()
{
return
signaturePicture
;
}
public
void
setSignaturePicture
(
String
signaturePicture
)
{
this
.
signaturePicture
=
signaturePicture
;
}
@Override
public
String
toString
()
{
return
new
ToStringBuilder
(
this
,
ToStringStyle
.
MULTI_LINE_STYLE
)
...
...
@@ -319,6 +331,7 @@ public class SysUser extends BaseEntity
.
append
(
"updateTime"
,
getUpdateTime
())
.
append
(
"remark"
,
getRemark
())
.
append
(
"dept"
,
getDept
())
.
append
(
"signaturePicture"
,
getSignaturePicture
())
.
toString
();
}
}
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysUserSignaturePicture.java
0 → 100644
View file @
1d1b8ff2
package
com
.
ruoyi
.
common
.
core
.
domain
.
entity
;
import
com.baomidou.mybatisplus.annotation.IdType
;
import
com.baomidou.mybatisplus.annotation.TableId
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
com.fasterxml.jackson.annotation.JsonFormat
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.Data
;
@Data
@ApiModel
(
"用户签字图片"
)
@TableName
(
value
=
"sys_user_signature_picture"
)
public
class
SysUserSignaturePicture
{
/** 用户ID */
@ApiModelProperty
(
"用户ID"
)
@TableId
(
type
=
IdType
.
ASSIGN_ID
)
@JsonFormat
(
shape
=
JsonFormat
.
Shape
.
STRING
)
private
Long
userId
;
@ApiModelProperty
(
"签字图片"
)
private
String
signaturePicture
;
}
ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserSignaturePictureMapper.java
0 → 100644
View file @
1d1b8ff2
package
com
.
ruoyi
.
system
.
mapper
;
import
com.baomidou.mybatisplus.core.mapper.BaseMapper
;
import
com.ruoyi.common.core.domain.entity.SysUserSignaturePicture
;
import
org.springframework.stereotype.Repository
;
@Repository
public
interface
SysUserSignaturePictureMapper
extends
BaseMapper
<
SysUserSignaturePicture
>
{
}
ruoyi-system/src/main/java/com/ruoyi/system/service/SysUserSignaturePictureService.java
0 → 100644
View file @
1d1b8ff2
package
com
.
ruoyi
.
system
.
service
;
import
com.baomidou.mybatisplus.extension.service.IService
;
import
com.ruoyi.common.core.domain.entity.SysUserSignaturePicture
;
public
interface
SysUserSignaturePictureService
extends
IService
<
SysUserSignaturePicture
>
{
}
ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserSignaturePictureServiceImpl.java
0 → 100644
View file @
1d1b8ff2
package
com
.
ruoyi
.
system
.
service
.
impl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.ruoyi.common.core.domain.entity.SysUserSignaturePicture
;
import
com.ruoyi.system.mapper.SysUserSignaturePictureMapper
;
import
com.ruoyi.system.service.SysUserSignaturePictureService
;
import
org.springframework.stereotype.Service
;
import
org.springframework.transaction.annotation.Transactional
;
@Service
@Transactional
public
class
SysUserSignaturePictureServiceImpl
extends
ServiceImpl
<
SysUserSignaturePictureMapper
,
SysUserSignaturePicture
>
implements
SysUserSignaturePictureService
{
}
ruoyi-system/src/main/resources/mapper/system/SysUserSignaturePictureMapper.xml
0 → 100644
View file @
1d1b8ff2
<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper
namespace=
"com.ruoyi.system.mapper.SysUserSignaturePictureMapper"
>
<resultMap
id=
"BaseResultMap"
type=
"SysUserSignaturePicture"
>
<id
property=
"userId"
column=
"user_id"
jdbcType=
"BIGINT"
/>
<result
property=
"signaturePicture"
column=
"signature_picture"
jdbcType=
"VARCHAR"
/>
</resultMap>
</mapper>
\ No newline at end of file
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