This commit is contained in:
2026-02-04 00:53:07 +08:00
parent c0acba8180
commit 7d48faca11
570 changed files with 134 additions and 43299 deletions

View File

@@ -26,14 +26,8 @@
package org.springblade.modules.system.service;
import org.springblade.core.mp.base.BaseService;
import org.springblade.modules.appFormal.dto.CutAmountRangDTO;
import org.springblade.modules.appFormal.dto.PayOrderDicDTO;
import org.springblade.modules.appOffline.dto.WatchVideoTimeRangeDTO;
import org.springblade.modules.auth.dto.UserRegisterRoleDTO;
import org.springblade.modules.system.pojo.entity.Param;
import java.math.BigDecimal;
import java.util.List;
/**
* 服务类
@@ -50,24 +44,4 @@ public interface IParamService extends BaseService<Param> {
*/
String getValue(String paramKey);
UserRegisterRoleDTO getUserRegisterRoleInfo();
String getFormalAppPrivacy();
String formalAppAgreement();
List<PayOrderDicDTO> getOrderBizModel();
BigDecimal getMallCashToPointRate();
CutAmountRangDTO getMallCutAmountRangDTO();
List<PayOrderDicDTO> findAppFormalPayType(Integer payModel);
Boolean isLookAtAdsByOutput();
WatchVideoTimeRangeDTO watchVideoTimeRange();
}

View File

