修改大模型的配置
This commit is contained in:
parent
eeae2978de
commit
624d20283e
@ -35,7 +35,7 @@ public class LlmConfig implements InitializingBean {
|
|||||||
@Value("${largeModel.stt:}")
|
@Value("${largeModel.stt:}")
|
||||||
private String stt;
|
private String stt;
|
||||||
|
|
||||||
@Value("${largeModel.getComment:}")
|
@Value("${largeModel.comment:}")
|
||||||
private String getComment;
|
private String getComment;
|
||||||
|
|
||||||
@Value("${largeModel.sseAiChat:}")
|
@Value("${largeModel.sseAiChat:}")
|
||||||
@ -53,10 +53,10 @@ public class LlmConfig implements InitializingBean {
|
|||||||
@Value("${largeModel.processUpload:}")
|
@Value("${largeModel.processUpload:}")
|
||||||
private String processUpload;
|
private String processUpload;
|
||||||
|
|
||||||
@Value("${largeModel.getContextAboutSingleQuestion:}")
|
@Value("${largeModel.contextAboutSingleQuestion:}")
|
||||||
private String getContextAboutSingleQuestion;
|
private String getContextAboutSingleQuestion;
|
||||||
|
|
||||||
@Value("${largeModel.getTextBase64:}")
|
@Value("${largeModel.textBase64:}")
|
||||||
private String getTextBase64;
|
private String getTextBase64;
|
||||||
|
|
||||||
public static String IP;
|
public static String IP;
|
||||||
|
|||||||
@ -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.req.MpAgentSaveReq;
|
||||||
import com.seer.teach.mp.admin.controller.resp.AgentResp;
|
import com.seer.teach.mp.admin.controller.resp.AgentResp;
|
||||||
import com.seer.teach.mp.admin.convert.AgentConvert;
|
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.entity.MpAgentEntity;
|
||||||
|
import com.seer.teach.mp.service.IMpAgentEmployeeRelationService;
|
||||||
import com.seer.teach.mp.service.IMpAgentService;
|
import com.seer.teach.mp.service.IMpAgentService;
|
||||||
import com.seer.teach.user.api.UserInfoServiceApi;
|
import com.seer.teach.user.api.UserInfoServiceApi;
|
||||||
import com.seer.teach.user.api.dto.UserInfoDTO;
|
import com.seer.teach.user.api.dto.UserInfoDTO;
|
||||||
@ -33,6 +35,8 @@ public class AdminAgentService {
|
|||||||
|
|
||||||
private final UserInfoServiceApi userInfoServiceApi;
|
private final UserInfoServiceApi userInfoServiceApi;
|
||||||
|
|
||||||
|
private final IMpAgentEmployeeRelationService mpAgentEmployeeRelationService;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取代理商列表
|
* 获取代理商列表
|
||||||
*
|
*
|
||||||
@ -72,7 +76,7 @@ public class AdminAgentService {
|
|||||||
* @return 是否成功
|
* @return 是否成功
|
||||||
*/
|
*/
|
||||||
public Boolean saveAgent(MpAgentSaveReq req) {
|
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);
|
AssertUtils.isTrue(userIdByMobile, ResultCodeEnum.AGENT_IS_EXISTS);
|
||||||
MpAgentEntity agentEntity = AgentConvert.INSTANCE.convertOneSave(req);
|
MpAgentEntity agentEntity = AgentConvert.INSTANCE.convertOneSave(req);
|
||||||
boolean result = mpAgentService.saveAgent(agentEntity, req.getPassword());
|
boolean result = mpAgentService.saveAgent(agentEntity, req.getPassword());
|
||||||
@ -89,29 +93,15 @@ public class AdminAgentService {
|
|||||||
public Boolean updateAgent(MpAgentReq req) {
|
public Boolean updateAgent(MpAgentReq req) {
|
||||||
MpAgentEntity agent = mpAgentService.getById(req.getId());
|
MpAgentEntity agent = mpAgentService.getById(req.getId());
|
||||||
AssertUtils.notNull(agent, ResultCodeEnum.AGENT_NOT_FOUND);
|
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.setId(req.getId());
|
||||||
agent.setAgentName(req.getAgentName());
|
agent.setAgentName(req.getAgentName());
|
||||||
agent.setAgentCode(req.getAgentCode());
|
|
||||||
agent.setAgentLevel(req.getAgentLevel());
|
agent.setAgentLevel(req.getAgentLevel());
|
||||||
agent.setContactName(req.getContactName());
|
agent.setContactName(req.getContactName());
|
||||||
Integer contactUserId = userInfoServiceApi.getUserIdByUserName(agent.getContactName());
|
|
||||||
agent.setContactUserId(contactUserId);
|
|
||||||
agent.setContactPhone(req.getContactPhone());
|
agent.setContactPhone(req.getContactPhone());
|
||||||
agent.setAddress(req.getAddress());
|
agent.setAddress(req.getAddress());
|
||||||
agent.setStatus(req.getStatus());
|
agent.setStatus(req.getStatus());
|
||||||
boolean result = mpAgentService.updateAgent(agent);
|
return mpAgentService.updateAgent(agent, req.getPassword());
|
||||||
log.info("更新代理商结果: {}", result);
|
|
||||||
return result && updateUserResult;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -125,17 +115,21 @@ public class AdminAgentService {
|
|||||||
log.warn("删除代理商时,ID列表为空");
|
log.warn("删除代理商时,ID列表为空");
|
||||||
return false;
|
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);
|
boolean result = mpAgentService.removeByIds(ids);
|
||||||
log.info("删除代理商结果: {}", result);
|
log.info("删除代理商结果: {}", result);
|
||||||
if (result) {
|
if (result) {
|
||||||
log.info("删除代理商成功,ID列表: {}", ids);
|
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);
|
userInfoServiceApi.deleteUserRoleByUserId(contactUserIdList);
|
||||||
|
|
||||||
|
// 删除关联的代理商员工关系数据
|
||||||
|
boolean remove = mpAgentEmployeeRelationService.remove(new LambdaQueryWrapper<>(MpAgentEmployeeRelationEntity.class).in(MpAgentEmployeeRelationEntity::getAgentId, ids));
|
||||||
|
log.info("删除代理商员工关系结果: {}", remove);
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -22,7 +22,7 @@ public interface IMpAgentService extends IService<MpAgentEntity> {
|
|||||||
* 保存代理商
|
* 保存代理商
|
||||||
*
|
*
|
||||||
* @param agentEntity 代理商实体
|
* @param agentEntity 代理商实体
|
||||||
* @param password m密码
|
* @param password 密码
|
||||||
* @return 是否成功
|
* @return 是否成功
|
||||||
*/
|
*/
|
||||||
Boolean saveAgent(MpAgentEntity agentEntity,String password);
|
Boolean saveAgent(MpAgentEntity agentEntity,String password);
|
||||||
@ -31,13 +31,21 @@ public interface IMpAgentService extends IService<MpAgentEntity> {
|
|||||||
* 更新代理商
|
* 更新代理商
|
||||||
*
|
*
|
||||||
* @param agentEntity 代理商实体
|
* @param agentEntity 代理商实体
|
||||||
|
* @param password 密码
|
||||||
* @return 是否成功
|
* @return 是否成功
|
||||||
*/
|
*/
|
||||||
Boolean updateAgent(MpAgentEntity agentEntity);
|
Boolean updateAgent(MpAgentEntity agentEntity,String password);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获取代理商名称列表
|
* 获取代理商名称列表
|
||||||
* @return 代理商名称列表
|
* @return 代理商名称列表
|
||||||
*/
|
*/
|
||||||
List<String> getAgentName();
|
List<String> getAgentName();
|
||||||
|
|
||||||
|
/**
|
||||||
|
* 根据手机号获取代理商数量
|
||||||
|
* @param phone 手机号
|
||||||
|
* @return 代理商数量
|
||||||
|
*/
|
||||||
|
long getCountByPhone(String phone);
|
||||||
}
|
}
|
||||||
@ -9,6 +9,7 @@ import com.seer.teach.user.api.UserInfoServiceApi;
|
|||||||
import com.seer.teach.user.api.dto.UserInfoDTO;
|
import com.seer.teach.user.api.dto.UserInfoDTO;
|
||||||
import lombok.RequiredArgsConstructor;
|
import lombok.RequiredArgsConstructor;
|
||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@ -42,8 +43,20 @@ public class MpAgentServiceImpl extends ServiceImpl<MpAgentMapper, MpAgentEntity
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Boolean updateAgent(MpAgentEntity agentEntity) {
|
public Boolean updateAgent(MpAgentEntity agent,String password) {
|
||||||
return this.updateById(agentEntity);
|
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
|
@Override
|
||||||
@ -51,4 +64,9 @@ public class MpAgentServiceImpl extends ServiceImpl<MpAgentMapper, MpAgentEntity
|
|||||||
List<MpAgentEntity> list = this.list();
|
List<MpAgentEntity> list = this.list();
|
||||||
return list.stream().map(MpAgentEntity::getAgentName).toList();
|
return list.stream().map(MpAgentEntity::getAgentName).toList();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public long getCountByPhone(String phone) {
|
||||||
|
return this.lambdaQuery().eq(MpAgentEntity::getContactPhone, phone).count();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
@ -336,10 +336,7 @@ public class UserInfoServiceApiImpl implements UserInfoServiceApi {
|
|||||||
log.info("准备删除角色记录,ID列表: {}", ids);
|
log.info("准备删除角色记录,ID列表: {}", ids);
|
||||||
boolean result = userRoleService.removeByIds(ids);
|
boolean result = userRoleService.removeByIds(ids);
|
||||||
log.info("删除角色结果: {}", result);
|
log.info("删除角色结果: {}", result);
|
||||||
// 删除用户信息
|
return result;
|
||||||
boolean userResult = userService.removeByIds(userIds);
|
|
||||||
log.info("删除用户信息结果: {}", userResult);
|
|
||||||
return result && userResult;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user