|
|
|
@ -1,6 +1,5 @@
|
|
|
|
|
package com.hnac.gglm.bigmodel.maintenance.service.impl; |
|
|
|
|
|
|
|
|
|
import com.baomidou.dynamic.datasource.annotation.DS; |
|
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
|
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage; |
|
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
@ -13,8 +12,11 @@ import com.hnac.gglm.bigmodel.maintenance.vo.LabelRequest;
|
|
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
|
import org.springblade.core.tool.api.R; |
|
|
|
|
import org.springblade.core.tool.utils.ObjectUtil; |
|
|
|
|
import org.springblade.core.tool.utils.StringUtil; |
|
|
|
|
import org.springblade.system.user.entity.User; |
|
|
|
|
import org.springblade.system.user.feign.IUserClient; |
|
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
import java.util.Date; |
|
|
|
@ -26,8 +28,8 @@ import java.util.Date;
|
|
|
|
|
@Service |
|
|
|
|
@Slf4j |
|
|
|
|
@AllArgsConstructor |
|
|
|
|
@DS("hznlm") |
|
|
|
|
public class AgentLogServiceImpl extends ServiceImpl<AgentLogMapper, AgentLogEntity> implements AgentLogService { |
|
|
|
|
private final IUserClient userClient; |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public Boolean BatchLabel(IdsRequest ids) { |
|
|
|
@ -35,7 +37,7 @@ public class AgentLogServiceImpl extends ServiceImpl<AgentLogMapper, AgentLogEnt
|
|
|
|
|
return this.update(Wrappers.<AgentLogEntity>lambdaUpdate() |
|
|
|
|
.set(AgentLogEntity::getLabelStatus, 1) |
|
|
|
|
.set(AgentLogEntity::getLabelResult, 1) |
|
|
|
|
.set(AgentLogEntity::getLabelOperator, AuthUtil.getUserName()) |
|
|
|
|
.set(AgentLogEntity::getLabelOperatorId, AuthUtil.getUserId()) |
|
|
|
|
.set(AgentLogEntity::getLabelTime, now) |
|
|
|
|
.set(AgentLogEntity::getUpdateTime, now) |
|
|
|
|
.in(AgentLogEntity::getId, ids.getIds())); |
|
|
|
@ -51,7 +53,7 @@ public class AgentLogServiceImpl extends ServiceImpl<AgentLogMapper, AgentLogEnt
|
|
|
|
|
.set(AgentLogEntity::getLabelStatus, 1) |
|
|
|
|
.set(AgentLogEntity::getLabelResult, labelResult) |
|
|
|
|
.set(StringUtil.isNotBlank(req.getLabelContent()), AgentLogEntity::getLabelContent, req.getLabelContent()) |
|
|
|
|
.set(AgentLogEntity::getLabelOperator, AuthUtil.getUserAccount()) |
|
|
|
|
.set(AgentLogEntity::getLabelOperatorId, AuthUtil.getUserId()) |
|
|
|
|
.set(AgentLogEntity::getLabelTime, now) |
|
|
|
|
.set(AgentLogEntity::getUpdateTime, now) |
|
|
|
|
.eq(AgentLogEntity::getId, req.getId())); |
|
|
|
@ -70,7 +72,29 @@ public class AgentLogServiceImpl extends ServiceImpl<AgentLogMapper, AgentLogEnt
|
|
|
|
|
.eq(ObjectUtil.isNotEmpty(req.getLabelStatus()), AgentLogEntity::getLabelStatus, req.getLabelStatus()) |
|
|
|
|
.orderByAsc(AgentLogEntity::getCreateTime) |
|
|
|
|
.orderByAsc(AgentLogEntity::getChatId); |
|
|
|
|
return this.page(page, queryWrapper); |
|
|
|
|
IPage<AgentLogEntity> pageResult = baseMapper.selectPage(page, queryWrapper); |
|
|
|
|
pageResult.getRecords().forEach(item -> { |
|
|
|
|
String userIdStr = item.getLabelOperatorId(); |
|
|
|
|
String userName = getUsername(userIdStr); |
|
|
|
|
item.setLabelOperator(userName == null ? userIdStr : userName); |
|
|
|
|
}); |
|
|
|
|
return pageResult; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
public String getUsername(String userIdStr) { |
|
|
|
|
String userName = null; |
|
|
|
|
if (null != userIdStr) { |
|
|
|
|
try { |
|
|
|
|
Long userId = Long.parseLong(userIdStr); |
|
|
|
|
R<User> userR = userClient.userInfoById(userId); |
|
|
|
|
if (userR.isSuccess() && userR.getData() != null) { |
|
|
|
|
userName = userR.getData().getName(); |
|
|
|
|
} |
|
|
|
|
} catch (Exception ignore) { |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
return userName; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
} |
|
|
|
|