|
|
@@ -11,11 +11,13 @@ import cn.com.yusys.yusp.mapper.AitagTagLogDao;
|
|
|
import cn.com.yusys.yusp.domain.entity.AitagTagLogEntity;
|
|
|
import cn.com.yusys.yusp.service.AitagTagLogService;
|
|
|
import com.alibaba.fastjson.JSONArray;
|
|
|
+import com.alibaba.fastjson.JSONObject;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.baomidou.mybatisplus.core.metadata.IPage;
|
|
|
import com.baomidou.mybatisplus.core.toolkit.StringUtils;
|
|
|
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
|
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
|
|
+import lombok.extern.slf4j.Slf4j;
|
|
|
import org.apache.commons.io.output.UnsynchronizedByteArrayOutputStream;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
@@ -37,6 +39,7 @@ import static cn.com.yusys.yusp.config.DataDictionary.*;
|
|
|
*/
|
|
|
|
|
|
@Service("aitagTagLogService")
|
|
|
+@Slf4j
|
|
|
public class AitagTagLogServiceImpl extends ServiceImpl<AitagTagLogDao, AitagTagLogEntity> implements AitagTagLogService {
|
|
|
|
|
|
@Autowired
|
|
|
@@ -48,34 +51,35 @@ public class AitagTagLogServiceImpl extends ServiceImpl<AitagTagLogDao, AitagTag
|
|
|
@Override
|
|
|
public DataOverviewVo dataOverview(SmartTaggingResultVo taggingResult) {
|
|
|
DataOverviewVo dataOverview = new DataOverviewVo();
|
|
|
+
|
|
|
Integer totalCnt = this.baseMapper.selectTagCount(taggingResult);
|
|
|
+ log.info("查询出符合条件的全部打标数据:{} 条",totalCnt);
|
|
|
dataOverview.setCountNum(totalCnt);
|
|
|
|
|
|
LambdaQueryWrapper<AitagTagLogEntity> queryCount = new LambdaQueryWrapper<>();
|
|
|
- LambdaQueryWrapper<AitagTagLogEntity> queryAgreeTags = new LambdaQueryWrapper<>();
|
|
|
if (StringUtils.isNotBlank(taggingResult.getCategoryCode())) {
|
|
|
queryCount.eq(AitagTagLogEntity::getCategoryCode, taggingResult.getCategoryCode());
|
|
|
- queryAgreeTags.eq(AitagTagLogEntity::getCategoryCode, taggingResult.getCategoryCode());
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(taggingResult.getStartTaggingTime())){
|
|
|
queryCount.ge(AitagTagLogEntity::getInsertTime, taggingResult.getStartTaggingTime());
|
|
|
- queryAgreeTags.ge(AitagTagLogEntity::getInsertTime, taggingResult.getStartTaggingTime());
|
|
|
}
|
|
|
if (StringUtils.isNotBlank(taggingResult.getEndTaggingTime())){
|
|
|
queryCount.le(AitagTagLogEntity::getInsertTime, taggingResult.getEndTaggingTime());
|
|
|
- queryAgreeTags.le(AitagTagLogEntity::getInsertTime, taggingResult.getEndTaggingTime());
|
|
|
}
|
|
|
queryCount.in(AitagTagLogEntity::getState, DataDictionary.RESULT_PUSHED,DataDictionary.MANAGER_CONFIRMED);
|
|
|
- queryAgreeTags.in(AitagTagLogEntity::getState, DataDictionary.RESULT_PUSHED,DataDictionary.MANAGER_CONFIRMED);
|
|
|
-
|
|
|
+ queryCount.eq(AitagTagLogEntity::getTagScope, PROD_DATA);
|
|
|
Integer totalConfirmedCnt = this.baseMapper.selectCount(queryCount);
|
|
|
+ log.info("查询出符合条件的打标完成数据:{} 条",totalConfirmedCnt);
|
|
|
+ dataOverview.setAccurateNum(totalConfirmedCnt);
|
|
|
|
|
|
- queryAgreeTags.eq(AitagTagLogEntity::getFeedback,FEEDBACK_RESULT_AGREE);
|
|
|
- Integer agreeTagNum = this.baseMapper.selectCount(queryAgreeTags);
|
|
|
- BigDecimal accurateRate = calculateAccuracy(agreeTagNum, totalConfirmedCnt);
|
|
|
+ queryCount.eq(AitagTagLogEntity::getFeedback,FEEDBACK_RESULT_AGREE);
|
|
|
+ Integer agreeTagNum = this.baseMapper.selectCount(queryCount);
|
|
|
+ log.info("查询出符合条件的打标准确数据:{} 条",agreeTagNum);
|
|
|
|
|
|
- dataOverview.setAccurateNum(totalConfirmedCnt);
|
|
|
+ BigDecimal accurateRate = calculateAccuracy(agreeTagNum, totalConfirmedCnt);
|
|
|
+ log.info("计算出准确率:{} 条",accurateRate);
|
|
|
dataOverview.setAccurateRate(accurateRate+"%");
|
|
|
+
|
|
|
if(totalConfirmedCnt == 0){
|
|
|
dataOverview.setManualAdjustRate("0%");
|
|
|
}else{
|
|
|
@@ -84,6 +88,7 @@ public class AitagTagLogServiceImpl extends ServiceImpl<AitagTagLogDao, AitagTag
|
|
|
}
|
|
|
dataOverview.setManualAdjustCount(totalConfirmedCnt-agreeTagNum);
|
|
|
dataOverview.setTaggedUnconfirmed(totalCnt-totalConfirmedCnt);
|
|
|
+ log.info("准备返回数据为:{} ", JSONObject.toJSONString(dataOverview));
|
|
|
return dataOverview;
|
|
|
}
|
|
|
|
|
|
@@ -117,6 +122,7 @@ public class AitagTagLogServiceImpl extends ServiceImpl<AitagTagLogDao, AitagTag
|
|
|
if (StringUtils.isNotBlank(transactionReqVo.getLoanApplicationNo())){
|
|
|
queryWrapper.le(AitagTagLogEntity::getBusinessAttr, transactionReqVo.getLoanApplicationNo());
|
|
|
}
|
|
|
+ queryWrapper.eq(AitagTagLogEntity::getTagScope, PROD_DATA);
|
|
|
|
|
|
return this.page(new Page<>(transactionReqVo.getPage() == null?0:transactionReqVo.getPage(),
|
|
|
transactionReqVo.getSize() == null?10:transactionReqVo.getSize()),queryWrapper);
|
|
|
@@ -177,6 +183,7 @@ public class AitagTagLogServiceImpl extends ServiceImpl<AitagTagLogDao, AitagTag
|
|
|
if (StringUtils.isNotBlank(transactionReqVo.getLoanApplicationNo())){
|
|
|
queryCount.le(AitagTagLogEntity::getBusinessAttr, transactionReqVo.getLoanApplicationNo());
|
|
|
}
|
|
|
+ queryCount.eq(AitagTagLogEntity::getTagScope, PROD_DATA);
|
|
|
return this.baseMapper.selectList(queryCount);
|
|
|
}
|
|
|
|