|
|
@ -1,16 +1,24 @@ |
|
|
|
package com.hnac.hzims.bigmodel.maintenance.service.impl; |
|
|
|
package com.hnac.hzims.bigmodel.maintenance.service.impl; |
|
|
|
|
|
|
|
|
|
|
|
import com.baomidou.dynamic.datasource.annotation.DS; |
|
|
|
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; |
|
|
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; |
|
|
|
import com.hnac.hzims.bigmodel.maintenance.entity.AgentLogEntity; |
|
|
|
import com.hnac.hzims.bigmodel.maintenance.entity.AgentLogEntity; |
|
|
|
import com.hnac.hzims.bigmodel.maintenance.mapper.AgentLogMapper; |
|
|
|
import com.hnac.hzims.bigmodel.maintenance.mapper.AgentLogMapper; |
|
|
|
import com.hnac.hzims.bigmodel.maintenance.service.AgentLogService; |
|
|
|
import com.hnac.hzims.bigmodel.maintenance.service.AgentLogService; |
|
|
|
import com.hnac.hzims.bigmodel.maintenance.vo.IdsRequest; |
|
|
|
import com.hnac.hzims.bigmodel.maintenance.vo.IdsRequest; |
|
|
|
|
|
|
|
import com.hnac.hzims.bigmodel.maintenance.vo.LabelRequest; |
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
import lombok.AllArgsConstructor; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
import lombok.extern.slf4j.Slf4j; |
|
|
|
|
|
|
|
import org.springblade.core.secure.utils.AuthUtil; |
|
|
|
|
|
|
|
import org.springblade.core.tool.utils.ObjectUtil; |
|
|
|
|
|
|
|
import org.springblade.core.tool.utils.StringUtil; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
import org.springframework.stereotype.Service; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.util.Date; |
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
/** |
|
|
|
* @Author: ypj |
|
|
|
* @Author: ypj |
|
|
|
* @Date: 2024/9/9 11:10 |
|
|
|
* @Date: 2024/9/9 11:10 |
|
|
@ -21,11 +29,47 @@ import org.springframework.stereotype.Service; |
|
|
|
@DS("hznlm") |
|
|
|
@DS("hznlm") |
|
|
|
public class AgentLogServiceImpl extends ServiceImpl<AgentLogMapper, AgentLogEntity> implements AgentLogService { |
|
|
|
public class AgentLogServiceImpl extends ServiceImpl<AgentLogMapper, AgentLogEntity> implements AgentLogService { |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
@Override |
|
|
|
public Boolean BatchLabel(IdsRequest ids) { |
|
|
|
public Boolean BatchLabel(IdsRequest ids) { |
|
|
|
|
|
|
|
Date now = new Date(); |
|
|
|
return this.update(Wrappers.<AgentLogEntity>lambdaUpdate() |
|
|
|
return this.update(Wrappers.<AgentLogEntity>lambdaUpdate() |
|
|
|
.set(AgentLogEntity::getLabelStatus, 1) |
|
|
|
.set(AgentLogEntity::getLabelStatus, 1) |
|
|
|
|
|
|
|
.set(AgentLogEntity::getLabelResult, 1) |
|
|
|
|
|
|
|
.set(AgentLogEntity::getLabelOperator, AuthUtil.getUserName()) |
|
|
|
|
|
|
|
.set(AgentLogEntity::getLabelTime, now) |
|
|
|
|
|
|
|
.set(AgentLogEntity::getUpdateTime, now) |
|
|
|
.in(AgentLogEntity::getId, ids.getIds())); |
|
|
|
.in(AgentLogEntity::getId, ids.getIds())); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public Boolean label(LabelRequest req) { |
|
|
|
|
|
|
|
AgentLogEntity entity = this.getById(req.getId()); |
|
|
|
|
|
|
|
if (entity != null) { |
|
|
|
|
|
|
|
int labelResult = StringUtil.isBlank(req.getLabelContent()) || req.getLabelContent().equals(entity.getA()) ? 1 : 0; |
|
|
|
|
|
|
|
Date now = new Date(); |
|
|
|
|
|
|
|
return this.update(Wrappers.<AgentLogEntity>lambdaUpdate() |
|
|
|
|
|
|
|
.set(AgentLogEntity::getLabelStatus, 1) |
|
|
|
|
|
|
|
.set(AgentLogEntity::getLabelResult, labelResult) |
|
|
|
|
|
|
|
.set(StringUtil.isNotBlank(req.getLabelContent()), AgentLogEntity::getLabelContent, req.getLabelContent()) |
|
|
|
|
|
|
|
.set(AgentLogEntity::getLabelOperator, AuthUtil.getUserName()) |
|
|
|
|
|
|
|
.set(AgentLogEntity::getLabelTime, now) |
|
|
|
|
|
|
|
.set(AgentLogEntity::getUpdateTime, now) |
|
|
|
|
|
|
|
.eq(AgentLogEntity::getId, req.getId())); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@Override |
|
|
|
|
|
|
|
public IPage<AgentLogEntity> listPage(IPage<AgentLogEntity> page, AgentLogEntity req) { |
|
|
|
|
|
|
|
LambdaQueryWrapper<AgentLogEntity> queryWrapper = Wrappers.<AgentLogEntity>lambdaQuery() |
|
|
|
|
|
|
|
.eq(ObjectUtil.isNotEmpty(req.getId()), AgentLogEntity::getId, req.getId()) |
|
|
|
|
|
|
|
.eq(ObjectUtil.isNotEmpty(req.getChatId()), AgentLogEntity::getChatId, req.getChatId()) |
|
|
|
|
|
|
|
.eq(ObjectUtil.isNotEmpty(req.getQId()), AgentLogEntity::getQId, req.getQId()) |
|
|
|
|
|
|
|
.eq(ObjectUtil.isNotEmpty(req.getModelName()), AgentLogEntity::getModelName, req.getModelName()) |
|
|
|
|
|
|
|
.orderByDesc(AgentLogEntity::getCreateTime) |
|
|
|
|
|
|
|
.orderByAsc(AgentLogEntity::getChatId); |
|
|
|
|
|
|
|
return this.page(page, queryWrapper); |
|
|
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|