Commit facde725 authored by 盖献康's avatar 盖献康

Merge branch 'dev' of...

Merge branch 'dev' of ssh://gitlab.91isoft.com:10022/wangfei/vehicle-quality-review into gaixiankang
parents 9586d22d 907798cc
package com.ruoyi.domain.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel("平均检验通过率")
public class AverageInspectionRateVO {
@ApiModelProperty("检验项目")
private String inspectionItems;
@ApiModelProperty("通过率")
private Integer passingRate;
@ApiModelProperty("标准号")
private String standardNumber;
}
package com.ruoyi.domain.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel(value = "首页任务保密等级占比")
public class ConfidentialityLevelProportionVO {
@ApiModelProperty("任务等级数量")
private Long value;
@ApiModelProperty("任务等级")
private String name;
}
package com.ruoyi.domain.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel("三个子项目检验通过个数")
public class InspectionItemPassedNumVO {
@ApiModelProperty("体系审查已完成个数")
private Integer sysReviewcompletedNum;
@ApiModelProperty("体系审查已通过个数")
private Integer sysReviewPassedNum;
@ApiModelProperty("车型审查已完成个数")
private Integer carReviewcompletedNum;
@ApiModelProperty("车型审查已通过个数")
private Integer carReviewPassedNum;
@ApiModelProperty("车型实验已完成个数")
private Integer modelTestCompletedNum;
@ApiModelProperty("车型实验已通过个数")
private Integer modelTestPassedNum;
}
package com.ruoyi.domain.vo;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
@Data
@ApiModel("首页参与任务情况")
public class TaskParticipationStatisticsVO {
@ApiModelProperty("用户名称")
private String userName;
@ApiModelProperty("项目数量")
private Integer taskNum;
}
......@@ -16,4 +16,7 @@ public interface StandardMapper extends BaseMapper<Standard> {
// 根据id查询
Standard findListById(@Param("id") Long Id);
//查询全部
List<Standard> selectListAll();
}
package com.ruoyi.mapper;
import com.ruoyi.domain.vo.QuantityStatisticsVO;
import com.ruoyi.domain.vo.StandardCategoryStatisticsVO;
import com.ruoyi.domain.vo.*;
import org.springframework.stereotype.Repository;
import java.util.List;
......@@ -14,4 +13,13 @@ public interface StatisticsHomeMapper {
// 标准类别统计
public List<StandardCategoryStatisticsVO> selectStandardCategoryStatistics();
// 任务保密等级统计
public List<ConfidentialityLevelProportionVO> selectConfidentialityLevelStatistics();
// 体系审查任务通过数量
public InspectionItemPassedNumVO selectInspectionItemPassedNum();
// 参与任务情况统计
public List<TaskParticipationStatisticsVO> selectTaskParticipationStatistics();
}
package com.ruoyi.service;
import com.ruoyi.domain.vo.QuantityStatisticsVO;
import com.ruoyi.domain.vo.StandardCategoryStatisticsVO;
import com.ruoyi.domain.vo.*;
import java.util.List;
......@@ -11,4 +10,13 @@ public interface StatisticsHomeService {
// 标准类别统计
public List<StandardCategoryStatisticsVO> selectStandardCategoryStatistics();
// 任务保密等级统计
public List<ConfidentialityLevelProportionVO> selectConfidentialityLevelStatistics();
//平均检验通过率
public List<AverageInspectionRateVO> selectAverageInspectionRate();
// 参与任务情况统计
public List<TaskParticipationStatisticsVO> selectTaskParticipationStatistics();
}
package com.ruoyi.service.impl;
import com.ruoyi.domain.vo.QuantityStatisticsVO;
import com.ruoyi.domain.vo.StandardCategoryStatisticsVO;
import com.ruoyi.domain.Standard;
import com.ruoyi.domain.vo.*;
import com.ruoyi.mapper.StandardMapper;
import com.ruoyi.mapper.StatisticsHomeMapper;
import com.ruoyi.service.StatisticsHomeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import java.util.ArrayList;
import java.util.List;
@Service
......@@ -16,6 +18,9 @@ public class StatisticsHomeServiceImpl implements StatisticsHomeService {
@Autowired
private StatisticsHomeMapper statisticsHomeMapper;
@Autowired
private StandardMapper standardMapper;
@Override
public QuantityStatisticsVO selectQuantityStatistics(QuantityStatisticsVO quantityStatisticsHome){
......@@ -30,7 +35,44 @@ public class StatisticsHomeServiceImpl implements StatisticsHomeService {
return statisticsHomeMapper.selectStandardCategoryStatistics();
}
// 计算百分比
@Override
public List<ConfidentialityLevelProportionVO> selectConfidentialityLevelStatistics(){
return statisticsHomeMapper.selectConfidentialityLevelStatistics();
}
@Override
public List<AverageInspectionRateVO> selectAverageInspectionRate(){
List<Standard> standards = standardMapper.selectListAll();
String standardNo = null;
if(!standards.isEmpty()){
standardNo = standards.get(0).getStandardNo();
}
InspectionItemPassedNumVO inspectionItemPassedNumVO = statisticsHomeMapper.selectInspectionItemPassedNum();
List<AverageInspectionRateVO> list = new ArrayList<>();
AverageInspectionRateVO averageInspectionRateOne = new AverageInspectionRateVO();
averageInspectionRateOne.setInspectionItems("汽车信息安全管理体系要求");
averageInspectionRateOne.setPassingRate(proportionCalculation(inspectionItemPassedNumVO.getSysReviewPassedNum(), inspectionItemPassedNumVO.getSysReviewcompletedNum()));
list.add(averageInspectionRateOne);
AverageInspectionRateVO averageInspectionRateTwo = new AverageInspectionRateVO();
averageInspectionRateTwo.setInspectionItems("汽车信息安全一般要求");
averageInspectionRateTwo.setPassingRate(proportionCalculation(inspectionItemPassedNumVO.getCarReviewPassedNum(),inspectionItemPassedNumVO.getCarReviewcompletedNum()));
list.add(averageInspectionRateTwo);
AverageInspectionRateVO averageInspectionRateThree = new AverageInspectionRateVO();
averageInspectionRateThree.setInspectionItems("汽车信息安全技术要求");
averageInspectionRateThree.setPassingRate(proportionCalculation(inspectionItemPassedNumVO.getModelTestPassedNum(),inspectionItemPassedNumVO.getModelTestCompletedNum()));
list.add(averageInspectionRateThree);
for(AverageInspectionRateVO averageInspectionRate:list){
averageInspectionRate.setStandardNumber(standardNo);
}
return list;
}
@Override
public List<TaskParticipationStatisticsVO> selectTaskParticipationStatistics(){
return statisticsHomeMapper.selectTaskParticipationStatistics();
}
// 计算两个数各占比
public int percentageCalculation(Integer a, Integer b){
int total = a+b;
if(total == 0){
......@@ -40,4 +82,14 @@ public class StatisticsHomeServiceImpl implements StatisticsHomeService {
return Math.round(c*100);
}
}
// 计算百分比
public int proportionCalculation(Integer a, Integer b){
if(b == 0){
return 0;
}else {
float c = (float)a/b;
return Math.round(c*100);
}
}
}
package com.ruoyi.web;
import com.ruoyi.common.core.domain.R;
import com.ruoyi.domain.vo.QuantityStatisticsVO;
import com.ruoyi.domain.vo.StandardCategoryStatisticsVO;
import com.ruoyi.domain.vo.*;
import com.ruoyi.service.StatisticsHomeService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
......@@ -32,4 +31,19 @@ public class StatisticsHomeController {
public R<List<StandardCategoryStatisticsVO>> selectStandardCategoryStatistics(){
return R.ok(statisticsHomeService.selectStandardCategoryStatistics());
}
@ApiOperation("首页任务保密等级占比")
@PostMapping("/confidentialityLevel")
public R<List<ConfidentialityLevelProportionVO>> selectConfidentialityLevelStatistics(){
return R.ok(statisticsHomeService.selectConfidentialityLevelStatistics());
}
@ApiOperation("首页平均检验通过率")
@PostMapping("/averageInspectionRate")
public R<List<AverageInspectionRateVO>> selectAverageInspectionRate(){
return R.ok(statisticsHomeService.selectAverageInspectionRate());
}
@ApiOperation("首页任务情况安排")
@PostMapping("/taskParticipation")
public R<List<TaskParticipationStatisticsVO>> selectTaskParticipationStatistics(){
return R.ok(statisticsHomeService.selectTaskParticipationStatistics());
}
}
......@@ -30,4 +30,7 @@
FROM t_standard WHERE id = #{id}
</select>
<select id="selectListAll" resultMap="BaseResultMap">
SELECT id, name, standard_no, file,standard_type,standard_status,release_date,implementation_date FROM t_standard
</select>
</mapper>
......@@ -38,4 +38,34 @@
GROUP BY
standard_type
</select>
<select id="selectConfidentialityLevelStatistics" resultType="com.ruoyi.domain.vo.ConfidentialityLevelProportionVO">
SELECT
count( id ) AS value,
confidentiality_level AS name
FROM
t_task
GROUP BY
confidentiality_level
</select>
<select id="selectInspectionItemPassedNum" resultType="com.ruoyi.domain.vo.InspectionItemPassedNumVO">
SELECT
( SELECT COUNT( id ) FROM t_system_review_task WHERE task_status = 'FINISH' ) AS sysReviewcompletedNum,
( SELECT COUNT( id ) FROM t_system_review_task WHERE task_status = 'FINISH' AND task_result = 'PASS' ) AS sysReviewPassedNum,
( SELECT COUNT( id ) FROM t_car_review_task WHERE task_status = 'FINISH' ) AS carReviewcompletedNum,
( SELECT COUNT( id ) FROM t_car_review_task WHERE task_status = 'FINISH' AND task_result = 'PASS' ) AS carReviewPassedNum,
( SELECT COUNT( id ) FROM t_model_test_task WHERE task_status = 'FINISH' ) AS modelTestCompletedNum,
( SELECT COUNT( id ) FROM t_model_test_task WHERE task_status = 'FINISH' AND task_result = 'PASS' ) AS modelTestPassedNum
</select>
<select id="selectTaskParticipationStatistics" resultType="com.ruoyi.domain.vo.TaskParticipationStatisticsVO">
SELECT
count( task_id ) AS taskNum,
NAME AS userName
FROM
t_task_user_relation
GROUP BY
user_id,NAME
</select>
</mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment