fix: 修改后台相关

pull/8/head
tangqian 2023-05-31 17:29:24 +08:00
parent fd8d47ae81
commit 9f9cb30b03
7 changed files with 60 additions and 23 deletions

View File

@ -4,25 +4,28 @@ package cn.iocoder.yudao.module.infra.api.config;
import cn.iocoder.yudao.framework.common.pojo.CommonResult;
/**
* <pre>
* <b>ApiConfigApi</b>
* <b>Description:</b>
* <b>@author:</b> zenghuapei
* <b>Date:</b> 2023/4/3 10:19
* ----------------------------------------------------------------------
* </pre>
**/
* <pre>
* <b>ApiConfigApi</b>
* <b>Description:</b>
* <b>@author:</b> zenghuapei
* <b>Date:</b> 2023/4/3 10:19
* ----------------------------------------------------------------------
* </pre>
**/
public interface ApiConfigApi {
/**
* <pre>
* <b>getConfigKey</b>
* <b>Description:key</b>
* <b>@author:</b> zenghuapei
* <b>@date:</b> 2023/4/3 10:21
* @param key:
* @return
* </pre>
*/
CommonResult<String> getConfigKey( String key);
String getConfigKeyValue( String key);
/**
* <pre>
* <b>getConfigKey</b>
* <b>Description:key</b>
* <b>@author:</b> zenghuapei
* <b>@date:</b> 2023/4/3 10:21
* @param key:
* @return
* </pre>
*/
CommonResult<String> getConfigKey(String key);
String getConfigKeyValue(String key);
String getConfigRemark(String key);
}

View File

@ -62,4 +62,16 @@ public class ApiConfigImpl implements ApiConfigApi{
}
return config.getValue();
}
@Override
public String getConfigRemark(String key) {
ConfigDO config = configService.getConfigByKey(key);
if (config == null) {
return null;
}
if (!config.getVisible()) {
throw exception(ErrorCodeConstants.CONFIG_GET_VALUE_ERROR_IF_VISIBLE);
}
return config.getRemark();
}
}

View File

@ -102,4 +102,5 @@ public class ConfigController {
ExcelUtils.write(response, "参数配置.xls", "数据", ConfigExcelVO.class, datas);
}
}

View File

@ -23,6 +23,11 @@
<artifactId>yudao-module-member-api</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-module-infra-api</artifactId>
<version>${revision}</version>
</dependency>
<dependency>
<groupId>cn.iocoder.boot</groupId>
<artifactId>yudao-module-shop-api</artifactId>

View File

@ -5,6 +5,8 @@ import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.security.core.annotations.PreAuthenticated;
import cn.iocoder.yudao.framework.security.core.util.SecurityFrameworkUtils;
import cn.iocoder.yudao.framework.tenant.core.aop.TenantIgnore;
import cn.iocoder.yudao.module.infra.api.config.ApiConfigApi;
import cn.iocoder.yudao.module.infra.enums.ErrorCodeConstants;
import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.RechargeGearRespVO;
import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.RechargeOrderPageReqVO;
import cn.iocoder.yudao.module.shop.controller.admin.recharge.vo.RechargeOrderRespVO;
@ -27,8 +29,12 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.*;
import javax.annotation.security.PermitAll;
import java.util.List;
import static cn.iocoder.yudao.framework.common.exception.util.ServiceExceptionUtil.exception;
import static cn.iocoder.yudao.framework.common.pojo.CommonResult.success;
/**
* @Title:MemberController
* @Description:
@ -46,6 +52,8 @@ public class MemberController {
private RechargeGearService rechargeGearService;
@Autowired
private RechargeOrderService rechargeOrderService;
@Autowired
private ApiConfigApi apiConfigApi;
// 会员档次信息列表
@ -123,4 +131,12 @@ public class MemberController {
return CommonResult.success(rechargeOrderService.memberChangeTie(changeTieRequest));
}
@GetMapping(value = "/get-app_value-by-key")
@Operation(summary = "根据参数键名查询参数值", description = "不可见的配置,不允许返回给前端")
@PermitAll
@TenantIgnore
public CommonResult<String> getAppConfigKey(@RequestParam("key") String key) {
return success(apiConfigApi.getConfigRemark(key));
}
}

View File

@ -806,7 +806,7 @@ public class OrderServiceImpl implements OrderService {
orderInfoVo.setOrderProNum(orderProNum);
// 获取默认地址
UserAddressRespDTO userAddress = userAddressApi.getDefaultByUid(user.getId());
if (ObjectUtil.isNotNull(userAddress)) {
if (ObjectUtil.isNotNull(userAddress.getId())) {
// 计算运费
getFreightFee(orderInfoVo, userAddress);
orderInfoVo.setAddressId(userAddress.getId());
@ -820,7 +820,7 @@ public class OrderServiceImpl implements OrderService {
orderInfoVo.setFreightFee(BigDecimal.ZERO);
}
// 实际支付金额
orderInfoVo.setPayFee(orderInfoVo.getProTotalFee().add(BigDecimal.ZERO));
orderInfoVo.setPayFee(orderInfoVo.getProTotalFee().add(orderInfoVo.getProTotalFee()));
//用户剩余积分
//用户剩余经验
// 缓存订单

View File

@ -103,7 +103,7 @@ public class MemberUserServiceImpl implements MemberUserService {
user.setMobile(mobile);
user.setNickname(realName);
user.setStatus(CommonStatusEnum.ENABLE.getStatus()); // 默认开启
user.setPassword(encodePassword("123456")); // 加密密码
user.setPassword(encodePassword(mobile.substring(5,11))); // 加密密码
user.setRegisterIp(registerIp);
user.setPromoterId(promoterId);
user.setTenantId(TenantContextHolder.getRequiredTenantId());