shudonghui 1 жил өмнө
parent
commit
4fbda8eded

+ 1 - 4
sop-api/src/main/java/com/qmth/sop/server/api/ServiceAnalyseController.java

@@ -137,7 +137,7 @@ public class ServiceAnalyseController {
                                @ApiParam(value = "大区", required = true) @RequestParam Long regionId) {
         Map<String, Object> map = new HashMap<>();
         map.put("projectRoleQuota", serviceAnalyseService.findCrmAllocationSubTotal(serviceUnitId, regionId, null));
-        List<UserArchivesAllocationResult> crmAllocation = serviceAnalyseService.findCrmAllocation(serviceUnitId, regionId, supplierId);
+        List<UserArchivesAllocationResult> crmAllocation = serviceAnalyseService.findCrmAllocation(serviceUnitId, regionId, null);
         map.put("projectWait", crmAllocation.stream().filter(e -> e.getDistributed() < e.getQuota()).count());
         map.put("regionCities", crmAllocation.stream().filter(e -> e.getCity() != null).collect(Collectors.groupingBy(UserArchivesAllocationResult::getCity)).size());
         return ResultUtil.ok(map);
@@ -158,9 +158,7 @@ public class ServiceAnalyseController {
 // 使用DecimalFormat格式化浮点数结果,得到字符串形式的结果
         String formattedResult = decimalFormat.format(result);
 // 输出格式化后的结果
-        System.out.println(formattedResult);
         return ResultUtil.success(formattedResult);
-//        return ResultUtil.ok(crmAllocation.isEmpty() ? 0.00 : crmAllocation.stream().filter(e -> e.getUnDistributed()<=0).count() / crmAllocation.size());
     }
 
     /**
@@ -179,7 +177,6 @@ public class ServiceAnalyseController {
 // 使用DecimalFormat格式化浮点数结果,得到字符串形式的结果
         String formattedResult = decimalFormat.format(result);
 // 输出格式化后的结果
-        System.out.println(formattedResult);
         return ResultUtil.success(formattedResult);
     }
 

+ 2 - 4
sop-business/src/main/resources/mapper/ServiceAnalyseMapper.xml

@@ -25,12 +25,10 @@
     </select>
     <select id="equipmentOutboundTotal" resultType="java.lang.Integer">
         SELECT
-        sum(case when io.type='OUT' then 1 else 0 end )-sum(case when io.type='IN' then 1 else 0 end ) OUTS
+        IFNULL(sum( CASE WHEN io.type = 'OUT' THEN 1 ELSE 0 END )- sum( CASE WHEN io.type = 'IN' THEN 1 ELSE 0 END ) ,0) OUTS
         FROM
-        sys_device d
-        LEFT JOIN t_b_device_in_out io ON d.device_code = io.device_no
+        t_b_device_in_out io
         <where>
-            and d.bound = 'OUT'
             <if test="serviceUnitId != null and serviceUnitId != ''">
                 and io.service_id = #{serviceUnitId}
             </if>