修改大模型的配置

This commit is contained in:
Wang 2026-01-16 10:40:11 +08:00
parent eeae2978de
commit 624d20283e
5 changed files with 49 additions and 32 deletions

View File

@ -35,7 +35,7 @@ public class LlmConfig implements InitializingBean {
@Value("${largeModel.stt:}")
private String stt;
@Value("${largeModel.getComment:}")
@Value("${largeModel.comment:}")
private String getComment;
@Value("${largeModel.sseAiChat:}")
@ -53,10 +53,10 @@ public class LlmConfig implements InitializingBean {
@Value("${largeModel.processUpload:}")
private String processUpload;
@Value("${largeModel.getContextAboutSingleQuestion:}")
@Value("${largeModel.contextAboutSingleQuestion:}")
private String getContextAboutSingleQuestion;
@Value("${largeModel.getTextBase64:}")
@Value("${largeModel.textBase64:}")
private String getTextBase64;
public static String IP;

View File

@ -12,7 +12,9 @@ import com.seer.teach.mp.admin.controller.req.MpAgentReq;
import com.seer.teach.mp.admin.controller.req.MpAgentSaveReq;
import com.seer.teach.mp.admin.controller.resp.AgentResp;
import com.seer.teach.mp.admin.convert.AgentConvert;
import com.seer.teach.mp.entity.MpAgentEmployeeRelationEntity;
import com.seer.teach.mp.entity.MpAgentEntity;
import com.seer.teach.mp.service.IMpAgentEmployeeRelationService;
import com.seer.teach.mp.service.IMpAgentService;
import com.seer.teach.user.api.UserInfoServiceApi;
import com.seer.teach.user.api.dto.UserInfoDTO;
@ -33,6 +35,8 @@ public class AdminAgentService {
private final UserInfoServiceApi userInfoServiceApi;
private final IMpAgentEmployeeRelationService mpAgentEmployeeRelationService;
/**
* 获取代理商列表
*
@ -72,7 +76,7 @@ public class AdminAgentService {
* @return 是否成功
*/
public Boolean saveAgent(MpAgentSaveReq req) {
boolean userIdByMobile = userInfoServiceApi.getUserIdByMobile(req.getContactPhone());
boolean userIdByMobile = mpAgentService.getCountByPhone(req.getContactPhone()) == 0;
AssertUtils.isTrue(userIdByMobile, ResultCodeEnum.AGENT_IS_EXISTS);
MpAgentEntity agentEntity = AgentConvert.INSTANCE.convertOneSave(req);
boolean result = mpAgentService.saveAgent(agentEntity, req.getPassword());
@ -89,29 +93,15 @@ public class AdminAgentService {
public Boolean updateAgent(MpAgentReq req) {
MpAgentEntity agent = mpAgentService.getById(req.getId());
AssertUtils.notNull(agent, ResultCodeEnum.AGENT_NOT_FOUND);
UserInfoDTO userInfoDTO = new UserInfoDTO();
userInfoDTO.setId(agent.getContactUserId());
userInfoDTO.setUserName(req.getContactName());
userInfoDTO.setMobile(req.getContactPhone());
if (StringUtils.isNotBlank(req.getPassword())) {
userInfoDTO.setPassword(req.getPassword());
}
boolean updateUserResult = userInfoServiceApi.updateUserInfo(userInfoDTO);
log.info("更新用户结果: {}", updateUserResult);
agent.setId(req.getId());
agent.setAgentName(req.getAgentName());
agent.setAgentCode(req.getAgentCode());
agent.setAgentLevel(req.getAgentLevel());
agent.setContactName(req.getContactName());
Integer contactUserId = userInfoServiceApi.getUserIdByUserName(agent.getContactName());
agent.setContactUserId(contactUserId);
agent.setContactPhone(req.getContactPhone());
agent.setAddress(req.getAddress());
agent.setStatus(req.getStatus());
boolean result = mpAgentService.updateAgent(agent);
log.info("更新代理商结果: {}", result);
return result && updateUserResult;
return mpAgentService.updateAgent(agent, req.getPassword());
}
/**
@ -125,17 +115,21 @@ public class AdminAgentService {
log.warn("删除代理商时ID列表为空");
return false;
}
List<MpAgentEntity> agentList = mpAgentService.lambdaQuery().in(MpAgentEntity::getId, ids)
.select(MpAgentEntity::getContactUserId).list();
List<Integer> contactUserIdList = agentList.stream().map(MpAgentEntity::getContactUserId)
.filter(Objects::nonNull).toList();
log.info("待删除代理商关联的用户ID列表: {}", contactUserIdList);
boolean result = mpAgentService.removeByIds(ids);
log.info("删除代理商结果: {}", result);
if (result) {
log.info("删除代理商成功ID列表: {}", ids);
// 删除关联的用户数据
List<MpAgentEntity> agentList = mpAgentService.lambdaQuery().in(MpAgentEntity::getId, ids)
.select(MpAgentEntity::getContactUserId).list();
List<Integer> contactUserIdList = agentList.stream().map(MpAgentEntity::getContactUserId)
.filter(Objects::nonNull).toList();
log.info("待删除代理商关联的用户ID列表: {}", contactUserIdList);
userInfoServiceApi.deleteUserRoleByUserId(contactUserIdList);
// 删除关联的代理商员工关系数据
boolean remove = mpAgentEmployeeRelationService.remove(new LambdaQueryWrapper<>(MpAgentEmployeeRelationEntity.class).in(MpAgentEmployeeRelationEntity::getAgentId, ids));
log.info("删除代理商员工关系结果: {}", remove);
}
return result;
}

View File

@ -22,7 +22,7 @@ public interface IMpAgentService extends IService<MpAgentEntity> {
* 保存代理商
*
* @param agentEntity 代理商实体
* @param password m密码
* @param password 密码
* @return 是否成功
*/
Boolean saveAgent(MpAgentEntity agentEntity,String password);
@ -31,13 +31,21 @@ public interface IMpAgentService extends IService<MpAgentEntity> {
* 更新代理商
*
* @param agentEntity 代理商实体
* @param password 密码
* @return 是否成功
*/
Boolean updateAgent(MpAgentEntity agentEntity);
Boolean updateAgent(MpAgentEntity agentEntity,String password);
/**
* 获取代理商名称列表
* @return 代理商名称列表
*/
List<String> getAgentName();
/**
* 根据手机号获取代理商数量
* @param phone 手机号
* @return 代理商数量
*/
long getCountByPhone(String phone);
}

View File

@ -9,6 +9,7 @@ import com.seer.teach.user.api.UserInfoServiceApi;
import com.seer.teach.user.api.dto.UserInfoDTO;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import java.util.List;
@ -42,8 +43,20 @@ public class MpAgentServiceImpl extends ServiceImpl<MpAgentMapper, MpAgentEntity
}
@Override
public Boolean updateAgent(MpAgentEntity agentEntity) {
return this.updateById(agentEntity);
public Boolean updateAgent(MpAgentEntity agent,String password) {
boolean result = this.updateById(agent);
if(result){
UserInfoDTO userInfoDTO = new UserInfoDTO();
userInfoDTO.setId(agent.getContactUserId());
userInfoDTO.setUserName(agent.getContactName());
userInfoDTO.setMobile(agent.getContactPhone());
if (StringUtils.isNotBlank(password)) {
userInfoDTO.setPassword(password);
}
boolean updateUserResult = userInfoServiceApi.updateUserInfo(userInfoDTO);
log.info("更新用户结果: {}", updateUserResult);
}
return result;
}
@Override
@ -51,4 +64,9 @@ public class MpAgentServiceImpl extends ServiceImpl<MpAgentMapper, MpAgentEntity
List<MpAgentEntity> list = this.list();
return list.stream().map(MpAgentEntity::getAgentName).toList();
}
@Override
public long getCountByPhone(String phone) {
return this.lambdaQuery().eq(MpAgentEntity::getContactPhone, phone).count();
}
}

View File

@ -336,10 +336,7 @@ public class UserInfoServiceApiImpl implements UserInfoServiceApi {
log.info("准备删除角色记录ID列表: {}", ids);
boolean result = userRoleService.removeByIds(ids);
log.info("删除角色结果: {}", result);
// 删除用户信息
boolean userResult = userService.removeByIds(userIds);
log.info("删除用户信息结果: {}", userResult);
return result && userResult;
return result;
}
@Override