Merge remote-tracking branch 'origin/test' into test

This commit is contained in:
wangw 2025-11-05 17:25:40 +08:00
commit 80ed05718b
7 changed files with 18 additions and 9 deletions

View File

@ -56,7 +56,6 @@ public class DistributionController {
* @return 是否成功 * @return 是否成功
*/ */
@SaAdminCheckPermission(value = "distribution:edit", name = "分销修改") @SaAdminCheckPermission(value = "distribution:edit", name = "分销修改")
@SaCheckMainShop
@PutMapping @PutMapping
public CzgResult<Boolean> edit( @RequestBody MkDistributionConfigDTO dto) { public CzgResult<Boolean> edit( @RequestBody MkDistributionConfigDTO dto) {
return CzgResult.success(configService.edit(StpKit.USER.getShopId(), dto)); return CzgResult.success(configService.edit(StpKit.USER.getShopId(), dto));

View File

@ -43,7 +43,6 @@ public class MkConsumeCashbackDTO implements Serializable {
/** /**
* 门店列表 * 门店列表
*/ */
@NotEmpty(message = "门店列表不为空")
private List<Long> shopIdList; private List<Long> shopIdList;
/** /**

View File

@ -18,6 +18,8 @@ import jakarta.annotation.Resource;
import org.apache.dubbo.config.annotation.DubboReference; import org.apache.dubbo.config.annotation.DubboReference;
import org.apache.dubbo.config.annotation.DubboService; import org.apache.dubbo.config.annotation.DubboService;
import java.util.ArrayList;
/** /**
* 霸王餐配置信息表 服务层实现 * 霸王餐配置信息表 服务层实现
* *
@ -61,7 +63,7 @@ public class FreeDineConfigServiceImpl extends ServiceImpl<FreeDineConfigMapper,
config.setShopIdList(JSONArray.toJSONString(freeDineConfigEditDTO.getShopIdList())); config.setShopIdList(JSONArray.toJSONString(freeDineConfigEditDTO.getShopIdList()));
} }
shopConfigService.editStatusByShopIdList(config.getShopId(), freeDineConfigEditDTO.getEnable() ? 1 : 0,true, "is_account_ay", freeDineConfigEditDTO.getUseShopType(), freeDineConfigEditDTO.getShopIdList()); shopConfigService.editStatusByShopIdList(config.getShopId(), freeDineConfigEditDTO.getEnable() ? 1 : 0,true, "is_account_ay", freeDineConfigEditDTO.getUseShopType(), freeDineConfigEditDTO.getShopIdList() == null ? new ArrayList<>() : freeDineConfigEditDTO.getShopIdList());
if (freeDineConfigEditDTO.getUseType() != null) { if (freeDineConfigEditDTO.getUseType() != null) {
config.setUseType(JSONObject.toJSONString(freeDineConfigEditDTO.getUseType())); config.setUseType(JSONObject.toJSONString(freeDineConfigEditDTO.getUseType()));
} }

View File

@ -55,6 +55,9 @@ public class ShopConfigServiceImpl extends ServiceImpl<ShopConfigMapper, ShopCon
shopConfig.setId(mainShopId); shopConfig.setId(mainShopId);
save(shopConfig); save(shopConfig);
} }
if (shopIdList == null) {
shopIdList = new ArrayList<>();
}
// 防止报错 // 防止报错
shopIdList.add(-9999L); shopIdList.add(-9999L);
List<Long> extistList; List<Long> extistList;
@ -68,17 +71,19 @@ public class ShopConfigServiceImpl extends ServiceImpl<ShopConfigMapper, ShopCon
} }
if (isEnable == 0 && !onyUpValid) { if (isEnable == 0 && !onyUpValid) {
List<Long> finalShopIdList = shopIdList;
updateChain().or(or -> { updateChain().or(or -> {
or.eq(ShopConfig::getId, mainShopId); or.eq(ShopConfig::getId, mainShopId);
}).or(or -> { }).or(or -> {
or.in(ShopConfig::getId, shopIdList); or.in(ShopConfig::getId, finalShopIdList);
}).set(property, 0).update(); }).set(property, 0).update();
}else { }else {
if ("all".equals(useShopType)) { if ("all".equals(useShopType)) {
List<Long> finalShopIdList1 = shopIdList;
updateChain().or(or -> { updateChain().or(or -> {
or.eq(ShopConfig::getId, mainShopId); or.eq(ShopConfig::getId, mainShopId);
}).or(or -> { }).or(or -> {
or.in(ShopConfig::getId, shopIdList); or.in(ShopConfig::getId, finalShopIdList1);
}).set(property, 1).update(); }).set(property, 1).update();
}else { }else {
if (shopIdList.isEmpty()) { if (shopIdList.isEmpty()) {

View File

@ -52,7 +52,10 @@ public class MkDistributionConfigServiceImpl extends ServiceImpl<MkDistributionC
public MkDistributionConfigVO detail(Long shopId) { public MkDistributionConfigVO detail(Long shopId) {
MkDistributionConfig config = getOne(new QueryWrapper().eq(MkDistributionConfig::getShopId, shopId)); MkDistributionConfig config = getOne(new QueryWrapper().eq(MkDistributionConfig::getShopId, shopId));
if (config == null) { if (config == null) {
return null; config = new MkDistributionConfig();
config.setShopId(shopId);
save(config);
config = getOne(new QueryWrapper().eq(MkDistributionConfig::getShopId, shopId));
} }
MkDistributionConfigVO configVO = BeanUtil.copyProperties(config, MkDistributionConfigVO.class); MkDistributionConfigVO configVO = BeanUtil.copyProperties(config, MkDistributionConfigVO.class);
configVO.setLevelConfigList(levelConfigService.list(new QueryWrapper() configVO.setLevelConfigList(levelConfigService.list(new QueryWrapper()
@ -74,7 +77,7 @@ public class MkDistributionConfigServiceImpl extends ServiceImpl<MkDistributionC
} }
List<MkDistributionUser> distributionUserList = distributionUserService.list(new QueryWrapper().eq(MkDistributionUser::getShopId, shopId)); List<MkDistributionUser> distributionUserList = distributionUserService.list(new QueryWrapper().eq(MkDistributionUser::getShopId, shopId));
// 邀请人数变动 // 邀请人数变动
if (!config.getInviteCount().equals(dto.getInviteCount())) { if (dto.getInviteCount() != null && !config.getInviteCount().equals(dto.getInviteCount())) {
distributionUserList.forEach(item -> item.setStatus(item.getInviteCount() >= dto.getInviteCount() ? 1 : 0)); distributionUserList.forEach(item -> item.setStatus(item.getInviteCount() >= dto.getInviteCount() ? 1 : 0));
distributionUserService.updateBatch(distributionUserList); distributionUserService.updateBatch(distributionUserList);
} }

View File

@ -29,7 +29,6 @@ import org.springframework.stereotype.Service;
public class MkEnableConfigServiceImpl extends ServiceImpl<MkEnableConfigMapper, MkEnableConfig> implements MkEnableConfigService{ public class MkEnableConfigServiceImpl extends ServiceImpl<MkEnableConfigMapper, MkEnableConfig> implements MkEnableConfigService{
@Override @Override
@Cacheable(key = "#mainShopId + ':' + #shopId")
public MkEnableConfigVO detail(Long mainShopId, Long shopId, TableValueConstant.EnableConfig.Type type) { public MkEnableConfigVO detail(Long mainShopId, Long shopId, TableValueConstant.EnableConfig.Type type) {
MkEnableConfig one = getOne(new QueryWrapper().eq(MkEnableConfig::getMainShopId, mainShopId).eq(MkEnableConfig::getType, type.getCode())); MkEnableConfig one = getOne(new QueryWrapper().eq(MkEnableConfig::getMainShopId, mainShopId).eq(MkEnableConfig::getType, type.getCode()));
if (one == null) { if (one == null) {
@ -48,7 +47,6 @@ public class MkEnableConfigServiceImpl extends ServiceImpl<MkEnableConfigMapper,
} }
@Override @Override
@CacheEvict(key = "#mainShopId + ':' + #shopId")
public Boolean upEnable(Long mainShopId, Long shopId, MkEnableConfigDTO dto, TableValueConstant.EnableConfig.Type type) { public Boolean upEnable(Long mainShopId, Long shopId, MkEnableConfigDTO dto, TableValueConstant.EnableConfig.Type type) {
MkEnableConfig one = getOne(new QueryWrapper().eq(MkEnableConfig::getMainShopId, mainShopId).eq(MkEnableConfig::getType, type.getCode())); MkEnableConfig one = getOne(new QueryWrapper().eq(MkEnableConfig::getMainShopId, mainShopId).eq(MkEnableConfig::getType, type.getCode()));
if (one == null) { if (one == null) {

View File

@ -10,6 +10,7 @@ import com.czg.system.service.SysParamsService;
import com.czg.utils.AssertUtil; import com.czg.utils.AssertUtil;
import com.mybatisflex.core.query.QueryWrapper; import com.mybatisflex.core.query.QueryWrapper;
import com.mybatisflex.spring.service.impl.ServiceImpl; import com.mybatisflex.spring.service.impl.ServiceImpl;
import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboService; import org.apache.dubbo.config.annotation.DubboService;
import org.springframework.cache.annotation.CacheConfig; import org.springframework.cache.annotation.CacheConfig;
import org.springframework.cache.annotation.CacheEvict; import org.springframework.cache.annotation.CacheEvict;
@ -23,6 +24,7 @@ import java.util.List;
* @author mac * @author mac
* @since 2025-02-07 * @since 2025-02-07
*/ */
@Slf4j
@DubboService @DubboService
@CacheConfig(cacheNames = "params") @CacheConfig(cacheNames = "params")
public class SysParamsServiceImpl extends ServiceImpl<SysParamsMapper, SysParams> implements SysParamsService { public class SysParamsServiceImpl extends ServiceImpl<SysParamsMapper, SysParams> implements SysParamsService {
@ -110,6 +112,7 @@ public class SysParamsServiceImpl extends ServiceImpl<SysParamsMapper, SysParams
@Override @Override
public String getSysParamValue(String code) { public String getSysParamValue(String code) {
SysParams sysParam = getSysParam(code); SysParams sysParam = getSysParam(code);
log.error("参数不存在,参数编码:{}", code);
AssertUtil.isNull(sysParam, "参数不存在"); AssertUtil.isNull(sysParam, "参数不存在");
AssertUtil.isBlank(sysParam.getParamValue(), "参数值为空"); AssertUtil.isBlank(sysParam.getParamValue(), "参数值为空");
return sysParam.getParamValue(); return sysParam.getParamValue();