c6392105 康伟

kangwei:MTTR&MTBF 详情页面bug

1 个父辈 bba284f8
......@@ -48,8 +48,9 @@ public class OperationReportServiceImpl implements IOperationReportService {
ProductDataVO productDataVO = new ProductDataVO();//返回结果
int lastYear = year - 1;//去年
productDataVO.setLastYear(lastYear);
productDataVO.setYear( year );
SeasonTimeVO seasonTimeVO = new SeasonTimeVO(year ,season );
SeasonTimeVO lastSeasonTimeVO = new SeasonTimeVO(lastYear ,season );
// SeasonTimeVO lastSeasonTimeVO = new SeasonTimeVO(lastYear ,season );
productDataVO.setSeansonEndDay(seasonTimeVO.getEndTime());//季度最后一天
productDataVO.setStartTime(seasonTimeVO.getStartTime());//季度开始时间
productDataVO.setEndTime( seasonTimeVO.getEndTime());//季度结束时间
......@@ -63,7 +64,7 @@ public class OperationReportServiceImpl implements IOperationReportService {
productDataVO.setSequentialProgress("基本满足时序进度");
// ysfsl:月收费水量 ; yyf:月药费 ; ysjsl:月实际水量
String dataViewName4411 = ReportViewUtil.buildView(ReportConstant.view4411,"ysfsl,ysjsl,yyf", departId, seasonTimeVO.getStartTime(),seasonTimeVO.getEndTime());
sql = "select sum(aaa.ysfsl) 'ysfsl' , sum(aaa.yyf) 'yyf' ,sum(aaa.ysjsl) 'ysjsl' from "+ dataViewName4411 + " aaa";
sql = "select round(sum(aaa.ysfsl),2) 'ysfsl' , round(sum(aaa.yyf),2) 'yyf' ,round(sum(aaa.ysjsl),2) 'ysjsl' from "+ dataViewName4411 + " aaa";
String ysfsl = null;//月收费水量 ;
String ysjsl = null;//月实际水量;
Map<String, Object> dataMap = getJdbcTemplate().queryForMap(sql);
......
......@@ -669,11 +669,11 @@
SELECT eor.factory_id ,IFNULL( SUM( SUBSTRING( run_time, 1, 2 ) ), 0 ) / 24 AS runTime
FROM equipment_operation_record eor
WHERE 1=1
<if test="startDate != null and startDate != ''">
and eor.create_time &gt;= #{startDate}
<if test="startTime != null and startTime != ''">
and eor.create_time &gt;= #{startTime}
</if>
<if test="endDate != null and endDate != ''">
and eor.create_time &lt;= #{endDate}
<if test="endTime != null and endTime != ''">
and eor.create_time &lt;= #{endTime}
</if>
group by eor.factory_id
)aaa on aaa.factory_id = d.id
......@@ -682,17 +682,16 @@
SELECT er.depart_id,COUNT( DISTINCT info_id ) AS equips,COUNT( er.id ) AS failures, round( IFNULL(SUM( UNIX_TIMESTAMP( er.reality_maintenance_end_time )- UNIX_TIMESTAMP( er.repair_date ) ),0)/60/60/24 ,2) AS downtime
FROM equipment_repair er
WHERE er.del_flag = 1
<if test="startDate != null and startDate != ''">
and er.create_time &gt;= #{startDate}
<if test="startTime != null and startTime != ''">
and er.create_time &gt;= #{startTime}
</if>
<if test="endDate != null and endDate != ''">
and er.create_time &lt;= #{endDate}
<if test="endTime != null and endTime != ''">
and er.create_time &lt;= #{endTime}
</if>
AND
)bbb on bbb.depart_id = d.id
where d.depart_type = 1
<if test="departIds != null ">
and d.depart_id in(${departIds})
and d.id in(${departIds})
</if>
</select>
......
......@@ -51,7 +51,7 @@ public interface IProductionEquipmentService {
// MF 详情
List<Map> getEquipmentMFDetails(ReportStatisticsDTO reportStatisticsDTO);
public List<ContrastDetailVO> getEquipmentMFDetailsNew(String departIds,String startTime,String endTime);
List<ContrastDetailVO> getEquipmentMFDetailsNew(String departIds,String startTime,String endTime);
//维护完成率趋势
List<ContrastVO> getMaintainCompleteRate(ReportStatisticsDTO reportStatisticsDTO);
......
......@@ -47,7 +47,7 @@ public class ContrastDetailVO {
public Double getRepairNum() {
repairNum = 0.00d;
if (StringUtils.isNotEmpty(failures) && StringUtils.isNotEmpty(equips) && !failures.equals("0") && !equips.equals("0")) {
if (StringUtils.isNotEmpty(runTime) && StringUtils.isNotEmpty(failures) && StringUtils.isNotEmpty(equips) && !failures.equals("0") && !equips.equals("0")) {
repairNum = Double.parseDouble(runTime) / Integer.parseInt(failures) / Integer.parseInt(equips);
repairNum = DoubleOperaUtils.bigDecimalRound(repairNum,2);
}
......@@ -56,7 +56,7 @@ public class ContrastDetailVO {
public Double getMaintainNum() {
maintainNum =0.00d;
if (StringUtils.isNotEmpty(increase) && !increase.equals("0")) {
if (StringUtils.isNotEmpty(downtime) && StringUtils.isNotEmpty(increase) && !increase.equals("0")) {
maintainNum = Double.parseDouble(downtime) / Integer.parseInt(increase);
maintainNum = DoubleOperaUtils.bigDecimalRound(maintainNum,2);
}
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!