Merge remote-tracking branch 'origin/test' into test
This commit is contained in:
commit
80ed05718b
|
|
@ -56,7 +56,6 @@ public class DistributionController {
|
|||
* @return 是否成功
|
||||
*/
|
||||
@SaAdminCheckPermission(value = "distribution:edit", name = "分销修改")
|
||||
@SaCheckMainShop
|
||||
@PutMapping
|
||||
public CzgResult<Boolean> edit( @RequestBody MkDistributionConfigDTO dto) {
|
||||
return CzgResult.success(configService.edit(StpKit.USER.getShopId(), dto));
|
||||
|
|
|
|||
|
|
@ -43,7 +43,6 @@ public class MkConsumeCashbackDTO implements Serializable {
|
|||
/**
|
||||
* 门店列表
|
||||
*/
|
||||
@NotEmpty(message = "门店列表不为空")
|
||||
private List<Long> shopIdList;
|
||||
|
||||
/**
|
||||
|
|
|
|||
|
|
@ -18,6 +18,8 @@ import jakarta.annotation.Resource;
|
|||
import org.apache.dubbo.config.annotation.DubboReference;
|
||||
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()));
|
||||
}
|
||||
|
||||
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) {
|
||||
config.setUseType(JSONObject.toJSONString(freeDineConfigEditDTO.getUseType()));
|
||||
}
|
||||
|
|
|
|||
|
|
@ -55,6 +55,9 @@ public class ShopConfigServiceImpl extends ServiceImpl<ShopConfigMapper, ShopCon
|
|||
shopConfig.setId(mainShopId);
|
||||
save(shopConfig);
|
||||
}
|
||||
if (shopIdList == null) {
|
||||
shopIdList = new ArrayList<>();
|
||||
}
|
||||
// 防止报错
|
||||
shopIdList.add(-9999L);
|
||||
List<Long> extistList;
|
||||
|
|
@ -68,17 +71,19 @@ public class ShopConfigServiceImpl extends ServiceImpl<ShopConfigMapper, ShopCon
|
|||
}
|
||||
|
||||
if (isEnable == 0 && !onyUpValid) {
|
||||
List<Long> finalShopIdList = shopIdList;
|
||||
updateChain().or(or -> {
|
||||
or.eq(ShopConfig::getId, mainShopId);
|
||||
}).or(or -> {
|
||||
or.in(ShopConfig::getId, shopIdList);
|
||||
or.in(ShopConfig::getId, finalShopIdList);
|
||||
}).set(property, 0).update();
|
||||
}else {
|
||||
if ("all".equals(useShopType)) {
|
||||
List<Long> finalShopIdList1 = shopIdList;
|
||||
updateChain().or(or -> {
|
||||
or.eq(ShopConfig::getId, mainShopId);
|
||||
}).or(or -> {
|
||||
or.in(ShopConfig::getId, shopIdList);
|
||||
or.in(ShopConfig::getId, finalShopIdList1);
|
||||
}).set(property, 1).update();
|
||||
}else {
|
||||
if (shopIdList.isEmpty()) {
|
||||
|
|
|
|||
|
|
@ -52,7 +52,10 @@ public class MkDistributionConfigServiceImpl extends ServiceImpl<MkDistributionC
|
|||
public MkDistributionConfigVO detail(Long shopId) {
|
||||
MkDistributionConfig config = getOne(new QueryWrapper().eq(MkDistributionConfig::getShopId, shopId));
|
||||
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);
|
||||
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));
|
||||
// 邀请人数变动
|
||||
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));
|
||||
distributionUserService.updateBatch(distributionUserList);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,6 @@ import org.springframework.stereotype.Service;
|
|||
public class MkEnableConfigServiceImpl extends ServiceImpl<MkEnableConfigMapper, MkEnableConfig> implements MkEnableConfigService{
|
||||
|
||||
@Override
|
||||
@Cacheable(key = "#mainShopId + ':' + #shopId")
|
||||
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()));
|
||||
if (one == null) {
|
||||
|
|
@ -48,7 +47,6 @@ public class MkEnableConfigServiceImpl extends ServiceImpl<MkEnableConfigMapper,
|
|||
}
|
||||
|
||||
@Override
|
||||
@CacheEvict(key = "#mainShopId + ':' + #shopId")
|
||||
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()));
|
||||
if (one == null) {
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@ import com.czg.system.service.SysParamsService;
|
|||
import com.czg.utils.AssertUtil;
|
||||
import com.mybatisflex.core.query.QueryWrapper;
|
||||
import com.mybatisflex.spring.service.impl.ServiceImpl;
|
||||
import lombok.extern.slf4j.Slf4j;
|
||||
import org.apache.dubbo.config.annotation.DubboService;
|
||||
import org.springframework.cache.annotation.CacheConfig;
|
||||
import org.springframework.cache.annotation.CacheEvict;
|
||||
|
|
@ -23,6 +24,7 @@ import java.util.List;
|
|||
* @author mac
|
||||
* @since 2025-02-07
|
||||
*/
|
||||
@Slf4j
|
||||
@DubboService
|
||||
@CacheConfig(cacheNames = "params")
|
||||
public class SysParamsServiceImpl extends ServiceImpl<SysParamsMapper, SysParams> implements SysParamsService {
|
||||
|
|
@ -110,6 +112,7 @@ public class SysParamsServiceImpl extends ServiceImpl<SysParamsMapper, SysParams
|
|||
@Override
|
||||
public String getSysParamValue(String code) {
|
||||
SysParams sysParam = getSysParam(code);
|
||||
log.error("参数不存在,参数编码:{}", code);
|
||||
AssertUtil.isNull(sysParam, "参数不存在");
|
||||
AssertUtil.isBlank(sysParam.getParamValue(), "参数值为空");
|
||||
return sysParam.getParamValue();
|
||||
|
|
|
|||
Loading…
Reference in New Issue