Min vor 1 Jahr
Ursprung
Commit
90ecbc676e

+ 1 - 1
fhKeeper/formulahousekeeper/management-workshop/src/main/java/com/management/platform/service/impl/ReportServiceImpl.java

@@ -4503,7 +4503,7 @@ public class ReportServiceImpl extends ServiceImpl<ReportMapper, Report> impleme
             BigDecimal planWorkTime = new BigDecimal(pt.get("planWorkTime") == null ? 0 : Double.valueOf(String.valueOf(pt.get("planWorkTime"))));
             BigDecimal nowWorkTime = new BigDecimal(pt.get("nowWorkTime") == null ? 0 : Double.valueOf(String.valueOf(pt.get("nowWorkTime"))));
             if(nowWorkTime.compareTo(BigDecimal.ZERO)!=0){
-                BigDecimal divide = nowWorkTime.divide(planWorkTime, 4, RoundingMode.HALF_UP);
+                BigDecimal divide = nowWorkTime.divide(planWorkTime, 4, BigDecimal.ROUND_HALF_UP);
                 pt.put("progress",format.format(divide.doubleValue()));
             }
         });

+ 13 - 17
fhKeeper/formulahousekeeper/management-workshop/src/main/resources/mapper/ReportMapper.xml

@@ -312,14 +312,12 @@
 
     <select id="getPlanRealTimeProgressList" resultType="java.util.Map">
         select b.id as planId,(Case when b.plan_type=0 then b.product_scheduling_num else b.task_change_notice_num end) as taskName,
-        b.foreman_name as userName,IFNULL(ROUND(SUM(d.work_time),2),0) as planWorkTime,SUM(d.job_of_money) as planCost,
-        IFNULL(SUM((select SUM(working_time) from report where user_procedure_team_id = d.id)),0)  as nowWorkTime,
-        SUM((select SUM(cost) from report where user_procedure_team_id = d.id)) as nowCost
-        from plan_procedure_total a
-        left join plan b on a.plan_id=b.id
-        left join prod_procedure c on a.prod_procedure_id=c.id
-        left join prod_procedure_team d on a.id=d.plan_procedure_id
-        left join user u on u.id=d.user_id
+        b.foreman_name as userName,IFNULL(ROUND(SUM(a.total_working_hours),2),0) as planWorkTime,IFNULL(ROUND(SUM(a.total_wages),2),0)  as planCost,
+        IFNULL(ROUND(SUM(a.`total_fill_time`),2),0) AS nowWorkTime,
+        IFNULL(ROUND(SUM(a.`total_wages`*a.`total_progress`/100),2),0) AS nowCost
+        from plan b
+        left join plan_procedure_total a on a.plan_id=b.id
+        left join user u on u.id=b.station_id
         where b.company_id=#{companyId}
         <if test="userId!=null and userId!=''">
             and d.user_id=#{userId}
@@ -348,15 +346,13 @@
 
     <select id="getPlanRealTimeProgressCount" resultType="java.lang.Integer">
         select count(1) from (
-        select (Case when b.plan_type=0 then b.product_scheduling_num else b.task_change_notice_num end) as taskName,
-        b.foreman_name as userName,SUM(d.work_time) as planWorkTime,SUM(d.job_of_money) as planCost,
-        SUM((select SUM(working_time) from report where user_procedure_team_id = d.id))  as nowWorkTime,
-        SUM((select SUM(cost) from report where user_procedure_team_id = d.id)) as nowCost
-        from plan_procedure_total a
-        left join plan b on a.plan_id=b.id
-        left join prod_procedure c on a.prod_procedure_id=c.id
-        left join prod_procedure_team d on a.id=d.plan_procedure_id
-        left join user u on u.id=d.user_id
+        select b.id as planId,(Case when b.plan_type=0 then b.product_scheduling_num else b.task_change_notice_num end) as taskName,
+        b.foreman_name as userName,IFNULL(ROUND(SUM(a.total_working_hours),2),0) as planWorkTime,IFNULL(ROUND(SUM(a.total_wages),2),0)  as planCost,
+        IFNULL(ROUND(SUM(a.`total_fill_time`),2),0) AS nowWorkTime,
+        IFNULL(ROUND(SUM(a.`total_wages`*a.`total_progress`/100),2),0) AS nowCost
+        from plan b
+        left join plan_procedure_total a on a.plan_id=b.id
+        left join user u on u.id=b.station_id
         where b.company_id=#{companyId}
         <if test="userId!=null and userId!=''">
             and d.user_id=#{userId}