|
@@ -405,6 +405,21 @@ 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) {
|
|
|
+ Integer totalCount = 0;
|
|
|
+ if(StringUtils.isBlank(sceneType)){
|
|
|
+ totalCount += getTotalCount(numList,users,"mesh",cameraId);
|
|
|
+ totalCount += getTotalCount(numList,users,"laser",cameraId);
|
|
|
+ }else {
|
|
|
+ totalCount += getTotalCount(numList,users,sceneType,cameraId);
|
|
|
+ }
|
|
|
+ if(totalCount <=0){
|
|
|
+ return null;
|
|
|
+ }
|
|
|
+ return productOrderService.createOrder(totalCount, "cooperation", loginUser, payType, timeZone,cameraId,lang,sceneType);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ private Integer getTotalCount(List<String> numList, List<User> users,String sceneType,Long cameraId){
|
|
|
List<SceneCooperationCount> freeCountList = sceneCooperationCountService.getByNumList(numList,sceneType);
|
|
|
HashMap<String,Integer> freeMap = new HashMap<>();
|
|
|
for (SceneCooperationCount count : freeCountList) {
|
|
@@ -432,11 +447,7 @@ public class SceneCooperationServiceImpl extends ServiceImpl<ISceneCooperationMa
|
|
|
totalCount += (users.size() - freeCount );
|
|
|
|
|
|
}
|
|
|
- if(totalCount <=0){
|
|
|
- return null;
|
|
|
- }
|
|
|
- return productOrderService.createOrder(totalCount, "cooperation", loginUser, payType, timeZone,cameraId,lang,sceneType);
|
|
|
-
|
|
|
+ return totalCount;
|
|
|
}
|
|
|
|
|
|
@Autowired
|