余额开关根据模块影响
This commit is contained in:
@@ -61,7 +61,7 @@ public class FreeDineConfigServiceImpl extends ServiceImpl<FreeDineConfigMapper,
|
||||
config.setShopIdList(JSONArray.toJSONString(freeDineConfigEditDTO.getShopIdList()));
|
||||
}
|
||||
|
||||
shopConfigService.editStatusByShopIdList(config.getShopId(), freeDineConfigEditDTO.getEnable() ? 1 : 0, ShopConfig::getIsAccountPay, freeDineConfigEditDTO.getUseShopType(), freeDineConfigEditDTO.getShopIdList());
|
||||
shopConfigService.editStatusByShopIdList(config.getShopId(), freeDineConfigEditDTO.getEnable() ? 1 : 0,true, ShopConfig::getIsAccountPay, freeDineConfigEditDTO.getUseShopType(), freeDineConfigEditDTO.getShopIdList());
|
||||
if (freeDineConfigEditDTO.getUseType() != null) {
|
||||
config.setUseType(JSONObject.toJSONString(freeDineConfigEditDTO.getUseType()));
|
||||
}
|
||||
|
||||
@@ -41,7 +41,7 @@ public class ShopConfigServiceImpl extends ServiceImpl<ShopConfigMapper, ShopCon
|
||||
|
||||
|
||||
@Override
|
||||
public <T> void editStatusByShopIdList(Long mainShopId, Integer isEnable, LambdaGetter<T> property, String useShopType, List<Long> shopIdList) {
|
||||
public <T> void editStatusByShopIdList(Long mainShopId, Integer isEnable, boolean onyUpValid, LambdaGetter<T> property, String useShopType, List<Long> shopIdList) {
|
||||
ShopConfig shopConfig = getOne(new QueryWrapper().eq(ShopConfig::getId, mainShopId));
|
||||
if (shopConfig == null) {
|
||||
shopConfig = new ShopConfig();
|
||||
@@ -56,7 +56,7 @@ public class ShopConfigServiceImpl extends ServiceImpl<ShopConfigMapper, ShopCon
|
||||
});
|
||||
}
|
||||
|
||||
if (isEnable == 0) {
|
||||
if (isEnable == 0 && !onyUpValid) {
|
||||
updateChain().or(or -> {
|
||||
or.eq(ShopConfig::getMainId, mainShopId);
|
||||
}).or(or -> {
|
||||
@@ -73,7 +73,9 @@ public class ShopConfigServiceImpl extends ServiceImpl<ShopConfigMapper, ShopCon
|
||||
if (shopIdList.isEmpty()) {
|
||||
updateChain().eq(ShopConfig::getMainId, mainShopId).set(property, 1).update();
|
||||
}else {
|
||||
updateChain().notIn(ShopConfig::getId, shopIdList).set(property, 0).update();
|
||||
if (!onyUpValid) {
|
||||
updateChain().notIn(ShopConfig::getId, shopIdList).set(property, 0).update();
|
||||
}
|
||||
updateChain().in(ShopConfig::getId, shopIdList).set(property, 1).update();
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user