kangwei: 修改bug
正在显示
8 个修改的文件
包含
40 行增加
和
6 行删除
... | @@ -53,9 +53,9 @@ | ... | @@ -53,9 +53,9 @@ |
53 | <select id="yhCensus" resultType="java.util.Map"> | 53 | <select id="yhCensus" resultType="java.util.Map"> |
54 | SELECT | 54 | SELECT |
55 | sd.depart_name, | 55 | sd.depart_name, |
56 | ifnull( SUM( CASE WHEN LEFT ( sr.rec_ord_whenlong, 7 ) = #{nowMonth} THEN 1 ELSE 0 END ),0) as now, | 56 | ifnull( SUM( CASE WHEN LEFT ( sr.rec_ord_report_date, 7 ) = #{nowMonth} THEN 1 ELSE 0 END ),0) as now, |
57 | ifnull( SUM( CASE WHEN LEFT ( sr.rec_ord_whenlong, 4 ) =#{nowYear} THEN 1 ELSE 0 END),0) as nowYear, | 57 | ifnull( SUM( CASE WHEN LEFT ( sr.rec_ord_report_date, 4 ) =#{nowYear} THEN 1 ELSE 0 END),0) as nowYear, |
58 | ifnull( SUM( CASE WHEN LEFT ( sr.rec_ord_whenlong, 4 ) =#{lastYear} THEN 1 ELSE 0 END ),0) as last_year | 58 | ifnull( SUM( CASE WHEN LEFT ( sr.rec_ord_report_date, 4 ) =#{lastYear} THEN 1 ELSE 0 END ),0) as last_year |
59 | FROM | 59 | FROM |
60 | sys_factory_info sf | 60 | sys_factory_info sf |
61 | LEFT JOIN sys_depart sd ON sf.depart_id = sd.id | 61 | LEFT JOIN sys_depart sd ON sf.depart_id = sd.id | ... | ... |
... | @@ -267,7 +267,7 @@ public class EmergencyRiskEventServiceImpl extends ServiceImpl<EmergencyRiskEven | ... | @@ -267,7 +267,7 @@ public class EmergencyRiskEventServiceImpl extends ServiceImpl<EmergencyRiskEven |
267 | // 风险排查 | 267 | // 风险排查 |
268 | sql += " left join ( select depart_id ,count(id) 'count' from danger_inspection_record where report_date >= '"+startDate+" 00:00:00' and report_date <='"+endDate+" 23:59:59' group by depart_id ) bb on bb.depart_id = d.id "; | 268 | sql += " left join ( select depart_id ,count(id) 'count' from danger_inspection_record where report_date >= '"+startDate+" 00:00:00' and report_date <='"+endDate+" 23:59:59' group by depart_id ) bb on bb.depart_id = d.id "; |
269 | //实际完成数量 | 269 | //实际完成数量 |
270 | sql += " left join ( select depart_id ,count(id) 'count' from danger_inspection_record where status = '2' and end_date >= '"+startDate+" 00:00:00' and end_date <='"+endDate+" 23:59:59' group by depart_id ) eee on eee.depart_id = d.id "; | 270 | sql += " left join ( select depart_id ,count(id) 'count' from danger_inspection_record where status = '2' and end_date >= '"+startDate+" 00:00:00' and end_date <='"+endDate+" 23:59:59' group by depart_id ) ee on ee.depart_id = d.id "; |
271 | 271 | ||
272 | // 异常 | 272 | // 异常 |
273 | sql += " left join ( select t.depart_id , count(1) 'count' from problem_report_plan t where t.report_time >='"+startDate+"' and t.report_time <='"+endDate+"' group by t.depart_id) cc on cc.depart_id = d.id"; | 273 | sql += " left join ( select t.depart_id , count(1) 'count' from problem_report_plan t where t.report_time >='"+startDate+"' and t.report_time <='"+endDate+"' group by t.depart_id) cc on cc.depart_id = d.id"; | ... | ... |
... | @@ -16,7 +16,7 @@ public class DangerEventOverviewVO { | ... | @@ -16,7 +16,7 @@ public class DangerEventOverviewVO { |
16 | @ApiModelProperty(value = "厂站名称") | 16 | @ApiModelProperty(value = "厂站名称") |
17 | private String departName; | 17 | private String departName; |
18 | /**隐患处理数*/ | 18 | /**隐患处理数*/ |
19 | @ApiModelProperty(value = "隐患处理数") | 19 | @ApiModelProperty(value = "隐患处理中") |
20 | private Integer yhNoHandleNum ; | 20 | private Integer yhNoHandleNum ; |
21 | /**隐患已处理数*/ | 21 | /**隐患已处理数*/ |
22 | @ApiModelProperty(value = "隐患已处理数") | 22 | @ApiModelProperty(value = "隐患已处理数") | ... | ... |
... | @@ -179,7 +179,7 @@ public class EquipmentInfoMonthReportController { | ... | @@ -179,7 +179,7 @@ public class EquipmentInfoMonthReportController { |
179 | private List<Map<String,Object>> equipmentARunList(String departIds,String startDate,String endDate){ | 179 | private List<Map<String,Object>> equipmentARunList(String departIds,String startDate,String endDate){ |
180 | String sql =" select d.id 'depart_id', d.depart_name , aaa.equipment_name, aaa.fault_library_id from sys_depart d"; | 180 | String sql =" select d.id 'depart_id', d.depart_name , aaa.equipment_name, aaa.fault_library_id from sys_depart d"; |
181 | sql += " left join (select er.id 'info_id', er.depart_id , ei.equipment_name , GROUP_CONCAT(er.fault_content) fault_content , GROUP_CONCAT( er.fault_library_id) fault_library_id from equipment_repair er , equipment_info ei "; | 181 | sql += " left join (select er.id 'info_id', er.depart_id , ei.equipment_name , GROUP_CONCAT(er.fault_content) fault_content , GROUP_CONCAT( er.fault_library_id) fault_library_id from equipment_repair er , equipment_info ei "; |
182 | sql += " where er.info_id = ei.id and repair_date >= '"+startDate+" 00:00:00' and repair_date <='"+endDate+" 23:59:59' "; | 182 | sql += " where er.info_id = ei.id and and ei.equipment_level = '6bf727eb7e7cca6a95c694dab0036b2c' and repair_date >= '"+startDate+" 00:00:00' and repair_date <='"+endDate+" 23:59:59' "; |
183 | sql += " group by er.depart_id ,er.info_id )aaa on aaa.depart_id = d.id "; | 183 | sql += " group by er.depart_id ,er.info_id )aaa on aaa.depart_id = d.id "; |
184 | sql += " where d.depart_type = 1 "; | 184 | sql += " where d.depart_type = 1 "; |
185 | if(StringUtils.isNotEmpty(departIds)){ | 185 | if(StringUtils.isNotEmpty(departIds)){ | ... | ... |
... | @@ -48,6 +48,15 @@ public interface ProductionEquipmentMapper { | ... | @@ -48,6 +48,15 @@ public interface ProductionEquipmentMapper { |
48 | //获取保养费用 | 48 | //获取保养费用 |
49 | Double getMaintainCost(@Param("startTime") String startTime, @Param("endTime") String endTime); | 49 | Double getMaintainCost(@Param("startTime") String startTime, @Param("endTime") String endTime); |
50 | 50 | ||
51 | /*** | ||
52 | * 根据维修类型获取维修费用(单位万元) | ||
53 | * @param startTime | ||
54 | * @param endTime | ||
55 | * @return | ||
56 | */ | ||
57 | Double getMaintainCostByMaintenanceType(@Param("maintenanceType") String maintenanceType,@Param("startTime") String startTime, @Param("endTime") String endTime); | ||
58 | |||
59 | |||
51 | //获取生产设备等级 | 60 | //获取生产设备等级 |
52 | List<ProportionStatisticsVO> getLevelByTime(ReportStatisticsDTO reportStatisticsDTO); | 61 | List<ProportionStatisticsVO> getLevelByTime(ReportStatisticsDTO reportStatisticsDTO); |
53 | 62 | ... | ... |
... | @@ -103,6 +103,21 @@ | ... | @@ -103,6 +103,21 @@ |
103 | and #{endTime} | 103 | and #{endTime} |
104 | </if> | 104 | </if> |
105 | </select> | 105 | </select> |
106 | <select id="getMaintainCostByMaintenanceType" parameterType="java.lang.String" resultType="java.lang.Double"> | ||
107 | select round(ifnull(sum(maintenance_cost)/10000,0),2) maintenance_cost | ||
108 | from equipment_maintain_task emt , equipment_maintain_plan emp | ||
109 | WHERE emt.plan_id = emp.id and emt.del_flag = 0 | ||
110 | <if test="maintenanceType !=null and maintenanceType !=''"> | ||
111 | and emp.maintenance_type = #{maintenanceType} | ||
112 | </if> | ||
113 | <if test="startTime !=null and startTime !=''"> | ||
114 | AND emt.maintain_time >= #{startTime} | ||
115 | </if> | ||
116 | <if test="endTime !=null and endTime !=''"> | ||
117 | AND emt.maintain_time <= #{endTime} | ||
118 | </if> | ||
119 | </select> | ||
120 | |||
106 | 121 | ||
107 | <select id="getEquipmentStatisticsDetailsNew" resultType="com.skua.modules.equipment.vo.EquipmentStatisticsCountVO"> | 122 | <select id="getEquipmentStatisticsDetailsNew" resultType="com.skua.modules.equipment.vo.EquipmentStatisticsCountVO"> |
108 | select d.depart_name , d.id 'depart_id', | 123 | select d.depart_name , d.id 'depart_id', | ... | ... |
... | @@ -65,6 +65,7 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi | ... | @@ -65,6 +65,7 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi |
65 | Double maintainCost = 0.00; | 65 | Double maintainCost = 0.00; |
66 | Double totalCost = 0.00; | 66 | Double totalCost = 0.00; |
67 | Double costRing = 0.00; | 67 | Double costRing = 0.00; |
68 | Double dxjgCost = 0d; | ||
68 | 69 | ||
69 | //ab总数 | 70 | //ab总数 |
70 | Integer ABEquipmentNum = 0; | 71 | Integer ABEquipmentNum = 0; |
... | @@ -216,6 +217,8 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi | ... | @@ -216,6 +217,8 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi |
216 | repairCompleteRing = (repairCompleteRate - lastRepairCompleteRate) / lastRepairCompleteRate * 100; | 217 | repairCompleteRing = (repairCompleteRate - lastRepairCompleteRate) / lastRepairCompleteRate * 100; |
217 | } | 218 | } |
218 | //维护维修费用 | 219 | //维护维修费用 |
220 | //大修费用 | ||
221 | dxjgCost = productionEquipmentMapper.getMaintainCostByMaintenanceType("dxjg",reportStatisticsDTO.getTime() + YEAR_START, reportStatisticsDTO.getTime() + YEAR_END); | ||
219 | //维修费 | 222 | //维修费 |
220 | repairCost = productionEquipmentMapper.getRepairCost(reportStatisticsDTO.getTime() + YEAR_START, reportStatisticsDTO.getTime() + YEAR_END); | 223 | repairCost = productionEquipmentMapper.getRepairCost(reportStatisticsDTO.getTime() + YEAR_START, reportStatisticsDTO.getTime() + YEAR_END); |
221 | //保养费 | 224 | //保养费 |
... | @@ -228,6 +231,7 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi | ... | @@ -228,6 +231,7 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi |
228 | costRing = (totalCost - (repairCost1 + maintainCost1)) / (repairCost1 + maintainCost1) * 100; | 231 | costRing = (totalCost - (repairCost1 + maintainCost1)) / (repairCost1 + maintainCost1) * 100; |
229 | } | 232 | } |
230 | } | 233 | } |
234 | |||
231 | productionEquipmentVO.setEquipmentNum(equipmentNum); | 235 | productionEquipmentVO.setEquipmentNum(equipmentNum); |
232 | productionEquipmentVO.setAbEquipmentNum(ABEquipmentNum); | 236 | productionEquipmentVO.setAbEquipmentNum(ABEquipmentNum); |
233 | //本月新增 | 237 | //本月新增 |
... | @@ -253,6 +257,8 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi | ... | @@ -253,6 +257,8 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi |
253 | //维修计划完成月环比 | 257 | //维修计划完成月环比 |
254 | BigDecimal bigDecimal3 = new BigDecimal(repairCompleteRing).setScale(2, BigDecimal.ROUND_HALF_UP); | 258 | BigDecimal bigDecimal3 = new BigDecimal(repairCompleteRing).setScale(2, BigDecimal.ROUND_HALF_UP); |
255 | productionEquipmentVO.setRepairCompleteRingRate(bigDecimal3.toString() + "%"); | 259 | productionEquipmentVO.setRepairCompleteRingRate(bigDecimal3.toString() + "%"); |
260 | //大修技改费用 | ||
261 | productionEquipmentVO.setDxCost(dxjgCost+""); | ||
256 | //维护维修费用 | 262 | //维护维修费用 |
257 | productionEquipmentVO.setRepairMaintainCost(JSUtils.divide(totalCost,10000)); | 263 | productionEquipmentVO.setRepairMaintainCost(JSUtils.divide(totalCost,10000)); |
258 | //维修费用 | 264 | //维修费用 | ... | ... |
... | @@ -45,4 +45,8 @@ public class ProductionEquipmentVO { | ... | @@ -45,4 +45,8 @@ public class ProductionEquipmentVO { |
45 | private String repairCost; | 45 | private String repairCost; |
46 | //维修费用 | 46 | //维修费用 |
47 | private String maintainCost; | 47 | private String maintainCost; |
48 | |||
49 | //大修费用 | ||
50 | private String dxCost; | ||
51 | |||
48 | } | 52 | } | ... | ... |
-
请 注册 或 登录 后发表评论