@@ -25,28 +25,12 @@
*/
package org.springblade.modules.system.service.impl;
import com.alibaba.fastjson2.JSON;
import com.alibaba.fastjson2.JSONObject;
import com.alibaba.fastjson2.TypeReference;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.xxl.job.core.handler.annotation.XxlJob;
import jakarta.annotation.PostConstruct;
import org.springblade.core.mp.base.BaseServiceImpl;
import org.springblade.modules.appFormal.dto.CutAmountRangDTO;
import org.springblade.modules.appFormal.dto.PayOrderDicDTO;
import org.springblade.modules.appOffline.dto.WatchVideoTimeRangeDTO;
import org.springblade.modules.auth.dto.UserRegisterRoleDTO;
import org.springblade.modules.system.pojo.entity.Param;
import org.springblade.modules.system.mapper.ParamMapper;
import org.springblade.modules.system.service.IParamService;
import org.springframework.stereotype.Service;
import org.springframework.util.CollectionUtils;
import org.springframework.util.StringUtils;
import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Map;
/**
* 服务实现类
@@ -57,83 +41,10 @@ import java.util.Map;
@Service
public class ParamServiceImpl extends BaseServiceImpl<ParamMapper, Param> implements IParamService {
private static final String APP_USER_REGISTER_ROLE = "yichayilu:app:register:role-info";
private static final String APP_FORMAL_USER_PRIVACY = "yichayilu:app:formal:user:privacy";
private static final String APP_FORMAL_USER_AGREEMENT = "yichayilu:app:formal:user:agreement";
private static final String APP_FORMAL_ORDER_MODEL_TYPE = "yichayilu:app:formal:order:model_type";
private static final String APP_FORMAL_MALL_CASH_TO_POINT_RATE = "yichayilu:app:formal:mall.cash.to.point.Rate";
private static final String APP_FORMAL_MALL_CUT_AMOUNT_RANG = "yichayilu:app:formal:mall.cut.amount.rang";
private static final String APP_FORMAL_MALL_PAY_TYPE = "yichayilu:app:formal:pay.type";
private static final String APP_FORMAL_DAILY_SIGN_IS_LOOK_ADS = "yichayilu:app:dailysign.is.look.ads";
private static final String APP_FORMAL_WATCH_VIDEO_TIME_RANG = "yichayilu:app:dailysign:watch.video.time.rang";
@Override
public String getValue(String paramKey) {
Param param = this.getOne(Wrappers.<Param>query().lambda().eq(Param::getParamKey, paramKey));
return param.getParamValue();
}
@Override
public UserRegisterRoleDTO getUserRegisterRoleInfo() {
Param param = this.getOne(Wrappers.<Param>query().lambda().eq(Param::getParamKey, APP_USER_REGISTER_ROLE));
return JSONObject.parseObject(param.getParamValue(), UserRegisterRoleDTO.class);
}
@Override
public String getFormalAppPrivacy() {
Param param = this.getOne(Wrappers.<Param>query().lambda().eq(Param::getParamKey, APP_FORMAL_USER_PRIVACY));
return param.getParamValue();
}
@Override
public String formalAppAgreement() {
Param param = this.getOne(Wrappers.<Param>query().lambda().eq(Param::getParamKey, APP_FORMAL_USER_AGREEMENT));
return param.getParamValue();
}
@Override
public List<PayOrderDicDTO> getOrderBizModel() {
Param param = getOne(Wrappers.<Param>lambdaQuery().eq(Param::getParamKey,APP_FORMAL_ORDER_MODEL_TYPE));
return param != null && StringUtils.hasLength(param.getParamValue()) ? JSON.parseArray(param.getParamValue(), PayOrderDicDTO.class) : new ArrayList<>(0);
}
@Override
public BigDecimal getMallCashToPointRate() {
Param param = getOne(Wrappers.<Param>lambdaQuery().eq(Param::getParamKey,APP_FORMAL_MALL_CASH_TO_POINT_RATE));
return BigDecimal.valueOf(Double.parseDouble(param.getParamValue()));
}
@Override
public CutAmountRangDTO getMallCutAmountRangDTO() {
Param param = getOne(Wrappers.<Param>lambdaQuery().eq(Param::getParamKey,APP_FORMAL_MALL_CUT_AMOUNT_RANG));
return JSONObject.parseObject(param.getParamValue(), CutAmountRangDTO.class);
}
@Override
public List<PayOrderDicDTO> findAppFormalPayType(Integer payModel) {
Param param = getOne(Wrappers.<Param>lambdaQuery().eq(Param::getParamKey, APP_FORMAL_MALL_PAY_TYPE));
if (param != null && StringUtils.hasLength(param.getParamValue())) {
Map<Integer, List<PayOrderDicDTO>> result = JSON.parseObject(param.getParamValue(), new TypeReference<Map<Integer, List<PayOrderDicDTO>>>() {
});
return CollectionUtils.isEmpty(result) ? new ArrayList<>(0) : payModel == null ? result.get(-1) : result.get(payModel);
}
return new ArrayList<>(0);
}
@Override
public Boolean isLookAtAdsByOutput() {
Param param = this.getOne(Wrappers.<Param>query().lambda().eq(Param::getParamKey, APP_FORMAL_DAILY_SIGN_IS_LOOK_ADS));
return Boolean.valueOf(param.getParamValue());
}
@Override
public WatchVideoTimeRangeDTO watchVideoTimeRange() {
Param param = this.getOne(Wrappers.<Param>query().lambda().eq(Param::getParamKey, APP_FORMAL_WATCH_VIDEO_TIME_RANG));
return JSONObject.parseObject(param.getParamValue(), WatchVideoTimeRangeDTO.class);
}
}

View File

@@ -49,7 +49,6 @@ import org.springblade.core.tool.constant.BladeConstant;
import org.springblade.core.tool.jackson.JsonUtil;
import org.springblade.core.tool.support.Kv;
import org.springblade.core.tool.utils.*;
import org.springblade.modules.auth.dto.UserRegisterRoleDTO;
import org.springblade.modules.auth.provider.UserType;
import org.springblade.modules.system.excel.UserExcel;
import org.springblade.modules.system.mapper.UserMapper;
@@ -461,14 +460,6 @@ public class UserServiceImpl extends BaseServiceImpl<UserMapper, User> implement
if (tenant == null || tenant.getId() == null) {
throw new OAuth2Exception("租户信息错误!");
}
UserRegisterRoleDTO userRegisterRoleInfo = paramService.getUserRegisterRoleInfo();
user.setRealName(user.getName());
user.setRoleId(userRegisterRoleInfo.getRoleId());
user.setDeptId(userRegisterRoleInfo.getDeptId());
user.setPostId(userRegisterRoleInfo.getPostId());
user.setAvatar(userRegisterRoleInfo.getAvatar());
user.setStatus(StatusType.ACTIVE.getType());
return this.submit(user);
}