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
d9a4e3ba
Commit
d9a4e3ba
authored
Dec 03, 2024
by
宋源硕
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'dev' into 'master'
2024/11/29修改接口 See merge request
!472
parents
03acdbd5
dcc494a0
Changes
23
Hide whitespace changes
Inline
Side-by-side
Showing
23 changed files
with
228 additions
and
43 deletions
+228
-43
AutomobileEnterprise.java
.../src/main/java/com/ruoyi/domain/AutomobileEnterprise.java
+3
-0
CarReviewTask.java
...-review/src/main/java/com/ruoyi/domain/CarReviewTask.java
+3
-0
ModelTestTask.java
...-review/src/main/java/com/ruoyi/domain/ModelTestTask.java
+3
-0
Sample.java
quality-review/src/main/java/com/ruoyi/domain/Sample.java
+4
-1
SystemReviewTask.java
...view/src/main/java/com/ruoyi/domain/SystemReviewTask.java
+3
-0
Task.java
quality-review/src/main/java/com/ruoyi/domain/Task.java
+3
-0
QuantityStatisticsVO.java
...c/main/java/com/ruoyi/domain/vo/QuantityStatisticsVO.java
+2
-1
StatisticsHomeMapper.java
.../src/main/java/com/ruoyi/mapper/StatisticsHomeMapper.java
+6
-3
StatisticsHomeService.java
...rc/main/java/com/ruoyi/service/StatisticsHomeService.java
+4
-3
AutomobileEnterpriseServiceImpl.java
...m/ruoyi/service/impl/AutomobileEnterpriseServiceImpl.java
+12
-0
SampleManagementServiceImpl.java
...a/com/ruoyi/service/impl/SampleManagementServiceImpl.java
+17
-5
StatisticsHomeServiceImpl.java
...ava/com/ruoyi/service/impl/StatisticsHomeServiceImpl.java
+16
-6
TaskServiceImpl.java
...src/main/java/com/ruoyi/service/impl/TaskServiceImpl.java
+23
-3
SampleManagementController.java
...c/main/java/com/ruoyi/web/SampleManagementController.java
+1
-1
StatisticsHomeController.java
...src/main/java/com/ruoyi/web/StatisticsHomeController.java
+7
-3
TaskFindResponse.java
...rc/main/java/com/ruoyi/web/response/TaskFindResponse.java
+2
-0
AutomobileEnterpriseMapper.xml
.../src/main/resources/mapper/AutomobileEnterpriseMapper.xml
+4
-0
SampleManagementMapper.xml
...view/src/main/resources/mapper/SampleManagementMapper.xml
+7
-0
StatisticsHomeMapper.xml
...review/src/main/resources/mapper/StatisticsHomeMapper.xml
+84
-14
TaskMapper.xml
quality-review/src/main/resources/mapper/TaskMapper.xml
+3
-0
SysDept.java
...ain/java/com/ruoyi/common/core/domain/entity/SysDept.java
+3
-1
PageDomain.java
.../src/main/java/com/ruoyi/common/core/page/PageDomain.java
+3
-2
DataScopeAspect.java
...ain/java/com/ruoyi/framework/aspectj/DataScopeAspect.java
+15
-0
No files found.
quality-review/src/main/java/com/ruoyi/domain/AutomobileEnterprise.java
View file @
d9a4e3ba
...
@@ -63,4 +63,7 @@ public class AutomobileEnterprise extends BaseEntity
...
@@ -63,4 +63,7 @@ public class AutomobileEnterprise extends BaseEntity
@Excel
(
name
=
"企业类型"
)
@Excel
(
name
=
"企业类型"
)
@ApiModelProperty
(
"企业类型"
)
@ApiModelProperty
(
"企业类型"
)
private
String
enterpriseType
;
private
String
enterpriseType
;
@ApiModelProperty
(
"部门id"
)
private
Long
deptId
;
}
}
quality-review/src/main/java/com/ruoyi/domain/CarReviewTask.java
View file @
d9a4e3ba
...
@@ -181,4 +181,7 @@ public class CarReviewTask implements Serializable {
...
@@ -181,4 +181,7 @@ public class CarReviewTask implements Serializable {
@ApiModelProperty
(
"版本"
)
@ApiModelProperty
(
"版本"
)
private
String
version
;
private
String
version
;
@ApiModelProperty
(
"部门id"
)
private
Long
deptId
;
}
}
quality-review/src/main/java/com/ruoyi/domain/ModelTestTask.java
View file @
d9a4e3ba
...
@@ -126,4 +126,7 @@ public class ModelTestTask {
...
@@ -126,4 +126,7 @@ public class ModelTestTask {
@ApiModelProperty
(
"试验方案ID"
)
@ApiModelProperty
(
"试验方案ID"
)
private
String
testSchemeId
;
private
String
testSchemeId
;
@ApiModelProperty
(
"部门id"
)
private
Long
deptId
;
}
}
quality-review/src/main/java/com/ruoyi/domain/Sample.java
View file @
d9a4e3ba
...
@@ -15,7 +15,7 @@ import lombok.Data;
...
@@ -15,7 +15,7 @@ import lombok.Data;
/**
/**
* 样品管理对象 t_sample_management
* 样品管理对象 t_sample_management
*
*
* @author ruoyi
* @author ruoyi
* @date 2024-01-29
* @date 2024-01-29
*/
*/
...
@@ -96,4 +96,7 @@ public class Sample extends BaseEntity
...
@@ -96,4 +96,7 @@ public class Sample extends BaseEntity
private
String
enterpriseName
;
private
String
enterpriseName
;
private
List
<
SampleTaskVo
>
taskSampleRelation
;
private
List
<
SampleTaskVo
>
taskSampleRelation
;
@ApiModelProperty
(
"部门id"
)
private
Long
deptId
;
}
}
quality-review/src/main/java/com/ruoyi/domain/SystemReviewTask.java
View file @
d9a4e3ba
...
@@ -185,4 +185,7 @@ public class SystemReviewTask {
...
@@ -185,4 +185,7 @@ public class SystemReviewTask {
@ApiModelProperty
(
"版本"
)
@ApiModelProperty
(
"版本"
)
private
String
version
;
private
String
version
;
@ApiModelProperty
(
"部门id"
)
private
Long
deptId
;
}
}
quality-review/src/main/java/com/ruoyi/domain/Task.java
View file @
d9a4e3ba
...
@@ -191,6 +191,9 @@ public class Task {
...
@@ -191,6 +191,9 @@ public class Task {
@ApiModelProperty
(
"企业名称"
)
@ApiModelProperty
(
"企业名称"
)
private
String
enterpriseName
;
private
String
enterpriseName
;
@ApiModelProperty
(
"部门id"
)
private
Long
deptId
;
/**
/**
* 返回当前节点的下一个节点
* 返回当前节点的下一个节点
*/
*/
...
...
quality-review/src/main/java/com/ruoyi/domain/vo/QuantityStatisticsVO.java
View file @
d9a4e3ba
package
com
.
ruoyi
.
domain
.
vo
;
package
com
.
ruoyi
.
domain
.
vo
;
import
com.ruoyi.common.core.domain.BaseEntity
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
import
lombok.AllArgsConstructor
;
import
lombok.AllArgsConstructor
;
...
@@ -14,7 +15,7 @@ import java.math.BigDecimal;
...
@@ -14,7 +15,7 @@ import java.math.BigDecimal;
@NoArgsConstructor
@NoArgsConstructor
@AllArgsConstructor
@AllArgsConstructor
@ApiModel
(
value
=
"首页数量统计"
)
@ApiModel
(
value
=
"首页数量统计"
)
public
class
QuantityStatisticsVO
{
public
class
QuantityStatisticsVO
extends
BaseEntity
{
@ApiModelProperty
(
"支持标准数量"
)
@ApiModelProperty
(
"支持标准数量"
)
private
Long
standardQuantity
;
private
Long
standardQuantity
;
...
...
quality-review/src/main/java/com/ruoyi/mapper/StatisticsHomeMapper.java
View file @
d9a4e3ba
package
com
.
ruoyi
.
mapper
;
package
com
.
ruoyi
.
mapper
;
import
com.ruoyi.domain.Book
;
import
com.ruoyi.domain.Sample
;
import
com.ruoyi.domain.Task
;
import
com.ruoyi.domain.vo.*
;
import
com.ruoyi.domain.vo.*
;
import
org.springframework.stereotype.Repository
;
import
org.springframework.stereotype.Repository
;
...
@@ -11,15 +14,15 @@ public interface StatisticsHomeMapper {
...
@@ -11,15 +14,15 @@ public interface StatisticsHomeMapper {
public
QuantityStatisticsVO
selectQuantityStatistics
(
QuantityStatisticsVO
quantityStatisticsHome
);
public
QuantityStatisticsVO
selectQuantityStatistics
(
QuantityStatisticsVO
quantityStatisticsHome
);
// 标准类别统计
// 标准类别统计
public
List
<
StandardCategoryStatisticsVO
>
selectStandardCategoryStatistics
();
public
List
<
StandardCategoryStatisticsVO
>
selectStandardCategoryStatistics
(
Sample
t1
);
// 任务保密等级统计
// 任务保密等级统计
public
List
<
ConfidentialityLevelProportionVO
>
selectConfidentialityLevelStatistics
();
public
List
<
ConfidentialityLevelProportionVO
>
selectConfidentialityLevelStatistics
();
// 体系审查任务通过数量
// 体系审查任务通过数量
public
InspectionItemPassedNumVO
selectInspectionItemPassedNum
();
public
InspectionItemPassedNumVO
selectInspectionItemPassedNum
(
Sample
s
);
// 参与任务情况统计
// 参与任务情况统计
public
List
<
TaskParticipationStatisticsVO
>
selectTaskParticipationStatistics
();
public
List
<
TaskParticipationStatisticsVO
>
selectTaskParticipationStatistics
(
Sample
s
);
}
}
quality-review/src/main/java/com/ruoyi/service/StatisticsHomeService.java
View file @
d9a4e3ba
package
com
.
ruoyi
.
service
;
package
com
.
ruoyi
.
service
;
import
com.ruoyi.domain.Sample
;
import
com.ruoyi.domain.vo.*
;
import
com.ruoyi.domain.vo.*
;
import
java.util.List
;
import
java.util.List
;
...
@@ -9,14 +10,14 @@ public interface StatisticsHomeService {
...
@@ -9,14 +10,14 @@ public interface StatisticsHomeService {
public
QuantityStatisticsVO
selectQuantityStatistics
(
QuantityStatisticsVO
quantityStatisticsHome
);
public
QuantityStatisticsVO
selectQuantityStatistics
(
QuantityStatisticsVO
quantityStatisticsHome
);
// 标准类别统计
// 标准类别统计
public
List
<
StandardCategoryStatisticsVO
>
selectStandardCategoryStatistics
();
public
List
<
StandardCategoryStatisticsVO
>
selectStandardCategoryStatistics
(
Sample
s
);
// 任务保密等级统计
// 任务保密等级统计
public
List
<
ConfidentialityLevelProportionVO
>
selectConfidentialityLevelStatistics
();
public
List
<
ConfidentialityLevelProportionVO
>
selectConfidentialityLevelStatistics
();
//平均检验通过率
//平均检验通过率
public
List
<
AverageInspectionRateVO
>
selectAverageInspectionRate
();
public
List
<
AverageInspectionRateVO
>
selectAverageInspectionRate
(
Sample
s
);
// 参与任务情况统计
// 参与任务情况统计
public
List
<
TaskParticipationStatisticsVO
>
selectTaskParticipationStatistics
();
public
List
<
TaskParticipationStatisticsVO
>
selectTaskParticipationStatistics
(
Sample
s
);
}
}
quality-review/src/main/java/com/ruoyi/service/impl/AutomobileEnterpriseServiceImpl.java
View file @
d9a4e3ba
...
@@ -4,6 +4,8 @@ import java.util.List;
...
@@ -4,6 +4,8 @@ import java.util.List;
import
cn.hutool.core.util.ObjUtil
;
import
cn.hutool.core.util.ObjUtil
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.ruoyi.common.annotation.DataScope
;
import
com.ruoyi.common.core.domain.model.LoginUser
;
import
com.ruoyi.common.exception.ServiceException
;
import
com.ruoyi.common.exception.ServiceException
;
import
com.ruoyi.common.utils.DateUtils
;
import
com.ruoyi.common.utils.DateUtils
;
import
com.ruoyi.common.utils.SecurityUtils
;
import
com.ruoyi.common.utils.SecurityUtils
;
...
@@ -47,6 +49,7 @@ public class AutomobileEnterpriseServiceImpl extends ServiceImpl<AutomobileEnter
...
@@ -47,6 +49,7 @@ public class AutomobileEnterpriseServiceImpl extends ServiceImpl<AutomobileEnter
* @return 车企信息
* @return 车企信息
*/
*/
@Override
@Override
@DataScope
(
deptAlias
=
"d"
)
public
List
<
AutomobileEnterprise
>
selectAutomobileEnterpriseList
(
AutomobileEnterpriseListRequest
request
)
public
List
<
AutomobileEnterprise
>
selectAutomobileEnterpriseList
(
AutomobileEnterpriseListRequest
request
)
{
{
return
automobileEnterpriseMapper
.
selectAutomobileEnterpriseList
(
request
);
return
automobileEnterpriseMapper
.
selectAutomobileEnterpriseList
(
request
);
...
@@ -61,6 +64,10 @@ public class AutomobileEnterpriseServiceImpl extends ServiceImpl<AutomobileEnter
...
@@ -61,6 +64,10 @@ public class AutomobileEnterpriseServiceImpl extends ServiceImpl<AutomobileEnter
@Override
@Override
public
int
insertAutomobileEnterprise
(
AutomobileEnterprise
automobileEnterprise
)
public
int
insertAutomobileEnterprise
(
AutomobileEnterprise
automobileEnterprise
)
{
{
//获取当前用户的部门id 部门id用来实现不同部门间的数据隔离
LoginUser
user
=
SecurityUtils
.
getLoginUser
();
Long
deptId
=
user
.
getDeptId
();
// 判断企业名称是否重复
// 判断企业名称是否重复
if
(
lambdaQuery
()
if
(
lambdaQuery
()
.
eq
(
AutomobileEnterprise:
:
getEnterpriseName
,
automobileEnterprise
.
getEnterpriseName
())
.
eq
(
AutomobileEnterprise:
:
getEnterpriseName
,
automobileEnterprise
.
getEnterpriseName
())
...
@@ -69,6 +76,7 @@ public class AutomobileEnterpriseServiceImpl extends ServiceImpl<AutomobileEnter
...
@@ -69,6 +76,7 @@ public class AutomobileEnterpriseServiceImpl extends ServiceImpl<AutomobileEnter
)
{
)
{
throw
new
ServiceException
(
"企业名称已存在"
);
throw
new
ServiceException
(
"企业名称已存在"
);
}
}
automobileEnterprise
.
setDeptId
(
deptId
);
automobileEnterprise
.
setCreateTime
(
DateUtils
.
getNowDate
());
automobileEnterprise
.
setCreateTime
(
DateUtils
.
getNowDate
());
automobileEnterprise
.
setCreateBy
(
String
.
valueOf
(
SecurityUtils
.
getUserId
()));
automobileEnterprise
.
setCreateBy
(
String
.
valueOf
(
SecurityUtils
.
getUserId
()));
return
automobileEnterpriseMapper
.
insert
(
automobileEnterprise
);
return
automobileEnterpriseMapper
.
insert
(
automobileEnterprise
);
...
@@ -83,6 +91,9 @@ public class AutomobileEnterpriseServiceImpl extends ServiceImpl<AutomobileEnter
...
@@ -83,6 +91,9 @@ public class AutomobileEnterpriseServiceImpl extends ServiceImpl<AutomobileEnter
@Override
@Override
public
int
updateAutomobileEnterprise
(
AutomobileEnterprise
automobileEnterprise
)
public
int
updateAutomobileEnterprise
(
AutomobileEnterprise
automobileEnterprise
)
{
{
//获取当前用户的部门id 部门id用来实现不同部门间的数据隔离
LoginUser
user
=
SecurityUtils
.
getLoginUser
();
Long
deptId
=
user
.
getDeptId
();
// 判断企业名称是否重复
// 判断企业名称是否重复
if
(
lambdaQuery
()
if
(
lambdaQuery
()
.
eq
(
AutomobileEnterprise:
:
getEnterpriseName
,
automobileEnterprise
.
getEnterpriseName
())
.
eq
(
AutomobileEnterprise:
:
getEnterpriseName
,
automobileEnterprise
.
getEnterpriseName
())
...
@@ -91,6 +102,7 @@ public class AutomobileEnterpriseServiceImpl extends ServiceImpl<AutomobileEnter
...
@@ -91,6 +102,7 @@ public class AutomobileEnterpriseServiceImpl extends ServiceImpl<AutomobileEnter
)
{
)
{
throw
new
ServiceException
(
"企业名称已存在"
);
throw
new
ServiceException
(
"企业名称已存在"
);
}
}
automobileEnterprise
.
setDeptId
(
deptId
);
automobileEnterprise
.
setUpdateTime
(
DateUtils
.
getNowDate
());
automobileEnterprise
.
setUpdateTime
(
DateUtils
.
getNowDate
());
automobileEnterprise
.
setUpdateBy
(
String
.
valueOf
(
SecurityUtils
.
getUserId
()));
automobileEnterprise
.
setUpdateBy
(
String
.
valueOf
(
SecurityUtils
.
getUserId
()));
return
automobileEnterpriseMapper
.
updateAutomobileEnterprise
(
automobileEnterprise
);
return
automobileEnterpriseMapper
.
updateAutomobileEnterprise
(
automobileEnterprise
);
...
...
quality-review/src/main/java/com/ruoyi/service/impl/SampleManagementServiceImpl.java
View file @
d9a4e3ba
...
@@ -4,6 +4,8 @@ import java.util.ArrayList;
...
@@ -4,6 +4,8 @@ import java.util.ArrayList;
import
java.util.List
;
import
java.util.List
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.ruoyi.common.annotation.DataScope
;
import
com.ruoyi.common.core.domain.model.LoginUser
;
import
com.ruoyi.common.exception.ServiceException
;
import
com.ruoyi.common.exception.ServiceException
;
import
com.ruoyi.common.utils.DateUtils
;
import
com.ruoyi.common.utils.DateUtils
;
import
com.ruoyi.common.utils.SecurityUtils
;
import
com.ruoyi.common.utils.SecurityUtils
;
...
@@ -19,7 +21,7 @@ import org.springframework.transaction.annotation.Transactional;
...
@@ -19,7 +21,7 @@ import org.springframework.transaction.annotation.Transactional;
/**
/**
* 样品管理Service业务层处理
* 样品管理Service业务层处理
*
*
* @author ruoyi
* @author ruoyi
* @date 2024-01-29
* @date 2024-01-29
*/
*/
...
@@ -35,7 +37,7 @@ public class SampleManagementServiceImpl extends ServiceImpl<SampleManagementMap
...
@@ -35,7 +37,7 @@ public class SampleManagementServiceImpl extends ServiceImpl<SampleManagementMap
/**
/**
* 查询样品管理
* 查询样品管理
*
*
* @param id 样品管理主键
* @param id 样品管理主键
* @return 样品管理
* @return 样品管理
*/
*/
...
@@ -47,11 +49,12 @@ public class SampleManagementServiceImpl extends ServiceImpl<SampleManagementMap
...
@@ -47,11 +49,12 @@ public class SampleManagementServiceImpl extends ServiceImpl<SampleManagementMap
/**
/**
* 查询样品管理列表
* 查询样品管理列表
*
*
* @param sampleManagementRequest 样品管理
* @param sampleManagementRequest 样品管理
* @return 样品管理
* @return 样品管理
*/
*/
@Override
@Override
@DataScope
(
deptAlias
=
"d"
)
public
List
<
Sample
>
selectSampleManagementList
(
SampleManagementRequest
sampleManagementRequest
)
public
List
<
Sample
>
selectSampleManagementList
(
SampleManagementRequest
sampleManagementRequest
)
{
{
List
<
Sample
>
list
=
sampleManagementMapper
.
selectSampleManagementList
(
sampleManagementRequest
);
List
<
Sample
>
list
=
sampleManagementMapper
.
selectSampleManagementList
(
sampleManagementRequest
);
...
@@ -63,13 +66,17 @@ public class SampleManagementServiceImpl extends ServiceImpl<SampleManagementMap
...
@@ -63,13 +66,17 @@ public class SampleManagementServiceImpl extends ServiceImpl<SampleManagementMap
/**
/**
* 新增样品管理
* 新增样品管理
*
*
* @param sampleManagement 样品管理
* @param sampleManagement 样品管理
* @return 结果
* @return 结果
*/
*/
@Override
@Override
public
int
insertSampleManagement
(
Sample
sampleManagement
)
public
int
insertSampleManagement
(
Sample
sampleManagement
)
{
{
//添加了deptId字段用于实现部门数据隔离功能
LoginUser
user
=
SecurityUtils
.
getLoginUser
();
Long
deptId
=
user
.
getDeptId
();
sampleManagement
.
setDeptId
(
deptId
);
// 判断车辆识别码是否重复
// 判断车辆识别码是否重复
if
(
Sample
.
SAMPLE_FLAG_CAR
.
equals
(
sampleManagement
.
getFlag
())){
if
(
Sample
.
SAMPLE_FLAG_CAR
.
equals
(
sampleManagement
.
getFlag
())){
int
dentificationCode
=
sampleManagementMapper
.
selectIdentificationCodeCount
(
sampleManagement
);
int
dentificationCode
=
sampleManagementMapper
.
selectIdentificationCodeCount
(
sampleManagement
);
...
@@ -89,13 +96,17 @@ public class SampleManagementServiceImpl extends ServiceImpl<SampleManagementMap
...
@@ -89,13 +96,17 @@ public class SampleManagementServiceImpl extends ServiceImpl<SampleManagementMap
/**
/**
* 修改样品管理
* 修改样品管理
*
*
* @param sampleManagement 样品管理
* @param sampleManagement 样品管理
* @return 结果
* @return 结果
*/
*/
@Override
@Override
public
int
updateSampleManagement
(
Sample
sampleManagement
)
public
int
updateSampleManagement
(
Sample
sampleManagement
)
{
{
//添加了deptId字段用于实现部门数据隔离功能
LoginUser
user
=
SecurityUtils
.
getLoginUser
();
Long
deptId
=
user
.
getDeptId
();
sampleManagement
.
setDeptId
(
deptId
);
// 判断车辆识别码是否重复
// 判断车辆识别码是否重复
if
(
Sample
.
SAMPLE_FLAG_CAR
.
equals
(
sampleManagement
.
getFlag
())){
if
(
Sample
.
SAMPLE_FLAG_CAR
.
equals
(
sampleManagement
.
getFlag
())){
int
dentificationCode
=
sampleManagementMapper
.
selectIdentificationCodeCount
(
sampleManagement
);
int
dentificationCode
=
sampleManagementMapper
.
selectIdentificationCodeCount
(
sampleManagement
);
...
@@ -117,6 +128,7 @@ public class SampleManagementServiceImpl extends ServiceImpl<SampleManagementMap
...
@@ -117,6 +128,7 @@ public class SampleManagementServiceImpl extends ServiceImpl<SampleManagementMap
* 根据车辆识别码和样品编号查询样品信息
* 根据车辆识别码和样品编号查询样品信息
* */
* */
@Override
@Override
@DataScope
(
deptAlias
=
"d"
)
public
List
<
Sample
>
selectSampleList
(
SampleManagementRequest
sampleManagementRequest
){
public
List
<
Sample
>
selectSampleList
(
SampleManagementRequest
sampleManagementRequest
){
return
sampleManagementMapper
.
selectSampleList
(
sampleManagementRequest
);
return
sampleManagementMapper
.
selectSampleList
(
sampleManagementRequest
);
}
}
...
...
quality-review/src/main/java/com/ruoyi/service/impl/StatisticsHomeServiceImpl.java
View file @
d9a4e3ba
package
com
.
ruoyi
.
service
.
impl
;
package
com
.
ruoyi
.
service
.
impl
;
import
com.ruoyi.common.annotation.DataScope
;
import
com.ruoyi.common.core.domain.model.LoginUser
;
import
com.ruoyi.common.utils.SecurityUtils
;
import
com.ruoyi.domain.Book
;
import
com.ruoyi.domain.Sample
;
import
com.ruoyi.domain.Standard
;
import
com.ruoyi.domain.Standard
;
import
com.ruoyi.domain.Task
;
import
com.ruoyi.domain.vo.*
;
import
com.ruoyi.domain.vo.*
;
import
com.ruoyi.mapper.StandardMapper
;
import
com.ruoyi.mapper.StandardMapper
;
import
com.ruoyi.mapper.StatisticsHomeMapper
;
import
com.ruoyi.mapper.StatisticsHomeMapper
;
...
@@ -22,6 +28,7 @@ public class StatisticsHomeServiceImpl implements StatisticsHomeService {
...
@@ -22,6 +28,7 @@ public class StatisticsHomeServiceImpl implements StatisticsHomeService {
private
StandardMapper
standardMapper
;
private
StandardMapper
standardMapper
;
@Override
@Override
@DataScope
(
deptAlias
=
"d"
)
public
QuantityStatisticsVO
selectQuantityStatistics
(
QuantityStatisticsVO
quantityStatisticsHome
){
public
QuantityStatisticsVO
selectQuantityStatistics
(
QuantityStatisticsVO
quantityStatisticsHome
){
QuantityStatisticsVO
quantityStatisticsVO
=
statisticsHomeMapper
.
selectQuantityStatistics
(
quantityStatisticsHome
);
QuantityStatisticsVO
quantityStatisticsVO
=
statisticsHomeMapper
.
selectQuantityStatistics
(
quantityStatisticsHome
);
...
@@ -31,8 +38,9 @@ public class StatisticsHomeServiceImpl implements StatisticsHomeService {
...
@@ -31,8 +38,9 @@ public class StatisticsHomeServiceImpl implements StatisticsHomeService {
}
}
@Override
@Override
public
List
<
StandardCategoryStatisticsVO
>
selectStandardCategoryStatistics
(){
@DataScope
(
deptAlias
=
"d"
)
return
statisticsHomeMapper
.
selectStandardCategoryStatistics
();
public
List
<
StandardCategoryStatisticsVO
>
selectStandardCategoryStatistics
(
Sample
s
){
return
statisticsHomeMapper
.
selectStandardCategoryStatistics
(
s
);
}
}
@Override
@Override
...
@@ -41,13 +49,14 @@ public class StatisticsHomeServiceImpl implements StatisticsHomeService {
...
@@ -41,13 +49,14 @@ public class StatisticsHomeServiceImpl implements StatisticsHomeService {
}
}
@Override
@Override
public
List
<
AverageInspectionRateVO
>
selectAverageInspectionRate
(){
@DataScope
(
deptAlias
=
"d"
)
public
List
<
AverageInspectionRateVO
>
selectAverageInspectionRate
(
Sample
s
){
List
<
Standard
>
standards
=
standardMapper
.
selectListAll
();
List
<
Standard
>
standards
=
standardMapper
.
selectListAll
();
String
standardNo
=
null
;
String
standardNo
=
null
;
if
(!
standards
.
isEmpty
()){
if
(!
standards
.
isEmpty
()){
standardNo
=
standards
.
get
(
0
).
getStandardNo
();
standardNo
=
standards
.
get
(
0
).
getStandardNo
();
}
}
InspectionItemPassedNumVO
inspectionItemPassedNumVO
=
statisticsHomeMapper
.
selectInspectionItemPassedNum
();
InspectionItemPassedNumVO
inspectionItemPassedNumVO
=
statisticsHomeMapper
.
selectInspectionItemPassedNum
(
s
);
List
<
AverageInspectionRateVO
>
list
=
new
ArrayList
<>();
List
<
AverageInspectionRateVO
>
list
=
new
ArrayList
<>();
AverageInspectionRateVO
averageInspectionRateOne
=
new
AverageInspectionRateVO
();
AverageInspectionRateVO
averageInspectionRateOne
=
new
AverageInspectionRateVO
();
averageInspectionRateOne
.
setInspectionItems
(
"汽车信息安全管理体系要求"
);
averageInspectionRateOne
.
setInspectionItems
(
"汽车信息安全管理体系要求"
);
...
@@ -68,8 +77,9 @@ public class StatisticsHomeServiceImpl implements StatisticsHomeService {
...
@@ -68,8 +77,9 @@ public class StatisticsHomeServiceImpl implements StatisticsHomeService {
}
}
@Override
@Override
public
List
<
TaskParticipationStatisticsVO
>
selectTaskParticipationStatistics
(){
@DataScope
(
deptAlias
=
"d"
)
return
statisticsHomeMapper
.
selectTaskParticipationStatistics
();
public
List
<
TaskParticipationStatisticsVO
>
selectTaskParticipationStatistics
(
Sample
s
){
return
statisticsHomeMapper
.
selectTaskParticipationStatistics
(
s
);
}
}
// 计算两个数各占比
// 计算两个数各占比
...
...
quality-review/src/main/java/com/ruoyi/service/impl/TaskServiceImpl.java
View file @
d9a4e3ba
...
@@ -8,6 +8,7 @@ import com.alibaba.fastjson2.JSONObject;
...
@@ -8,6 +8,7 @@ import com.alibaba.fastjson2.JSONObject;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.core.conditions.query.QueryWrapper
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.baomidou.mybatisplus.extension.service.impl.ServiceImpl
;
import
com.ruoyi.common.DataStatisticsUtils
;
import
com.ruoyi.common.DataStatisticsUtils
;
import
com.ruoyi.common.annotation.DataScope
;
import
com.ruoyi.common.constant.HttpStatus
;
import
com.ruoyi.common.constant.HttpStatus
;
import
com.ruoyi.common.core.domain.entity.SysUser
;
import
com.ruoyi.common.core.domain.entity.SysUser
;
import
com.ruoyi.common.core.domain.model.LoginUser
;
import
com.ruoyi.common.core.domain.model.LoginUser
;
...
@@ -156,7 +157,8 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
...
@@ -156,7 +157,8 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
// 构建任务创建者
// 构建任务创建者
LoginUser
loginUser
=
SecurityUtils
.
getLoginUser
();
LoginUser
loginUser
=
SecurityUtils
.
getLoginUser
();
//获取任务创建这的deptId用来实现部门数据隔离
Long
deptId
=
loginUser
.
getDeptId
();
//根据Id查询当前用户是否拥有暂存任务
//根据Id查询当前用户是否拥有暂存任务
TaskGetInfoResponse
temporaryStorageTask
=
taskService
.
getByUserId
(
loginUser
.
getUserId
());
TaskGetInfoResponse
temporaryStorageTask
=
taskService
.
getByUserId
(
loginUser
.
getUserId
());
if
(
temporaryStorageTask
!=
null
)
{
if
(
temporaryStorageTask
!=
null
)
{
...
@@ -211,6 +213,9 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
...
@@ -211,6 +213,9 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
// 构建并保存任务信息
// 构建并保存任务信息
// 总任务
// 总任务
Task
task
=
new
Task
();
Task
task
=
new
Task
();
//添加deptId字段用来实现部门数据隔离
task
.
setDeptId
(
deptId
);
task
.
setTaskInitiatorId
(
loginUser
.
getUserId
());
task
.
setTaskInitiatorId
(
loginUser
.
getUserId
());
task
.
setTaskInitiator
(
initiator
.
getNickName
());
task
.
setTaskInitiator
(
initiator
.
getNickName
());
if
(
initiator
.
getDept
()
!=
null
)
{
if
(
initiator
.
getDept
()
!=
null
)
{
...
@@ -307,6 +312,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
...
@@ -307,6 +312,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
* @return
* @return
*/
*/
@Override
@Override
@DataScope
(
deptAlias
=
"d"
)
public
List
<
Task
>
findFinish
(
TaskFindFinishRequest
request
)
{
public
List
<
Task
>
findFinish
(
TaskFindFinishRequest
request
)
{
List
<
Task
>
taskList
=
taskMapper
.
findFinish
(
request
);
List
<
Task
>
taskList
=
taskMapper
.
findFinish
(
request
);
...
@@ -1649,6 +1655,10 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
...
@@ -1649,6 +1655,10 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
public
Long
saveSystemReview
(
TaskCreateRequest
request
,
SysUser
initiator
,
Standard
standard
,
TaskUserRelation
leader
)
{
public
Long
saveSystemReview
(
TaskCreateRequest
request
,
SysUser
initiator
,
Standard
standard
,
TaskUserRelation
leader
)
{
//添加了dept_id字段用于进行部门数据过滤
LoginUser
user
=
SecurityUtils
.
getLoginUser
();
Long
deptId
=
user
.
getDeptId
();
// 构建并保存任务信息
// 构建并保存任务信息
SystemReviewTask
task
=
new
SystemReviewTask
()
SystemReviewTask
task
=
new
SystemReviewTask
()
.
setTaskNo
(
request
.
getTaskNo
())
.
setTaskNo
(
request
.
getTaskNo
())
...
@@ -1660,7 +1670,8 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
...
@@ -1660,7 +1670,8 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
.
setStandardId
(
standard
.
getId
())
.
setStandardId
(
standard
.
getId
())
.
setName
(
standard
.
getName
())
.
setName
(
standard
.
getName
())
.
setStandardNo
(
standard
.
getStandardNo
())
.
setStandardNo
(
standard
.
getStandardNo
())
.
setFile
(
standard
.
getFile
());
.
setFile
(
standard
.
getFile
())
.
setDeptId
(
deptId
);
if
(
initiator
.
getDept
()
!=
null
)
{
if
(
initiator
.
getDept
()
!=
null
)
{
task
.
setTaskInitiatorDept
(
initiator
.
getDept
().
getDeptName
());
task
.
setTaskInitiatorDept
(
initiator
.
getDept
().
getDeptName
());
...
@@ -1673,6 +1684,9 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
...
@@ -1673,6 +1684,9 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
public
Long
saveCarReview
(
TaskCreateRequest
request
,
SysUser
initiator
,
Standard
standard
,
TaskUserRelation
leader
)
{
public
Long
saveCarReview
(
TaskCreateRequest
request
,
SysUser
initiator
,
Standard
standard
,
TaskUserRelation
leader
)
{
List
<
String
>
taskList
=
request
.
getTaskList
();
List
<
String
>
taskList
=
request
.
getTaskList
();
//添加了dept_id字段用于进行部门数据过滤
LoginUser
user
=
SecurityUtils
.
getLoginUser
();
Long
deptId
=
user
.
getDeptId
();
// 构建并保存任务信息
// 构建并保存任务信息
CarReviewTask
task
=
new
CarReviewTask
()
CarReviewTask
task
=
new
CarReviewTask
()
...
@@ -1685,7 +1699,8 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
...
@@ -1685,7 +1699,8 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
.
setStandardId
(
standard
.
getId
())
.
setStandardId
(
standard
.
getId
())
.
setName
(
standard
.
getName
())
.
setName
(
standard
.
getName
())
.
setStandardNo
(
standard
.
getStandardNo
())
.
setStandardNo
(
standard
.
getStandardNo
())
.
setFile
(
standard
.
getFile
());
.
setFile
(
standard
.
getFile
())
.
setDeptId
(
deptId
);
if
(
initiator
.
getDept
()
!=
null
)
{
if
(
initiator
.
getDept
()
!=
null
)
{
task
.
setTaskInitiatorDept
(
initiator
.
getDept
().
getDeptName
());
task
.
setTaskInitiatorDept
(
initiator
.
getDept
().
getDeptName
());
...
@@ -1705,6 +1720,10 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
...
@@ -1705,6 +1720,10 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
*/
*/
public
Long
saveModelTest
(
TaskCreateRequest
request
,
SysUser
initiator
,
Standard
standard
,
TaskUserRelation
leader
)
{
public
Long
saveModelTest
(
TaskCreateRequest
request
,
SysUser
initiator
,
Standard
standard
,
TaskUserRelation
leader
)
{
//添加了dept_id字段用于进行部门数据过滤
LoginUser
user
=
SecurityUtils
.
getLoginUser
();
Long
deptId
=
user
.
getDeptId
();
// 构建并保存任务信息
// 构建并保存任务信息
ModelTestTask
modelTestTask
=
ModelTestTask
.
builder
()
ModelTestTask
modelTestTask
=
ModelTestTask
.
builder
()
.
taskNo
(
request
.
getTaskNo
())
.
taskNo
(
request
.
getTaskNo
())
...
@@ -1716,6 +1735,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
...
@@ -1716,6 +1735,7 @@ public class TaskServiceImpl extends ServiceImpl<TaskMapper, Task>implements Tas
.
standardId
(
standard
.
getId
())
.
standardId
(
standard
.
getId
())
.
name
(
standard
.
getName
())
.
name
(
standard
.
getName
())
.
standardNo
(
standard
.
getStandardNo
())
.
standardNo
(
standard
.
getStandardNo
())
.
deptId
(
deptId
)
.
build
();
.
build
();
if
(
initiator
.
getDept
()
!=
null
)
{
if
(
initiator
.
getDept
()
!=
null
)
{
...
...
quality-review/src/main/java/com/ruoyi/web/SampleManagementController.java
View file @
d9a4e3ba
...
@@ -25,7 +25,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
...
@@ -25,7 +25,7 @@ import com.ruoyi.common.core.page.TableDataInfo;
/**
/**
* 样品管理Controller
* 样品管理Controller
*
*
* @author ruoyi
* @author ruoyi
* @date 2024-01-29
* @date 2024-01-29
*/
*/
...
...
quality-review/src/main/java/com/ruoyi/web/StatisticsHomeController.java
View file @
d9a4e3ba
package
com
.
ruoyi
.
web
;
package
com
.
ruoyi
.
web
;
import
com.ruoyi.common.core.domain.R
;
import
com.ruoyi.common.core.domain.R
;
import
com.ruoyi.domain.Sample
;
import
com.ruoyi.domain.vo.*
;
import
com.ruoyi.domain.vo.*
;
import
com.ruoyi.service.StatisticsHomeService
;
import
com.ruoyi.service.StatisticsHomeService
;
import
io.swagger.annotations.Api
;
import
io.swagger.annotations.Api
;
...
@@ -29,7 +30,8 @@ public class StatisticsHomeController {
...
@@ -29,7 +30,8 @@ public class StatisticsHomeController {
@ApiOperation
(
"首页标准分类占比"
)
@ApiOperation
(
"首页标准分类占比"
)
@PostMapping
(
"/standardCategory"
)
@PostMapping
(
"/standardCategory"
)
public
R
<
List
<
StandardCategoryStatisticsVO
>>
selectStandardCategoryStatistics
(){
public
R
<
List
<
StandardCategoryStatisticsVO
>>
selectStandardCategoryStatistics
(){
return
R
.
ok
(
statisticsHomeService
.
selectStandardCategoryStatistics
());
Sample
s
=
new
Sample
();
return
R
.
ok
(
statisticsHomeService
.
selectStandardCategoryStatistics
(
s
));
}
}
@ApiOperation
(
"首页任务保密等级占比"
)
@ApiOperation
(
"首页任务保密等级占比"
)
@PostMapping
(
"/confidentialityLevel"
)
@PostMapping
(
"/confidentialityLevel"
)
...
@@ -39,11 +41,13 @@ public class StatisticsHomeController {
...
@@ -39,11 +41,13 @@ public class StatisticsHomeController {
@ApiOperation
(
"首页平均检验通过率"
)
@ApiOperation
(
"首页平均检验通过率"
)
@PostMapping
(
"/averageInspectionRate"
)
@PostMapping
(
"/averageInspectionRate"
)
public
R
<
List
<
AverageInspectionRateVO
>>
selectAverageInspectionRate
(){
public
R
<
List
<
AverageInspectionRateVO
>>
selectAverageInspectionRate
(){
return
R
.
ok
(
statisticsHomeService
.
selectAverageInspectionRate
());
Sample
s
=
new
Sample
();
return
R
.
ok
(
statisticsHomeService
.
selectAverageInspectionRate
(
s
));
}
}
@ApiOperation
(
"首页任务情况安排"
)
@ApiOperation
(
"首页任务情况安排"
)
@PostMapping
(
"/taskParticipation"
)
@PostMapping
(
"/taskParticipation"
)
public
R
<
List
<
TaskParticipationStatisticsVO
>>
selectTaskParticipationStatistics
(){
public
R
<
List
<
TaskParticipationStatisticsVO
>>
selectTaskParticipationStatistics
(){
return
R
.
ok
(
statisticsHomeService
.
selectTaskParticipationStatistics
());
Sample
s
=
new
Sample
();
return
R
.
ok
(
statisticsHomeService
.
selectTaskParticipationStatistics
(
s
));
}
}
}
}
quality-review/src/main/java/com/ruoyi/web/response/TaskFindResponse.java
View file @
d9a4e3ba
...
@@ -129,4 +129,6 @@ public class TaskFindResponse {
...
@@ -129,4 +129,6 @@ public class TaskFindResponse {
@ApiModelProperty
(
"企业id"
)
@ApiModelProperty
(
"企业id"
)
private
Long
enterpriseId
;
private
Long
enterpriseId
;
@ApiModelProperty
(
"部门id"
)
private
Long
deptId
;
}
}
quality-review/src/main/resources/mapper/AutomobileEnterpriseMapper.xml
View file @
d9a4e3ba
...
@@ -49,12 +49,15 @@
...
@@ -49,12 +49,15 @@
ae.enterprise_type
ae.enterprise_type
from t_automobile_enterprise ae
from t_automobile_enterprise ae
left join sys_user su on ae.create_by = su.user_id
left join sys_user su on ae.create_by = su.user_id
left join sys_dept d on ae.dept_id = d.dept_id
</sql>
</sql>
<select
id=
"selectAutomobileEnterpriseList"
parameterType=
"com.ruoyi.domain.AutomobileEnterprise"
<select
id=
"selectAutomobileEnterpriseList"
parameterType=
"com.ruoyi.domain.AutomobileEnterprise"
resultMap=
"AutomobileEnterpriseResult"
>
resultMap=
"AutomobileEnterpriseResult"
>
<include
refid=
"selectAutomobileEnterpriseListSQL"
/>
<include
refid=
"selectAutomobileEnterpriseListSQL"
/>
<where>
<where>
${params.dataScope}
AND
ae.deleted = 0
ae.deleted = 0
<if
test=
"enterpriseName != null and enterpriseName != ''"
>
and ae.enterprise_name like concat('%',
<if
test=
"enterpriseName != null and enterpriseName != ''"
>
and ae.enterprise_name like concat('%',
#{enterpriseName}, '%')
#{enterpriseName}, '%')
...
@@ -117,6 +120,7 @@
...
@@ -117,6 +120,7 @@
<if
test=
"updateBy != null"
>
update_by = #{updateBy},
</if>
<if
test=
"updateBy != null"
>
update_by = #{updateBy},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime},
</if>
<if
test=
"updateTime != null"
>
update_time = #{updateTime},
</if>
<if
test=
"enterpriseType != null"
>
enterprise_Type = #{enterpriseType}
</if>
<if
test=
"enterpriseType != null"
>
enterprise_Type = #{enterpriseType}
</if>
<if
test=
"deptId != null"
>
dept_id = #{deptId}
</if>
</trim>
</trim>
where id = #{id}
where id = #{id}
</update>
</update>
...
...
quality-review/src/main/resources/mapper/SampleManagementMapper.xml
View file @
d9a4e3ba
...
@@ -49,11 +49,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -49,11 +49,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
tae.enterprise_name as enterpriseName
tae.enterprise_name as enterpriseName
from t_sample sm
from t_sample sm
left join t_automobile_enterprise tae on tae.id = sm.manufacturing_enterprise_id and tae.deleted = 0
left join t_automobile_enterprise tae on tae.id = sm.manufacturing_enterprise_id and tae.deleted = 0
left join sys_dept d on d.dept_id = sm.dept_id
</sql>
</sql>
<select
id=
"selectSampleManagementList"
parameterType=
"com.ruoyi.domain.Sample"
resultMap=
"SampleManagementResult"
>
<select
id=
"selectSampleManagementList"
parameterType=
"com.ruoyi.domain.Sample"
resultMap=
"SampleManagementResult"
>
<include
refid=
"selectTSampleManagementVo"
/>
<include
refid=
"selectTSampleManagementVo"
/>
<where>
<where>
${params.dataScope}
AND
sm.deleted = 0
sm.deleted = 0
<if
test=
"identificationCode != null and identificationCode != ''"
>
and sm.identification_code like concat('%', #{identificationCode}, '%')
</if>
<if
test=
"identificationCode != null and identificationCode != ''"
>
and sm.identification_code like concat('%', #{identificationCode}, '%')
</if>
<if
test=
"sampleNumber != null and sampleNumber != ''"
>
and sm.sample_number like concat('%', #{sampleNumber}, '%')
</if>
<if
test=
"sampleNumber != null and sampleNumber != ''"
>
and sm.sample_number like concat('%', #{sampleNumber}, '%')
</if>
...
@@ -89,6 +92,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -89,6 +92,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"trademark != null"
>
trademark,
</if>
<if
test=
"trademark != null"
>
trademark,
</if>
<if
test=
"samplePhotos != null"
>
sample_photos,
</if>
<if
test=
"samplePhotos != null"
>
sample_photos,
</if>
<if
test=
"deleted != null"
>
deleted,
</if>
<if
test=
"deleted != null"
>
deleted,
</if>
<if
test=
"deptId != null"
>
dept_id,
</if>
</trim>
</trim>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<trim
prefix=
"values ("
suffix=
")"
suffixOverrides=
","
>
<if
test=
"identificationCode != null"
>
#{identificationCode},
</if>
<if
test=
"identificationCode != null"
>
#{identificationCode},
</if>
...
@@ -109,6 +113,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -109,6 +113,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"trademark != null"
>
#{trademark},
</if>
<if
test=
"trademark != null"
>
#{trademark},
</if>
<if
test=
"samplePhotos != null"
>
#{samplePhotos},
</if>
<if
test=
"samplePhotos != null"
>
#{samplePhotos},
</if>
<if
test=
"deleted != null"
>
#{deleted},
</if>
<if
test=
"deleted != null"
>
#{deleted},
</if>
<if
test=
"deptId != null"
>
#{deptId},
</if>
</trim>
</trim>
</insert>
</insert>
...
@@ -132,6 +137,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -132,6 +137,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"remark != null"
>
remark = #{remark},
</if>
<if
test=
"remark != null"
>
remark = #{remark},
</if>
<if
test=
"trademark != null"
>
trademark = #{trademark},
</if>
<if
test=
"trademark != null"
>
trademark = #{trademark},
</if>
<if
test=
"samplePhotos != null"
>
sample_photos = #{samplePhotos},
</if>
<if
test=
"samplePhotos != null"
>
sample_photos = #{samplePhotos},
</if>
<if
test=
"deptId != null"
>
dept_id = #{deptId}
</if>
</trim>
</trim>
where id = #{id}
where id = #{id}
</update>
</update>
...
@@ -164,6 +170,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
...
@@ -164,6 +170,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
<if
test=
"sampleNumber != null and sampleNumber != ''"
>
and sm.sample_number = #{sampleNumber}
</if>
<if
test=
"sampleNumber != null and sampleNumber != ''"
>
and sm.sample_number = #{sampleNumber}
</if>
<if
test=
"flag != null and flag != ''"
>
and sm.flag = #{flag}
</if>
<if
test=
"flag != null and flag != ''"
>
and sm.flag = #{flag}
</if>
<if
test=
"manufacturingEnterpriseId != null"
>
and sm.manufacturing_enterprise_id = #{manufacturingEnterpriseId}
</if>
<if
test=
"manufacturingEnterpriseId != null"
>
and sm.manufacturing_enterprise_id = #{manufacturingEnterpriseId}
</if>
${params.dataScope}
</where>
</where>
</select>
</select>
...
...
quality-review/src/main/resources/mapper/StatisticsHomeMapper.xml
View file @
d9a4e3ba
...
@@ -8,22 +8,62 @@
...
@@ -8,22 +8,62 @@
<select
id=
"selectQuantityStatistics"
resultType=
"com.ruoyi.domain.vo.QuantityStatisticsVO"
parameterType=
"com.ruoyi.domain.vo.QuantityStatisticsVO"
>
<select
id=
"selectQuantityStatistics"
resultType=
"com.ruoyi.domain.vo.QuantityStatisticsVO"
parameterType=
"com.ruoyi.domain.vo.QuantityStatisticsVO"
>
SELECT
SELECT
( SELECT count( id ) FROM t_standard ) AS standardQuantity,
( SELECT count( id ) FROM t_standard ) AS standardQuantity,
( SELECT count( id ) FROM t_task WHERE task_status != 'TEMPORARILY' ) AS numberTasks,
( SELECT count( id ) FROM t_task t
( SELECT count( id ) FROM t_automobile_enterprise WHERE deleted = 0 ) AS numberCompanies,
LEFT JOIN sys_dept d ON d.dept_id = t.dept_id
WHERE
task_status != 'TEMPORARILY'
${params.dataScope}
) AS numberTasks,
( SELECT count( id ) FROM t_automobile_enterprise ae
LEFT JOIN sys_dept d ON d.dept_id = ae.dept_id
WHERE
deleted = 0
AND 'A'='A'
${params.dataScope}
) AS numberCompanies,
(
(
SELECT
SELECT
count( su.user_id )
count( su.user_id )
FROM
FROM
sys_user su
sys_user su
LEFT JOIN sys_user_role sur ON sur.user_id = su.user_id
LEFT JOIN sys_user_role sur ON sur.user_id = su.user_id
LEFT JOIN sys_dept d ON d.dept_id = su.dept_id
WHERE
WHERE
sur.role_id = 106
sur.role_id = 106
AND 'A'='A'
${params.dataScope}
) AS numberInspectors,
) AS numberInspectors,
( SELECT count( id ) FROM t_sample WHERE flag = '0' AND deleted = 0 ) AS numberVehicleSamples,
( SELECT count( id )
( SELECT count( id ) FROM t_sample WHERE flag = '1' AND deleted = 0 ) AS numberComponentSamples,
FROM t_sample ts
( SELECT count( id ) FROM t_task WHERE vehicle_information_url IS NOT NULL ) AS numberReports,
LEFT JOIN sys_dept d ON d.dept_id = ts.dept_id
( SELECT count( id ) FROM t_task WHERE task_status = 'FINISH' ) AS completedTaskNumber,
WHERE flag = '0' AND deleted = 0
( SELECT count( id ) FROM t_task WHERE task_status = 'NEW' OR task_status = 'PENDING' OR task_status = 'SIGNED') AS executeTasksNumber
AND 'A'='A'
${params.dataScope}
) AS numberVehicleSamples,
( SELECT count( id )
FROM t_sample ts
LEFT JOIN sys_dept d ON d.dept_id = ts.dept_id
WHERE flag = '1' AND deleted = 0
AND 'A'='A'
${params.dataScope} ) AS numberComponentSamples,
( SELECT count( id )
FROM t_task t
LEFT JOIN sys_dept d ON d.dept_id = t.dept_id
WHERE vehicle_information_url IS NOT NULL
AND 'A'='A'
${params.dataScope}) AS numberReports,
( SELECT count( id )
FROM t_task t
LEFT JOIN sys_dept d ON d.dept_id = t.dept_id
WHERE task_status = 'FINISH'
${params.dataScope}) AS completedTaskNumber,
( SELECT count( id )
FROM t_task t
LEFT JOIN sys_dept d ON d.dept_id = t.dept_id
WHERE (task_status = 'PENDING' OR task_status = 'NEW' OR task_status = 'SINGED')
and 'a' = 'a'
${params.dataScope}
) AS executeTasksNumber
</select>
</select>
<select
id=
"selectStandardCategoryStatistics"
resultType=
"com.ruoyi.domain.vo.StandardCategoryStatisticsVO"
>
<select
id=
"selectStandardCategoryStatistics"
resultType=
"com.ruoyi.domain.vo.StandardCategoryStatisticsVO"
>
...
@@ -33,6 +73,8 @@
...
@@ -33,6 +73,8 @@
FROM
FROM
t_task ta
t_task ta
LEFT JOIN t_standard st ON ta.standard_id = st.id
LEFT JOIN t_standard st ON ta.standard_id = st.id
LEFT JOIN sys_dept d ON ta.dept_id = d.dept_id
WHERE 'a' = 'a' ${params.dataScope}
GROUP BY
GROUP BY
st.standard_type
st.standard_type
</select>
</select>
...
@@ -51,12 +93,36 @@
...
@@ -51,12 +93,36 @@
<select
id=
"selectInspectionItemPassedNum"
resultType=
"com.ruoyi.domain.vo.InspectionItemPassedNumVO"
>
<select
id=
"selectInspectionItemPassedNum"
resultType=
"com.ruoyi.domain.vo.InspectionItemPassedNumVO"
>
SELECT
SELECT
( SELECT COUNT( id ) FROM t_system_review_task WHERE task_status = 'FINISH' ) AS sysReviewcompletedNum,
( SELECT COUNT( id )
( SELECT COUNT( id ) FROM t_system_review_task WHERE task_status = 'FINISH' AND task_result = 'PASS' ) AS sysReviewPassedNum,
FROM t_system_review_task tsrt
( SELECT COUNT( id ) FROM t_car_review_task WHERE task_status = 'FINISH' ) AS carReviewcompletedNum,
LEFT JOIN sys_dept d ON d.dept_id = tsrt.dept_id
( SELECT COUNT( id ) FROM t_car_review_task WHERE task_status = 'FINISH' AND task_result = 'PASS' ) AS carReviewPassedNum,
WHERE task_status = 'FINISH'
( SELECT COUNT( id ) FROM t_model_test_task WHERE task_status = 'FINISH' ) AS modelTestCompletedNum,
${params.dataScope}) AS sysReviewcompletedNum,
( SELECT COUNT( id ) FROM t_model_test_task WHERE task_status = 'FINISH' AND task_result = 'PASS' ) AS modelTestPassedNum
( SELECT COUNT( id )
FROM t_system_review_task tsrt
LEFT JOIN sys_dept d ON d.dept_id = tsrt.dept_id
WHERE task_status = 'FINISH' AND task_result = 'PASS'
${params.dataScope}) AS sysReviewPassedNum,
( SELECT COUNT( id )
FROM t_car_review_task tcrt
LEFT JOIN sys_dept d ON d.dept_id = tcrt.dept_id
WHERE task_status = 'FINISH'
${params.dataScope}) AS carReviewcompletedNum,
( SELECT COUNT( id )
FROM t_car_review_task tcrt
LEFT JOIN sys_dept d ON d.dept_id = tcrt.dept_id
WHERE task_status = 'FINISH' AND task_result = 'PASS'
${params.dataScope}) AS carReviewPassedNum,
( SELECT COUNT( id )
FROM t_model_test_task tmtt
LEFT JOIN sys_dept d ON d.dept_id = tmtt.dept_id
WHERE task_status = 'FINISH'
${params.dataScope}) AS modelTestCompletedNum,
( SELECT COUNT( id )
FROM t_model_test_task tmtt
LEFT JOIN sys_dept d ON d.dept_id = tmtt.dept_id
WHERE task_status = 'FINISH' AND task_result = 'PASS'
${params.dataScope}) AS modelTestPassedNum
</select>
</select>
<select
id=
"selectTaskParticipationStatistics"
resultType=
"com.ruoyi.domain.vo.TaskParticipationStatisticsVO"
>
<select
id=
"selectTaskParticipationStatistics"
resultType=
"com.ruoyi.domain.vo.TaskParticipationStatisticsVO"
>
...
@@ -67,7 +133,11 @@
...
@@ -67,7 +133,11 @@
FROM
FROM
t_task_user_relation tur
t_task_user_relation tur
LEFT JOIN sys_user su ON su.user_id = tur.user_id
LEFT JOIN sys_user su ON su.user_id = tur.user_id
LEFT JOIN sys_dept d ON d.dept_id = su.dept_id
WHERE
'A' = 'A'
${params.dataScope}
GROUP BY
GROUP BY
tur.user_id
tur.user_id
</select>
</select>
</mapper>
</mapper>
\ No newline at end of file
quality-review/src/main/resources/mapper/TaskMapper.xml
View file @
d9a4e3ba
...
@@ -145,7 +145,10 @@
...
@@ -145,7 +145,10 @@
t.leader_id,t.leader,
t.leader_id,t.leader,
t.task_begin_time,t.task_end_time
t.task_begin_time,t.task_end_time
FROM t_task t
FROM t_task t
LEFT JOIN sys_dept d ON t.dept_id = d.dept_id
<where>
<where>
${params.dataScope}
AND
t.task_status IN ("FINISH")
t.task_status IN ("FINISH")
<if
test=
"standardId != null and standardId != ''"
>
<if
test=
"standardId != null and standardId != ''"
>
and t.standard_id = #{standardId}
and t.standard_id = #{standardId}
...
...
ruoyi-common/src/main/java/com/ruoyi/common/core/domain/entity/SysDept.java
View file @
d9a4e3ba
...
@@ -6,15 +6,17 @@ import javax.validation.constraints.Email;
...
@@ -6,15 +6,17 @@ import javax.validation.constraints.Email;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotBlank
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.NotNull
;
import
javax.validation.constraints.Size
;
import
javax.validation.constraints.Size
;
import
com.baomidou.mybatisplus.annotation.TableName
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringBuilder
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
org.apache.commons.lang3.builder.ToStringStyle
;
import
com.ruoyi.common.core.domain.BaseEntity
;
import
com.ruoyi.common.core.domain.BaseEntity
;
/**
/**
* 部门表 sys_dept
* 部门表 sys_dept
*
*
* @author ruoyi
* @author ruoyi
*/
*/
@TableName
(
value
=
"sys_dept"
)
public
class
SysDept
extends
BaseEntity
public
class
SysDept
extends
BaseEntity
{
{
private
static
final
long
serialVersionUID
=
1L
;
private
static
final
long
serialVersionUID
=
1L
;
...
...
ruoyi-common/src/main/java/com/ruoyi/common/core/page/PageDomain.java
View file @
d9a4e3ba
package
com
.
ruoyi
.
common
.
core
.
page
;
package
com
.
ruoyi
.
common
.
core
.
page
;
import
com.ruoyi.common.core.domain.BaseEntity
;
import
com.ruoyi.common.utils.StringUtils
;
import
com.ruoyi.common.utils.StringUtils
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModel
;
import
io.swagger.annotations.ApiModelProperty
;
import
io.swagger.annotations.ApiModelProperty
;
/**
/**
* 分页数据
* 分页数据
*
*
* @author ruoyi
* @author ruoyi
*/
*/
@ApiModel
@ApiModel
public
class
PageDomain
public
class
PageDomain
extends
BaseEntity
{
{
/** 当前记录起始索引 */
/** 当前记录起始索引 */
@ApiModelProperty
(
"当前记录起始索引"
)
@ApiModelProperty
(
"当前记录起始索引"
)
...
...
ruoyi-framework/src/main/java/com/ruoyi/framework/aspectj/DataScopeAspect.java
View file @
d9a4e3ba
...
@@ -50,6 +50,11 @@ public class DataScopeAspect
...
@@ -50,6 +50,11 @@ public class DataScopeAspect
*/
*/
public
static
final
String
DATA_SCOPE_SELF
=
"5"
;
public
static
final
String
DATA_SCOPE_SELF
=
"5"
;
/**
* 本部门与父部门下的其他部门数据权限
*/
public
static
final
String
DATA_SCOPE_OTHER
=
"6"
;
/**
/**
* 数据权限过滤关键字
* 数据权限过滤关键字
*/
*/
...
@@ -138,6 +143,16 @@ public class DataScopeAspect
...
@@ -138,6 +143,16 @@ public class DataScopeAspect
// 数据权限为仅本人且没有userAlias别名不查询任何数据
// 数据权限为仅本人且没有userAlias别名不查询任何数据
sqlString
.
append
(
StringUtils
.
format
(
" OR {}.dept_id = 0 "
,
deptAlias
));
sqlString
.
append
(
StringUtils
.
format
(
" OR {}.dept_id = 0 "
,
deptAlias
));
}
}
}
else
if
(
DATA_SCOPE_OTHER
.
equals
(
dataScope
))
{
sqlString
.
append
(
StringUtils
.
format
(
" OR {}.dept_id IN ("
+
"SELECT dept_id FROM sys_dept WHERE find_in_set({}, ancestors) "
+
"OR dept_id = {} "
+
// 包含当前部门
"OR find_in_set((SELECT parent_id FROM sys_dept WHERE dept_id = {}), ancestors)"
+
// 父部门的子部门
")"
,
deptAlias
,
user
.
getDeptId
(),
user
.
getDeptId
(),
user
.
getDeptId
()
));
}
}
conditions
.
add
(
dataScope
);
conditions
.
add
(
dataScope
);
}
}
...
...
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