|
@@ -2,9 +2,13 @@ package com.fdkankan.ucenter.service.impl;
|
|
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.fdkankan.ucenter.entity.Product;
|
|
|
+import com.fdkankan.ucenter.entity.SceneCooperation;
|
|
|
+import com.fdkankan.ucenter.entity.SceneCooperationCount;
|
|
|
import com.fdkankan.ucenter.mapper.IProductMapper;
|
|
|
import com.fdkankan.ucenter.service.IProductService;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import com.fdkankan.ucenter.service.ISceneCooperationCountService;
|
|
|
+import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.util.List;
|
|
@@ -20,6 +24,8 @@ import java.util.List;
|
|
|
@Service
|
|
|
public class ProductServiceImpl extends ServiceImpl<IProductMapper, Product> implements IProductService {
|
|
|
|
|
|
+ @Autowired
|
|
|
+ ISceneCooperationCountService sceneCooperationCountService;
|
|
|
@Override
|
|
|
public Product getByKey(String key) {
|
|
|
LambdaQueryWrapper<Product> wrapper = new LambdaQueryWrapper<>();
|
|
@@ -30,4 +36,13 @@ public class ProductServiceImpl extends ServiceImpl<IProductMapper, Product> imp
|
|
|
}
|
|
|
return list.get(0);
|
|
|
}
|
|
|
+
|
|
|
+ @Override
|
|
|
+ public Integer getFreeCount(String num) {
|
|
|
+ SceneCooperationCount byNum = sceneCooperationCountService.getByNum(num);
|
|
|
+ if(byNum == null){
|
|
|
+ return 1;
|
|
|
+ }
|
|
|
+ return byNum.getCount();
|
|
|
+ }
|
|
|
}
|