修正风险仪表盘总人数员工匹配口径
This commit is contained in:
@@ -38,4 +38,6 @@ public interface CcdiBankStatementMapper extends BaseMapper<CcdiBankStatement> {
|
||||
CcdiBankStatementDetailVO selectStatementDetailById(@Param("bankStatementId") Long bankStatementId);
|
||||
|
||||
CcdiBankStatementFilterOptionsVO selectFilterOptions(@Param("projectId") Long projectId);
|
||||
|
||||
Integer countMatchedStaffCountByProjectId(@Param("projectId") Long projectId);
|
||||
}
|
||||
|
||||
@@ -2,7 +2,6 @@ package com.ruoyi.ccdi.project.service.impl;
|
||||
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ruoyi.ccdi.project.domain.CcdiProject;
|
||||
import com.ruoyi.ccdi.project.domain.enums.TriggerType;
|
||||
@@ -954,13 +953,7 @@ public class CcdiFileUploadServiceImpl implements ICcdiFileUploadService {
|
||||
return;
|
||||
}
|
||||
|
||||
QueryWrapper<CcdiBankStatement> queryWrapper = new QueryWrapper<>();
|
||||
queryWrapper.select("DISTINCT TRIM(cret_no)");
|
||||
queryWrapper.eq("project_id", projectId);
|
||||
queryWrapper.isNotNull("cret_no");
|
||||
queryWrapper.apply("TRIM(cret_no) <> ''");
|
||||
|
||||
int targetCount = bankStatementMapper.selectObjs(queryWrapper).size();
|
||||
int targetCount = bankStatementMapper.countMatchedStaffCountByProjectId(projectId);
|
||||
project.setTargetCount(targetCount);
|
||||
projectMapper.updateById(project);
|
||||
}
|
||||
|
||||
@@ -115,6 +115,15 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
select="selectOurAccountOptions"/>
|
||||
</resultMap>
|
||||
|
||||
<select id="countMatchedStaffCountByProjectId" resultType="java.lang.Integer">
|
||||
select count(distinct trim(bs.cret_no))
|
||||
from ccdi_bank_statement bs
|
||||
inner join ccdi_base_staff staff on staff.id_card = bs.cret_no
|
||||
where bs.project_id = #{projectId}
|
||||
and bs.cret_no is not null
|
||||
and trim(bs.cret_no) != ''
|
||||
</select>
|
||||
|
||||
<sql id="parsedTrxDateExpr">
|
||||
CASE
|
||||
WHEN bs.TRX_DATE IS NULL OR TRIM(bs.TRX_DATE) = '' THEN NULL
|
||||
|
||||
@@ -287,7 +287,7 @@ class CcdiFileUploadServiceImplTest {
|
||||
CcdiProject project = new CcdiProject();
|
||||
project.setProjectId(PROJECT_ID);
|
||||
when(projectMapper.selectById(PROJECT_ID)).thenReturn(project);
|
||||
when(bankStatementMapper.selectObjs(any())).thenReturn(List.of("110101199001018888"));
|
||||
when(bankStatementMapper.countMatchedStaffCountByProjectId(PROJECT_ID)).thenReturn(1);
|
||||
|
||||
when(lsfxClient.uploadFile(eq(LSFX_PROJECT_ID), any())).thenReturn(buildUploadResponse());
|
||||
when(lsfxClient.checkParseStatus(LSFX_PROJECT_ID, String.valueOf(LOG_ID)))
|
||||
@@ -375,7 +375,7 @@ class CcdiFileUploadServiceImplTest {
|
||||
when(recordMapper.selectById(RECORD_ID)).thenReturn(record);
|
||||
when(lsfxClient.deleteFiles(any())).thenReturn(buildDeleteFilesResponse());
|
||||
when(projectMapper.selectById(PROJECT_ID)).thenReturn(project);
|
||||
when(bankStatementMapper.selectObjs(any())).thenReturn(List.of("110101199001018888", "110101199001019999"));
|
||||
when(bankStatementMapper.countMatchedStaffCountByProjectId(PROJECT_ID)).thenReturn(2);
|
||||
when(recordMapper.updateById(any(CcdiFileUploadRecord.class))).thenReturn(1);
|
||||
|
||||
String result = service.deleteFileUploadRecord(RECORD_ID, 9527L);
|
||||
@@ -562,14 +562,11 @@ class CcdiFileUploadServiceImplTest {
|
||||
}
|
||||
|
||||
@Test
|
||||
void refreshProjectTargetCount_shouldUpdateProjectWithDistinctIdCardCount() {
|
||||
void refreshProjectTargetCount_shouldUseMatchedStaffCountOnly() {
|
||||
CcdiProject project = new CcdiProject();
|
||||
project.setProjectId(PROJECT_ID);
|
||||
when(projectMapper.selectById(PROJECT_ID)).thenReturn(project);
|
||||
when(bankStatementMapper.selectObjs(any())).thenReturn(List.of(
|
||||
"110101199001018888",
|
||||
"110101199001019999"
|
||||
));
|
||||
when(bankStatementMapper.countMatchedStaffCountByProjectId(PROJECT_ID)).thenReturn(2);
|
||||
|
||||
ReflectionTestUtils.invokeMethod(service, "refreshProjectTargetCount", PROJECT_ID);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user