Sfoglia il codice sorgente

威派格项目同步接口增加调用限制

Min 11 mesi fa
parent
commit
c21eb0f253

+ 1 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/mapper/BusinessOpportunityMapper.java

@@ -33,5 +33,5 @@ public interface BusinessOpportunityMapper extends BaseMapper<BusinessOpportunit
 
     Map<String, Object> getDataSummary(Integer companyId, String startDate, String endDate, String userId,@Param("list") List<String> targetUserIds);
 
-    Map<String, Object> getDataStage(Integer companyId, String startDate, String endDate, String userId,@Param("list") List<String> targetUserIds);
+    List<Map<String, Object>> getDataStage(Integer companyId, String startDate, String endDate, String userId,@Param("list") List<String> targetUserIds);
 }

+ 1 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/BusinessOpportunityService.java

@@ -57,7 +57,7 @@ public interface BusinessOpportunityService extends IService<BusinessOpportunity
 
     Map<String, Object> getDataSummary(Integer companyId, String startDate, String endDate, String userId,List<String> targetUserIds);
 
-    Map<String, Object> getDataStage(Integer companyId, String startDate, String endDate, String userId,List<String> targetUserIds);
+    List<Map<String, Object>> getDataStage(Integer companyId, String startDate, String endDate, String userId,List<String> targetUserIds);
 
     void deleterDelete(List<Integer> ids);
 }

+ 1 - 1
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/BusinessOpportunityServiceImpl.java

@@ -371,7 +371,7 @@ public class BusinessOpportunityServiceImpl extends ServiceImpl<BusinessOpportun
     }
 
     @Override
