Merge remote-tracking branch 'origin/master'
正在显示
3 个修改的文件
包含
14 行增加
和
10 行删除
... | @@ -10,14 +10,15 @@ | ... | @@ -10,14 +10,15 @@ |
10 | emt.end_time AS endTime, | 10 | emt.end_time AS endTime, |
11 | emt.start_time AS startTime, | 11 | emt.start_time AS startTime, |
12 | emt.depart_id, | 12 | emt.depart_id, |
13 | (select depart_name from sys_depart where id=emt.depart_id) AS depart_name, | 13 | (select depart_name from sys_depart where id = emt.depart_id) AS depart_name, |
14 | emt.maintain_plan_name AS maintainPlanName, | 14 | emt.maintain_plan_name AS maintainPlanName, |
15 | emt.maintain_mode AS maintainMode, | 15 | emt.maintain_mode AS maintainMode, |
16 | emt.maintain_level AS maintainLevel, | 16 | emt.maintain_level AS maintainLevel, |
17 | emt.maintainer_id AS maintainerId, | 17 | emt.maintainer_id AS maintainerId, |
18 | (select realname from sys_user where id=emt.maintainer_id) AS maintainerName, | 18 | (select realname from sys_user where id = emt.maintainer_id) AS maintainerName, |
19 | emt.maintain_time AS maintainTime, | 19 | emt.maintain_time AS maintainTime, |
20 | emt.plan_id AS planId, | 20 | emt.plan_id AS planId, |
21 | emt.maintenance_cost AS maintenanceCost, | ||
21 | emt.real_start_time AS realStartTime, | 22 | emt.real_start_time AS realStartTime, |
22 | emt.real_end_time AS realEndTime, | 23 | emt.real_end_time AS realEndTime, |
23 | emt.working_hours AS workingHours, | 24 | emt.working_hours AS workingHours, |
... | @@ -36,7 +37,7 @@ | ... | @@ -36,7 +37,7 @@ |
36 | LEFT JOIN equipment_maintain_plan emp ON emp.id=emt.plan_id | 37 | LEFT JOIN equipment_maintain_plan emp ON emp.id=emt.plan_id |
37 | LEFT JOIN equipment_info ei ON ei.id=emt.equipment_id | 38 | LEFT JOIN equipment_info ei ON ei.id=emt.equipment_id |
38 | <where> | 39 | <where> |
39 | emt. del_flag=0 and emt.start_time <=now() | 40 | emt.del_flag=0 and emt.start_time <=now() |
40 | <if test="equipmentMaintainTask.planArrangerId !=null and equipmentMaintainTask.planArrangerId!='' and equipmentMaintainTask.getType==0"> | 41 | <if test="equipmentMaintainTask.planArrangerId !=null and equipmentMaintainTask.planArrangerId!='' and equipmentMaintainTask.getType==0"> |
41 | AND (emt.maintainer_id = #{equipmentMaintainTask.planArrangerId} or (emp.plan_accepter_id= #{equipmentMaintainTask.planArrangerId})) | 42 | AND (emt.maintainer_id = #{equipmentMaintainTask.planArrangerId} or (emp.plan_accepter_id= #{equipmentMaintainTask.planArrangerId})) |
42 | AND results_enforcement!='4' | 43 | AND results_enforcement!='4' |
... | @@ -95,7 +96,7 @@ | ... | @@ -95,7 +96,7 @@ |
95 | </if> | 96 | </if> |
96 | </where> | 97 | </where> |
97 | <!-- order by emt.depart_id desc , ei.equipment_name asc ,ei.structures asc --> | 98 | <!-- order by emt.depart_id desc , ei.equipment_name asc ,ei.structures asc --> |
98 | order BY emt.depart_id asc , ei.equipment_name asc , emt.start_time desc | 99 | order BY emt.depart_id asc,ei.equipment_name asc,emt.start_time desc |
99 | </select> | 100 | </select> |
100 | <update id="updateResultsEnforcement"> | 101 | <update id="updateResultsEnforcement"> |
101 | update equipment_maintain_task | 102 | update equipment_maintain_task | ... | ... |
... | @@ -840,9 +840,9 @@ | ... | @@ -840,9 +840,9 @@ |
840 | SELECT t.MONTH AS month, | 840 | SELECT t.MONTH AS month, |
841 | ( | 841 | ( |
842 | SELECT | 842 | SELECT |
843 | IFNULL(sum(etc.material_cost+etc.maintenance_cost+etc.labor_cost+etc.machinery_cost+etc.service_cost+etc.wastage_cost+etc.other_cost),0) | 843 | IFNULL(sum(emt.maintenance_cost),0) |
844 | FROM | 844 | FROM |
845 | equipment_maintain_task emt LEFT JOIN equipment_task_cost etc ON etc.task_id=emt.id | 845 | equipment_maintain_task emt |
846 | WHERE | 846 | WHERE |
847 | LEFT ( emt.maintain_time, 7 ) = t.MONTH AND emt.del_flag = 0 and emt.depart_id in(${departIds}) | 847 | LEFT ( emt.maintain_time, 7 ) = t.MONTH AND emt.del_flag = 0 and emt.depart_id in(${departIds}) |
848 | ) AS maintainCost, | 848 | ) AS maintainCost, |
... | @@ -871,9 +871,9 @@ | ... | @@ -871,9 +871,9 @@ |
871 | SELECT t.MONTH AS month, | 871 | SELECT t.MONTH AS month, |
872 | ( | 872 | ( |
873 | SELECT | 873 | SELECT |
874 | IFNULL(sum(etc.material_cost+etc.maintenance_cost+etc.labor_cost+etc.machinery_cost+etc.service_cost+etc.wastage_cost+etc.other_cost),0) | 874 | IFNULL(sum(emt.maintenance_cost),0) |
875 | FROM | 875 | FROM |
876 | equipment_maintain_task emt LEFT JOIN equipment_task_cost etc ON etc.task_id=emt.id | 876 | equipment_maintain_task emt |
877 | WHERE | 877 | WHERE |
878 | LEFT ( emt.maintain_time, 7 ) = t.MONTH AND emt.del_flag = 0 and emt.depart_id in(${departIds}) | 878 | LEFT ( emt.maintain_time, 7 ) = t.MONTH AND emt.del_flag = 0 and emt.depart_id in(${departIds}) |
879 | ) AS maintainCost, | 879 | ) AS maintainCost, |
... | @@ -902,8 +902,8 @@ | ... | @@ -902,8 +902,8 @@ |
902 | <select id="getContrastCostDetails" resultType="java.util.Map"> | 902 | <select id="getContrastCostDetails" resultType="java.util.Map"> |
903 | select d.id depart_id , d.depart_name ,ifnull(aaa.maintainCost,0) maintainCost,ifnull(bbb.repairCost,0) repairCost from sys_depart d | 903 | select d.id depart_id , d.depart_name ,ifnull(aaa.maintainCost,0) maintainCost,ifnull(bbb.repairCost,0) repairCost from sys_depart d |
904 | left join ( | 904 | left join ( |
905 | SELECT emt.depart_id , IFNULL(sum(etc.material_cost+etc.maintenance_cost+etc.labor_cost+etc.machinery_cost+etc.service_cost+etc.wastage_cost+etc.other_cost),0) maintainCost | 905 | SELECT emt.depart_id , IFNULL(sum(emt.maintenance_cost),0) maintainCost |
906 | FROM equipment_maintain_task emt LEFT JOIN equipment_task_cost etc ON etc.task_id=emt.id | 906 | FROM equipment_maintain_task emt |
907 | WHERE emt.del_flag = 0 and emt.maintain_time >= #{startTime} and emt.maintain_time <= #{endTime} | 907 | WHERE emt.del_flag = 0 and emt.maintain_time >= #{startTime} and emt.maintain_time <= #{endTime} |
908 | group by emt.depart_id | 908 | group by emt.depart_id |
909 | ) aaa on aaa.depart_id = d.id | 909 | ) aaa on aaa.depart_id = d.id | ... | ... |
... | @@ -536,6 +536,8 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi | ... | @@ -536,6 +536,8 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi |
536 | v = DoubleOperaUtils.bigDecimalRound((increase * 30 - downtime) / (increase * 30), 2)*100; | 536 | v = DoubleOperaUtils.bigDecimalRound((increase * 30 - downtime) / (increase * 30), 2)*100; |
537 | } | 537 | } |
538 | contrastVO.setMonth(month); | 538 | contrastVO.setMonth(month); |
539 | //增加v的值不能为负数逻辑 | ||
540 | if (v < 0) { v = 0.00; } | ||
539 | contrastVO.setRepairNum(v + "%"); | 541 | contrastVO.setRepairNum(v + "%"); |
540 | yearOnYear.forEach(y -> { | 542 | yearOnYear.forEach(y -> { |
541 | String lastYear1 = (String) y.get("lastYear"); | 543 | String lastYear1 = (String) y.get("lastYear"); |
... | @@ -547,6 +549,7 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi | ... | @@ -547,6 +549,7 @@ public class ProductionEquipmentServiceImpl implements IProductionEquipmentServi |
547 | if (increase1 > 0) { | 549 | if (increase1 > 0) { |
548 | v1 = DoubleOperaUtils.bigDecimalRound((increase1 * 30 - downtime1) / (increase1 * 30),2)*100; | 550 | v1 = DoubleOperaUtils.bigDecimalRound((increase1 * 30 - downtime1) / (increase1 * 30),2)*100; |
549 | } | 551 | } |
552 | if (v1 < 0) { v1 = 0.00; } | ||
550 | contrastVO.setMaintainNum(v1 + "%"); | 553 | contrastVO.setMaintainNum(v1 + "%"); |
551 | } | 554 | } |
552 | }); | 555 | }); | ... | ... |
-
请 注册 或 登录 后发表评论