Merge remote-tracking branch 'origin/main'
This commit is contained in:
commit
52a6f4e1b1
|
|
@ -30,4 +30,6 @@ public class ScreenParamDto extends ScreenDto{
|
|||
|
||||
private String teamName;
|
||||
|
||||
private String projectName;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -1,6 +1,10 @@
|
|||
package com.securitycontrol.entity.screen.vo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import java.math.BigDecimal;
|
||||
|
||||
/**
|
||||
* @Author:liang.chao
|
||||
|
|
@ -13,5 +17,16 @@ public class ProjectQualityVo {
|
|||
private String projectAddress;
|
||||
private String contractorName;
|
||||
private String qualityLevel;
|
||||
private String isContract;
|
||||
private String projectManager;
|
||||
private String team;
|
||||
private String startTime;
|
||||
private BigDecimal checkNum;
|
||||
private BigDecimal passNum;
|
||||
// 得分
|
||||
private BigDecimal score;
|
||||
// 合格率
|
||||
private String passRate;
|
||||
// 不合格率
|
||||
private String noPassRate;
|
||||
private String unqualifiedItems;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -56,6 +56,7 @@ public class ProjectProgressNewController extends BaseController {
|
|||
ProjectProgressNew projectProgress4 = new ProjectProgressNew();
|
||||
ProjectProgressNew projectProgress5 = new ProjectProgressNew();
|
||||
ProjectProgressNew projectProgress6 = new ProjectProgressNew();
|
||||
ProjectProgressNew projectProgress7 = new ProjectProgressNew();
|
||||
projectProgress1.setMonth("一月");
|
||||
projectProgress1.setMonthValue("60");
|
||||
projectProgress1.setMonthValue2("80");
|
||||
|
|
@ -74,12 +75,16 @@ public class ProjectProgressNewController extends BaseController {
|
|||
projectProgress6.setMonth("六月");
|
||||
projectProgress6.setMonthValue("75");
|
||||
projectProgress6.setMonthValue2("88");
|
||||
projectProgress7.setMonth("七月");
|
||||
projectProgress7.setMonthValue("85");
|
||||
projectProgress7.setMonthValue2("98");
|
||||
list.add(projectProgress1);
|
||||
list.add(projectProgress2);
|
||||
list.add(projectProgress3);
|
||||
list.add(projectProgress4);
|
||||
list.add(projectProgress5);
|
||||
list.add(projectProgress6);
|
||||
list.add(projectProgress7);
|
||||
return getDataTable(list);
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -76,4 +76,16 @@ public class EngineeringSafetyAnalysis extends BaseEntity {
|
|||
@ApiModelProperty(value = "数量")
|
||||
private String count;
|
||||
|
||||
/** 工程名称 */
|
||||
@ApiModelProperty(value = "工程名称")
|
||||
private String proName;
|
||||
|
||||
/** 作业地点 */
|
||||
@ApiModelProperty(value = "作业地点")
|
||||
private String workLocation;
|
||||
|
||||
/** 分析原因 */
|
||||
@ApiModelProperty(value = "分析原因")
|
||||
private String analysisReason;
|
||||
|
||||
}
|
||||
|
|
|
|||
|
|
@ -82,6 +82,10 @@ public class ProjectProgressNew extends BaseEntity {
|
|||
/** 关键路径任务标识(是 / 否) */
|
||||
private String keyPathFlag;
|
||||
|
||||
private String delayStatus;
|
||||
|
||||
private String delayPolicy;
|
||||
|
||||
private String month;
|
||||
|
||||
private String monthValue;
|
||||
|
|
|
|||
|
|
@ -11,8 +11,12 @@ import lombok.extern.slf4j.Slf4j;
|
|||
import org.springframework.stereotype.Service;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
import java.math.BigDecimal;
|
||||
import java.math.RoundingMode;
|
||||
import java.text.NumberFormat;
|
||||
import java.util.ArrayList;
|
||||
import java.util.List;
|
||||
import java.util.Locale;
|
||||
import java.util.Optional;
|
||||
|
||||
/**
|
||||
|
|
@ -55,7 +59,37 @@ public class DataAnalysisServiceImpl implements DataAnalysisService {
|
|||
public List<ProjectQualityVo> getEngqualityAnalysis(ScreenParamDto dto) {
|
||||
List<ProjectQualityVo> list = null;
|
||||
try {
|
||||
if (dto.getTypeCode() == 1) {
|
||||
dto.setProjectName("安徽淮北凌云220kv变电站新建工程");
|
||||
} else if (dto.getTypeCode() == 2) {
|
||||
dto.setProjectName("淮北红枫110kV变电站新建工程");
|
||||
}
|
||||
list = Optional.ofNullable(mapper.getEngqualityAnalysis(dto)).orElseGet(ArrayList::new);
|
||||
for (ProjectQualityVo projectQualityVo : list) {
|
||||
// 避免除不尽,设置精度为 4 位小数,四舍五入
|
||||
BigDecimal result = projectQualityVo.getPassNum().divide(projectQualityVo.getCheckNum(), 4, RoundingMode.HALF_UP);
|
||||
// 转换为百分制分数(乘以 100)
|
||||
BigDecimal score = result.multiply(new BigDecimal("100"));
|
||||
|
||||
//保留0位小数,变成整数分
|
||||
BigDecimal integerScore = score.setScale(0, RoundingMode.HALF_UP);
|
||||
|
||||
// 转换为百分比格式(自动 ×100 并加上 %)
|
||||
NumberFormat percentFormat = NumberFormat.getPercentInstance(Locale.getDefault());
|
||||
// 最多保留两位小数
|
||||
percentFormat.setMaximumFractionDigits(2);
|
||||
|
||||
String percentage = percentFormat.format(result.doubleValue());
|
||||
// 合格率
|
||||
projectQualityVo.setPassRate(percentage);
|
||||
|
||||
// 不合格率
|
||||
BigDecimal failRate = BigDecimal.ONE.subtract(result);
|
||||
String failRateStr = percentFormat.format(failRate.doubleValue());
|
||||
projectQualityVo.setNoPassRate(failRateStr);
|
||||
// 得分
|
||||
projectQualityVo.setScore(integerScore);
|
||||
}
|
||||
} catch (Exception e) {
|
||||
log.error(e.toString(),e);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -39,7 +39,16 @@
|
|||
project_address as projectAddress,
|
||||
contractor_name as contractorName,
|
||||
case when quality_level = 1 then '初级' when quality_level = 2 then '中级' else '高级' end as qualityLevel,
|
||||
case when is_contract = 1 then '是' else '否' end as isContract
|
||||
project_manager as projectManager,
|
||||
team,
|
||||
start_time as startTime,
|
||||
check_num as checkNum,
|
||||
pass_num as passNum,
|
||||
unqualified_items as unqualifiedItems
|
||||
from tb_project_quality
|
||||
where 1 = 1
|
||||
<if test="projectName != null and projectName != ''">
|
||||
and projectName = #{projectName}
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
|
|
@ -19,6 +19,9 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="level" column="level" />
|
||||
<result property="timestamp" column="timestamp" />
|
||||
<result property="name" column="name" />
|
||||
<result property="proName" column="pro_name" />
|
||||
<result property="workLocation" column="work_location" />
|
||||
<result property="analysisReason" column="analysis_reason" />
|
||||
</resultMap>
|
||||
|
||||
<!--查询安全隐患集合列表-->
|
||||
|
|
@ -34,9 +37,13 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
COALESCE(ale.avg_temperature, '-') AS temperature,
|
||||
COALESCE(ale.avg_humidity, '-') AS humidity,
|
||||
COALESCE(ale.avg_wind_speed, '-') AS wind_speed,
|
||||
COALESCE(ale.avg_gas_value, '-') AS gas_value
|
||||
COALESCE(ale.avg_gas_value, '-') AS gas_value,
|
||||
pro.pro_name ,
|
||||
h.work_location,
|
||||
h.analysis_reason
|
||||
FROM
|
||||
hazards h
|
||||
LEFT JOIN tb_project_new pro on h.bid_code = pro.bid_code
|
||||
LEFT JOIN
|
||||
monitoring_points mp ON h.bid_code = mp.bid_code
|
||||
LEFT JOIN
|
||||
|
|
|
|||
|
|
@ -19,6 +19,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<result property="delayActor" column="delay_actor" />
|
||||
<result property="resourceMatchStatus" column="resource_match_status" />
|
||||
<result property="keyPathFlag" column="key_path_flag" />
|
||||
<result property="delayStatus" column="delay_status" />
|
||||
<result property="delayPolicy" column="delay_policy" />
|
||||
<result property="createBy" column="create_by" />
|
||||
<result property="createTime" column="create_time" />
|
||||
<result property="updateBy" column="update_by" />
|
||||
|
|
@ -26,7 +28,11 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
</resultMap>
|
||||
|
||||
<sql id="selectProjectProgressNewVo">
|
||||
select id, project_id, project_name, task_code, task_name, plan_start_time, plan_end_time, actual_start_time, actual_end_time, process_diff, total_effort, complete_effort, delay_actor, resource_match_status, key_path_flag, create_by, create_time, update_by, update_time from tb_project_progress_new
|
||||
select id, project_id, project_name, task_code, task_name, plan_start_time,
|
||||
plan_end_time, actual_start_time, actual_end_time, process_diff, total_effort,
|
||||
complete_effort, delay_actor, resource_match_status, key_path_flag,
|
||||
create_by, create_time, update_by, update_time, delay_status, delay_policy
|
||||
from tb_project_progress_new
|
||||
</sql>
|
||||
|
||||
<select id="selectProjectProgressNewList" parameterType="com.securitycontrol.screen.domain.ProjectProgressNew" resultMap="ProjectProgressNewResult">
|
||||
|
|
@ -44,6 +50,8 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
|||
<if test="totalEffort != null and totalEffort != ''"> and total_effort = #{totalEffort}</if>
|
||||
<if test="completeEffort != null and completeEffort != ''"> and complete_effort = #{completeEffort}</if>
|
||||
<if test="delayActor != null and delayActor != ''"> and delay_actor = #{delayActor}</if>
|
||||
<if test="delayStatus != null and delayStatus != ''"> and delay_status = #{delayStatus}</if>
|
||||
<if test="delayPolicy != null and delayPolicy != ''"> and delay_policy = #{delayPolicy}</if>
|
||||
<if test="resourceMatchStatus != null and resourceMatchStatus != ''"> and resource_match_status = #{resourceMatchStatus}</if>
|
||||
<if test="keyPathFlag != null and keyPathFlag != ''"> and key_path_flag = #{keyPathFlag}</if>
|
||||
</where>
|
||||
|
|
|
|||
Loading…
Reference in New Issue