-    public Map<String, Object> getDataStage(Integer companyId, String startDate, String endDate, String userId, List<String> targetUserIds) {
+    public List<Map<String, Object>> getDataStage(Integer companyId, String startDate, String endDate, String userId, List<String> targetUserIds) {
         return bOMapper.getDataStage(companyId,startDate,endDate,userId,targetUserIds);
     }
 

+ 9 - 7
fhKeeper/formulahousekeeper/management-crm/src/main/java/com/management/platform/service/impl/SalesOrderServiceImpl.java

@@ -567,7 +567,7 @@ public class SalesOrderServiceImpl extends ServiceImpl<SalesOrderMapper, SalesOr
         int contactsCount = contactsService.count(contactsLambdaQueryWrapper);
         int businessOpportunityCount = businessOpportunityService.count(businessOpportunityLambdaQueryWrapper);
         List<BusinessOpportunity> businessOpportunityList = businessOpportunityService.list(businessOpportunityLambdaQueryWrapper);
-        double businessOpportunityPrice = businessOpportunityList.stream().mapToDouble(b -> Double.valueOf(b.getAmountOfMoney())).sum();
+        double businessOpportunityPrice = businessOpportunityList.stream().filter(b->!StringUtils.isEmpty(b.getAmountOfMoney())).mapToDouble(b ->Double.valueOf(b.getAmountOfMoney())).sum();
         Integer salesOrderCount = salesOrderMapper.selectCount(salesOrderLambdaQueryWrapper);
         List<SalesOrder> salesOrders = salesOrderMapper.selectList(salesOrderLambdaQueryWrapper);
         double salesOrdersPrice = salesOrders.stream().mapToDouble(s -> s.getPrice().doubleValue()).sum();
@@ -577,7 +577,7 @@ public class SalesOrderServiceImpl extends ServiceImpl<SalesOrderMapper, SalesOr
         int contactsCount1 = contactsService.count(contactsLambdaQueryWrapper1);
         int businessOpportunityCount1 = businessOpportunityService.count(businessOpportunityLambdaQueryWrapper1);
         List<BusinessOpportunity> businessOpportunityList1 = businessOpportunityService.list(businessOpportunityLambdaQueryWrapper1);
-        double businessOpportunityPrice1 = businessOpportunityList1.stream().mapToDouble(b -> Double.valueOf(b.getAmountOfMoney())).sum();
+        double businessOpportunityPrice1 = businessOpportunityList1.stream().filter(b->!StringUtils.isEmpty(b.getAmountOfMoney())).mapToDouble(b -> Double.valueOf(b.getAmountOfMoney())).sum();
         Integer salesOrderCount1 = salesOrderMapper.selectCount(salesOrderLambdaQueryWrapper1);
         List<SalesOrder> salesOrders1 = salesOrderMapper.selectList(salesOrderLambdaQueryWrapper1);
         double salesOrdersPrice1 = salesOrders1.stream().mapToDouble(s -> s.getPrice().doubleValue()).sum();
@@ -594,16 +594,18 @@ public class SalesOrderServiceImpl extends ServiceImpl<SalesOrderMapper, SalesOr
         businessOpportunityMap.put("businessOpportunityCount",businessOpportunityCount);
         businessOpportunityMap.put("businessOpportunityPromote",getPromote(businessOpportunityCount,businessOpportunityCount1));
         resultMap.put("businessOpportunity",businessOpportunityMap);
+        Map<String,Object> businessOpportunityPriceMap=new HashMap<>();
+        businessOpportunityPriceMap.put("businessOpportunityPrice",businessOpportunityPrice);
+        businessOpportunityPriceMap.put("businessOpportunityPromote",getPromote((int)businessOpportunityPrice,(int)businessOpportunityPrice1));
+        resultMap.put("businessOpportunityPrice",businessOpportunityPriceMap);
         Map<String,Object> salesOrderMap=new HashMap<>();
         salesOrderMap.put("salesOrderCount",salesOrderCount);
         salesOrderMap.put("salesOrderPromote",getPromote(salesOrderCount,salesOrderCount1));
+        resultMap.put("salesOrder",salesOrderMap);
         Map<String,Object> salesOrderPriceMap=new HashMap<>();
         salesOrderPriceMap.put("salesOrdersPrice",salesOrdersPrice);
         salesOrderPriceMap.put("salesOrderPricePromote",getPromote((int)salesOrdersPrice,(int)salesOrdersPrice1));
-        Map<String,Object> businessOpportunityPriceMap=new HashMap<>();
-        businessOpportunityPriceMap.put("businessOpportunityPrice",businessOpportunityPrice);
-        businessOpportunityPriceMap.put("businessOpportunityPromote",getPromote((int)businessOpportunityPrice,(int)businessOpportunityPrice1));
-        resultMap.put("salesOrder",salesOrderMap);
+        resultMap.put("salesOrdersPrice",salesOrderPriceMap);
         Map<String,Object> clueMap=new HashMap<>();
         clueMap.put("clueCount",clueCount);
         clueMap.put("cluePromote",getPromote(clueCount,clueCount1));
@@ -761,7 +763,7 @@ public class SalesOrderServiceImpl extends ServiceImpl<SalesOrderMapper, SalesOr
                     targetUserIds=targetUserIds2;
             }
         }
-        Map<String,Object> dataMap=businessOpportunityService.getDataStage(companyId,startDate,endDate,userId,targetUserIds);
+        List<Map<String,Object>> dataMap=businessOpportunityService.getDataStage(companyId,startDate,endDate,userId,targetUserIds);
         Map<String,Object> resultMap=new HashMap<>();
         resultMap.put("dataMap",dataMap);
         msg.setData(resultMap);

+ 1 - 0
fhKeeper/formulahousekeeper/management-platform/src/main/java/com/management/platform/controller/ProjectController.java

@@ -1193,6 +1193,7 @@ public class ProjectController {
 
     //todo 同步项目相关数据
     @RequestMapping("/synchronizationProject")
+    @LimitRequest(count = 1,time = 1000)
     public HttpRespMsg synchronizationProject(@RequestBody String dataJson){
         return projectService.synchronizationProject(dataJson);
     }