c6392105 康伟

kangwei:MTTR&MTBF 详情页面bug

1 个父辈 bba284f8
...@@ -48,8 +48,9 @@ public class OperationReportServiceImpl implements IOperationReportService { ...@@ -48,8 +48,9 @@ public class OperationReportServiceImpl implements IOperationReportService {
48 ProductDataVO productDataVO = new ProductDataVO();//返回结果 48 ProductDataVO productDataVO = new ProductDataVO();//返回结果
49 int lastYear = year - 1;//去年 49 int lastYear = year - 1;//去年
50 productDataVO.setLastYear(lastYear); 50 productDataVO.setLastYear(lastYear);
51 productDataVO.setYear( year );
51 SeasonTimeVO seasonTimeVO = new SeasonTimeVO(year ,season ); 52 SeasonTimeVO seasonTimeVO = new SeasonTimeVO(year ,season );
52 SeasonTimeVO lastSeasonTimeVO = new SeasonTimeVO(lastYear ,season ); 53 // SeasonTimeVO lastSeasonTimeVO = new SeasonTimeVO(lastYear ,season );
53 productDataVO.setSeansonEndDay(seasonTimeVO.getEndTime());//季度最后一天 54 productDataVO.setSeansonEndDay(seasonTimeVO.getEndTime());//季度最后一天
54 productDataVO.setStartTime(seasonTimeVO.getStartTime());//季度开始时间 55 productDataVO.setStartTime(seasonTimeVO.getStartTime());//季度开始时间
55 productDataVO.setEndTime( seasonTimeVO.getEndTime());//季度结束时间 56 productDataVO.setEndTime( seasonTimeVO.getEndTime());//季度结束时间
...@@ -63,7 +64,7 @@ public class OperationReportServiceImpl implements IOperationReportService { ...@@ -63,7 +64,7 @@ public class OperationReportServiceImpl implements IOperationReportService {
63 productDataVO.setSequentialProgress("基本满足时序进度"); 64 productDataVO.setSequentialProgress("基本满足时序进度");
64 // ysfsl:月收费水量 ; yyf:月药费 ; ysjsl:月实际水量 65 // ysfsl:月收费水量 ; yyf:月药费 ; ysjsl:月实际水量
65 String dataViewName4411 = ReportViewUtil.buildView(ReportConstant.view4411,"ysfsl,ysjsl,yyf", departId, seasonTimeVO.getStartTime(),seasonTimeVO.getEndTime()); 66 String dataViewName4411 = ReportViewUtil.buildView(ReportConstant.view4411,"ysfsl,ysjsl,yyf", departId, seasonTimeVO.getStartTime(),seasonTimeVO.getEndTime());
66 sql = "select sum(aaa.ysfsl) 'ysfsl' , sum(aaa.yyf) 'yyf' ,sum(aaa.ysjsl) 'ysjsl' from "+ dataViewName4411 + " aaa"; 67 sql = "select round(sum(aaa.ysfsl),2) 'ysfsl' , round(sum(aaa.yyf),2) 'yyf' ,round(sum(aaa.ysjsl),2) 'ysjsl' from "+ dataViewName4411 + " aaa";
67 String ysfsl = null;//月收费水量 ; 68 String ysfsl = null;//月收费水量 ;
68 String ysjsl = null;//月实际水量; 69 String ysjsl = null;//月实际水量;
69 Map<String, Object> dataMap = getJdbcTemplate().queryForMap(sql); 70 Map<String, Object> dataMap = getJdbcTemplate().queryForMap(sql);
......
...@@ -669,11 +669,11 @@ ...@@ -669,11 +669,11 @@
669 SELECT eor.factory_id ,IFNULL( SUM( SUBSTRING( run_time, 1, 2 ) ), 0 ) / 24 AS runTime 669 SELECT eor.factory_id ,IFNULL( SUM( SUBSTRING( run_time, 1, 2 ) ), 0 ) / 24 AS runTime
670 FROM equipment_operation_record eor 670 FROM equipment_operation_record eor
671 WHERE 1=1 671 WHERE 1=1
672 <if test="startDate != null and startDate != ''"> 672 <if test="startTime != null and startTime != ''">
673 and eor.create_time &gt;= #{startDate} 673 and eor.create_time &gt;= #{startTime}
674 </if> 674 </if>
675 <if test="endDate != null and endDate != ''"> 675 <if test="endTime != null and endTime != ''">
676 and eor.create_time &lt;= #{endDate} 676 and eor.create_time &lt;= #{endTime}
677 </if> 677 </if>
678 group by eor.factory_id 678 group by eor.factory_id
679 )aaa on aaa.factory_id = d.id 679 )aaa on aaa.factory_id = d.id
...@@ -682,18 +682,17 @@ ...@@ -682,18 +682,17 @@
682 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 682 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
683 FROM equipment_repair er 683 FROM equipment_repair er
684 WHERE er.del_flag = 1 684 WHERE er.del_flag = 1
685 <if test="startDate != null and startDate != ''"> 685 <if test="startTime != null and startTime != ''">
686 and er.create_time &gt;= #{startDate} 686 and er.create_time &gt;= #{startTime}
687 </if> 687 </if>
688 <if test="endDate != null and endDate != ''"> 688 <if test="endTime != null and endTime != ''">
689 and er.create_time &lt;= #{endDate} 689 and er.create_time &lt;= #{endTime}
690 </if> 690 </if>
691 AND
692 )bbb on bbb.depart_id = d.id 691 )bbb on bbb.depart_id = d.id
693 where d.depart_type = 1 692 where d.depart_type = 1
694 <if test="departIds != null "> 693 <if test="departIds != null ">
695 and d.depart_id in(${departIds}) 694 and d.id in(${departIds})
696 </if> 695 </if>
697 </select> 696 </select>
698 697
699 698
......
...@@ -51,7 +51,7 @@ public interface IProductionEquipmentService { ...@@ -51,7 +51,7 @@ public interface IProductionEquipmentService {
51 // MF 详情 51 // MF 详情
52 List<Map> getEquipmentMFDetails(ReportStatisticsDTO reportStatisticsDTO); 52 List<Map> getEquipmentMFDetails(ReportStatisticsDTO reportStatisticsDTO);
53 53
54 public List<ContrastDetailVO> getEquipmentMFDetailsNew(String departIds,String startTime,String endTime); 54 List<ContrastDetailVO> getEquipmentMFDetailsNew(String departIds,String startTime,String endTime);
55 55
56 //维护完成率趋势 56 //维护完成率趋势
57 List<ContrastVO> getMaintainCompleteRate(ReportStatisticsDTO reportStatisticsDTO); 57 List<ContrastVO> getMaintainCompleteRate(ReportStatisticsDTO reportStatisticsDTO);
......
...@@ -47,7 +47,7 @@ public class ContrastDetailVO { ...@@ -47,7 +47,7 @@ public class ContrastDetailVO {
47 47
48 public Double getRepairNum() { 48 public Double getRepairNum() {
49 repairNum = 0.00d; 49 repairNum = 0.00d;
50 if (StringUtils.isNotEmpty(failures) && StringUtils.isNotEmpty(equips) && !failures.equals("0") && !equips.equals("0")) { 50 if (StringUtils.isNotEmpty(runTime) && StringUtils.isNotEmpty(failures) && StringUtils.isNotEmpty(equips) && !failures.equals("0") && !equips.equals("0")) {
51 repairNum = Double.parseDouble(runTime) / Integer.parseInt(failures) / Integer.parseInt(equips); 51 repairNum = Double.parseDouble(runTime) / Integer.parseInt(failures) / Integer.parseInt(equips);
52 repairNum = DoubleOperaUtils.bigDecimalRound(repairNum,2); 52 repairNum = DoubleOperaUtils.bigDecimalRound(repairNum,2);
53 } 53 }
...@@ -56,7 +56,7 @@ public class ContrastDetailVO { ...@@ -56,7 +56,7 @@ public class ContrastDetailVO {
56 56
57 public Double getMaintainNum() { 57 public Double getMaintainNum() {
58 maintainNum =0.00d; 58 maintainNum =0.00d;
59 if (StringUtils.isNotEmpty(increase) && !increase.equals("0")) { 59 if (StringUtils.isNotEmpty(downtime) && StringUtils.isNotEmpty(increase) && !increase.equals("0")) {
60 maintainNum = Double.parseDouble(downtime) / Integer.parseInt(increase); 60 maintainNum = Double.parseDouble(downtime) / Integer.parseInt(increase);
61 maintainNum = DoubleOperaUtils.bigDecimalRound(maintainNum,2); 61 maintainNum = DoubleOperaUtils.bigDecimalRound(maintainNum,2);
62 } 62 }
......
支持 Markdown 格式
你添加了 0 到此讨论。请谨慎行事。
Finish editing this message first!