Sfoglia il codice sorgente

修复划入账号随机问题

leon 4 anni fa
parent
commit
07cbdec995

+ 1 - 1
src/main/java/com/mokamrp/privates/controller/pangu/FosterwxMobileController.java

@@ -322,7 +322,7 @@ public class FosterwxMobileController extends BaseController<FosterwxMobile> {
 
     /**
      * 批量加入变现账号
-     * @param setIdsHandle
+     * @param SetIdsHandle
      * @param bindingResult
      * @return
      */

+ 6 - 1
src/main/java/com/mokamrp/privates/service/pangu/impl/FosterwxMobileServiceImpl.java

@@ -271,7 +271,12 @@ public class FosterwxMobileServiceImpl extends ServiceImpl<FosterwxMobileMapper,
                 continue;
             }
             List<FosterwxDomain> domainList = fosterwxDomainService.list(new QueryWrapper<FosterwxDomain>().eq("station_id",fosterwxMobile.getStationId()));
-            Integer rand = (int)(0+Math.random()*((domainList.size()-1)-0+1));
+            Integer rand;
+            if (domainList.size() == 1){
+                rand = 0;
+            }else{
+                rand = (int)(0+Math.random()*((domainList.size()-1)-0+1));
+            }
             FosterwxCashMobile add = new FosterwxCashMobile();
             add.setDomainId(domainList.get(rand).getId());
             add.setGroupId(setIdsHandle.getId());