瀏覽代碼

Merge branch '20210223' of http://114.135.61.188:53000/UIMS/Code into 20210223

wangbo 4 年之前
父節點
當前提交
157e231557

+ 5 - 3
operation_manager/src/main/resources/mapper/order/WorkOrderManageMapper.xml

@@ -515,11 +515,13 @@
     order by send_time desc
   </select>
   <select id="selectAppAll" resultMap="BaseResultMap">
-    select id,task_no,send_time,address,order_type_id,current_task_name,create_by,update_by,task_desc,order_status
-    from sc_work_order_manage
+    select distinct t1.id,task_no,send_time,address,order_type_id,current_task_name,t1.create_by,t1.update_by,task_desc,order_status
+    from sc_work_order_manage t1
+    left join sc_work_flow_log t2 ON t1.id=t2.flow_id and flow_type=2 and find_in_set(#{userId},handle_user_id) and left(flow_result,2)='拒单'
     where (find_in_set(#{userId},current_users)
-     or id in(select flow_id from sc_work_flow_log where flow_type=2 and find_in_set(#{userId},handle_user_id)))
+     or t1.id in(select flow_id from sc_work_flow_log where flow_type=2 and find_in_set(#{userId},handle_user_id)))
      and tenant_id = #{tenantId}
+     and (t2.id is null or t1.order_user_id=t2.handle_user_id)
     union
     select id,plan_id,plan_date,task_area_name,task_type,current_task_name,create_by,update_by,task_content,plan_status
     from sc_plan_manage

+ 8 - 19
sms_water/src/main/java/com/huaxu/controller/ComDisplayController.java

@@ -21,6 +21,7 @@ import org.springframework.web.bind.annotation.RequestMethod;
 import org.springframework.web.bind.annotation.RequestParam;
 import org.springframework.web.bind.annotation.RestController;
 
+import java.math.BigDecimal;
 import java.time.LocalDateTime;
 import java.util.ArrayList;
 import java.util.HashMap;
@@ -161,16 +162,10 @@ public class ComDisplayController {
             item.setCompanyOrgName(orgInfoUtil.getOrgName(item.getCompanyOrgId()));
             Double waterUsage = item.getWaterUsage() != null ? item.getWaterUsage() : 0d;//售水量
             //查询子公司的取水量、制水量 产销差(制水量-售水量)/制水量  X 100%
-            ComdisplayInfoDto comdisplayInfoDto= comdisplayMapLocationService.selectMapDataForCompany(Long.valueOf(item.getCompanyOrgId()),null);
-            if(comdisplayInfoDto!=null)
-            {
-                item.setIntakeWaterUsage(comdisplayInfoDto.getIntakeWaterUsage() != null ? (double) Math.round(comdisplayInfoDto.getIntakeWaterUsage() / (float) 100) / 100 : 0);
-                item.setYieldWaterUsage(comdisplayInfoDto.getYieldWaterUsage() != null ? (double) Math.round(comdisplayInfoDto.getYieldWaterUsage() / (float) 100) / 100 : 0);
-                if(comdisplayInfoDto.getYieldWaterUsage()!=null&&comdisplayInfoDto.getYieldWaterUsage()>0d)
-                {
-                    item.setWaterFeeRecoveryRate(Double.valueOf(Math.round(((comdisplayInfoDto.getYieldWaterUsage()-waterUsage)/comdisplayInfoDto.getYieldWaterUsage())*100)));
-                }
-            }
+            //查询子公司的取水量、制水量 产销差(制水量-售水量)/制水量  X 100%
+            item.setIntakeWaterUsage(monitorDataReportService.getAmountCount(item.getCompanyOrgId(), null, "水源", 4, 2).divide(new BigDecimal("10000"),3,BigDecimal.ROUND_HALF_UP).doubleValue());
+            item.setYieldWaterUsage(monitorDataReportService.getAmountCount(item.getCompanyOrgId(), null, "水厂", 3, 2).divide(new BigDecimal("10000"),3,BigDecimal.ROUND_HALF_UP).doubleValue());
+            item.setWaterFeeRecoveryRate(Double.valueOf(Math.round(((receFee.get(0).getYieldWaterUsage() - waterUsage) / receFee.get(0).getYieldWaterUsage()) * 100)));
         }
         return new AjaxMessage<>(ResultStatus.OK, receFee);
     }
@@ -183,15 +178,9 @@ public class ComDisplayController {
             receFee.get(0).setCompanyOrgName(orgInfoUtil.getOrgName(receFee.get(0).getCompanyOrgId()));
             Double waterUsage = receFee.get(0).getWaterUsage() != null ? receFee.get(0).getWaterUsage() : 0d;//售水量
             //查询子公司的取水量、制水量 产销差(制水量-售水量)/制水量  X 100%
-            ComdisplayInfoDto comdisplayInfoDto = comdisplayMapLocationService.selectMapDataForCompany(Long.valueOf(receFee.get(0).getCompanyOrgId()),null);
-
-            if (comdisplayInfoDto != null) {
-                receFee.get(0).setIntakeWaterUsage(comdisplayInfoDto.getIntakeWaterUsage() != null ? (double) Math.round(comdisplayInfoDto.getIntakeWaterUsage() / (float) 100) / 100 : 0);
-                receFee.get(0).setYieldWaterUsage(comdisplayInfoDto.getYieldWaterUsage() != null ? (double) Math.round(comdisplayInfoDto.getYieldWaterUsage() / (float) 100) / 100 : 0);
-                if (comdisplayInfoDto.getYieldWaterUsage() != null && comdisplayInfoDto.getYieldWaterUsage() > 0d) {
-                    receFee.get(0).setWaterFeeRecoveryRate(Double.valueOf(Math.round(((comdisplayInfoDto.getYieldWaterUsage() - waterUsage) / comdisplayInfoDto.getYieldWaterUsage()) * 100)));
-                }
-            }
+            receFee.get(0).setIntakeWaterUsage(monitorDataReportService.getAmountCount(companyOrgId, null, "水源", 4, 2).divide(new BigDecimal("10000"),3,BigDecimal.ROUND_HALF_UP).doubleValue());
+            receFee.get(0).setYieldWaterUsage(monitorDataReportService.getAmountCount(companyOrgId, null, "水厂", 3, 2).divide(new BigDecimal("10000"),3,BigDecimal.ROUND_HALF_UP).doubleValue());
+            receFee.get(0).setWaterFeeRecoveryRate(Double.valueOf(Math.round(((receFee.get(0).getYieldWaterUsage() - waterUsage) / receFee.get(0).getYieldWaterUsage()) * 100)));
         }
         return new AjaxMessage<>(ResultStatus.OK, receFee.get(0));
     }