lyhzzz il y a 5 mois
Parent
commit
8c4cdfcaa3

+ 1 - 1
src/main/java/com/fdkankan/ucenter/service/IProductCooperationService.java

@@ -19,7 +19,7 @@ import java.util.List;
  */
 public interface IProductCooperationService extends IService<ProductCooperation> {
 
-    void add(ProductOrder productOrder, List<User> users, List<String>numList1, HashMap<Long,String> map1, HashMap<Long,String> map2, String sceneType);
+    void add(ProductOrder productOrder, List<User> users, List<String>numList1, HashMap<String,String> map1, HashMap<String,String> map2, String sceneType);
 
     void paySuccess(String orderSn);
 }

+ 3 - 3
src/main/java/com/fdkankan/ucenter/service/impl/ProductCooperationServiceImpl.java

@@ -33,7 +33,7 @@ public class ProductCooperationServiceImpl extends ServiceImpl<IProductCooperati
     IProductOrderService productOrderService;
 
     @Override
-    public void add(ProductOrder productOrder, List<User> users,List<String> list , HashMap<Long,String> map1, HashMap<Long,String> map2, String sceneType) {
+    public void add(ProductOrder productOrder, List<User> users,List<String> list , HashMap<String,String> map1, HashMap<String,String> map2, String sceneType) {
 
         if(StringUtils.isBlank(sceneType)){
             this.saveList(productOrder,users,list,map1,"mesh");
@@ -44,7 +44,7 @@ public class ProductCooperationServiceImpl extends ServiceImpl<IProductCooperati
 
     }
 
-    private void saveList(ProductOrder productOrder, List<User> users,List<String> list ,  HashMap<Long,String> map1,String sceneType){
+    private void saveList(ProductOrder productOrder, List<User> users,List<String> list ,  HashMap<String,String> map1,String sceneType){
         List<ProductCooperation> productCooperations = new ArrayList<>();
 
         for (String num : list) {
@@ -54,7 +54,7 @@ public class ProductCooperationServiceImpl extends ServiceImpl<IProductCooperati
                 productCooperation.setCooperationUserId(user.getId());
                 productCooperation.setNum(num);
                 productCooperation.setSceneType(sceneType);
-                if(map1.get(user.getId()) != null){
+                if(map1.get(user.getId()+","+num) != null){
                     productCooperation.setNeedPay(1);
                 }
                 productCooperations.add(productCooperation);

+ 5 - 5
src/main/java/com/fdkankan/ucenter/service/impl/SceneCooperationServiceImpl.java

@@ -396,8 +396,8 @@ public class SceneCooperationServiceImpl extends ServiceImpl<ISceneCooperationMa
 
 
     private ProductOrder checkNeedPay(List<String> numList, List<User> users,User loginUser,Integer payType,Integer timeZone,Long cameraId,String lang,String sceneType) {
-        HashMap<Long,String> needNumListMesh = new HashMap<>();
-        HashMap<Long,String> needNumListLaser =new HashMap<>();
+        HashMap<String,String> needNumListMesh = new HashMap<>();
+        HashMap<String,String> needNumListLaser =new HashMap<>();
         if(StringUtils.isBlank(sceneType)){
             needNumListMesh = getTotalCount(numList,users,"mesh",cameraId);
             needNumListLaser =  getTotalCount(numList,users,"laser",cameraId);
@@ -413,13 +413,13 @@ public class SceneCooperationServiceImpl extends ServiceImpl<ISceneCooperationMa
 
     }
 
-    private HashMap<Long,String> getTotalCount(List<String> numList, List<User> users,String sceneType,Long cameraId){
+    private HashMap<String,String> getTotalCount(List<String> numList, List<User> users,String sceneType,Long cameraId){
         List<SceneCooperationCount> freeCountList = sceneCooperationCountService.getByNumList(numList,sceneType);
         HashMap<String,Integer> freeMap = new HashMap<>();
         freeCountList.forEach(e -> freeMap.put(e.getNum(),e.getCount()));
 
         HashMap<String, List<User>> map = this.getByNumList(numList,sceneType);
-        HashMap<Long,String> needNumList = new HashMap<>();
+        HashMap<String,String> needNumList = new HashMap<>();
         for (String num : numList) {
             Integer freeCount = freeMap.get(num) == null ? 1 :freeMap.get(num);
 
@@ -433,7 +433,7 @@ public class SceneCooperationServiceImpl extends ServiceImpl<ISceneCooperationMa
             }
 
             for (int i = 0 ; i< users.size() -freeCount;i++){
-                needNumList.put(users.get(i).getId(),num);
+                needNumList.put(users.get(i).getId()+","+num,num);
             }
 
         }