This commit is contained in:
cun-nan 2024-06-12 11:16:37 +08:00
parent 12a790ab9a
commit c309d2bf72
3 changed files with 4 additions and 5 deletions

View File

@ -60,7 +60,7 @@ public class OilConfigController extends BaseController {
int result = 2; int result = 2;
// isOpen=1开启规则 // isOpen=1开启规则
if (isOpen.equals("1")){ if (isOpen.equals("1")){
result = oilConfigService.judgmentProportion(); result = oilConfigService.judgmentProportion(storeId);
if (result==1){ if (result==1){
oilConfigService.oilRule(storeId); oilConfigService.oilRule(storeId);
// 开启定时关闭规则 // 开启定时关闭规则

View File

@ -19,7 +19,7 @@ public interface OilConfigService extends IService<OilConfig> {
* 判断占比相加是否为100% 是返回1 不是返回0 * 判断占比相加是否为100% 是返回1 不是返回0
* @return * @return
*/ */
public int judgmentProportion(); public int judgmentProportion(Integer storeId);
/** /**
* 规则周期是否为当日 * 规则周期是否为当日

View File

@ -68,12 +68,11 @@ public class OilConfigServiceImpl extends ServiceImpl<OilConfigMapper, OilConfig
} }
@Override @Override
public int judgmentProportion() { public int judgmentProportion(Integer storeId) {
int result = 0; int result = 0;
int percentage = 0; int percentage = 0;
AccountInfo nowAccountInfo = TokenUtil.getNowAccountInfo();
QueryWrapper queryWrapper = new QueryWrapper<>(); QueryWrapper queryWrapper = new QueryWrapper<>();
queryWrapper.eq("store_id",nowAccountInfo.getStoreId()); queryWrapper.eq("store_id",storeId);
List<OilConfig> list = baseMapper.selectList(queryWrapper); List<OilConfig> list = baseMapper.selectList(queryWrapper);
for (OilConfig config : list) { for (OilConfig config : list) {
percentage += config.getProportion(); percentage += config.getProportion();