fix: 首页统计和进展条数

This commit is contained in:
caiyuchao
2025-09-04 18:22:27 +08:00
parent 8bcd0744f5
commit f544f4f618
2 changed files with 7 additions and 4 deletions

View File

@@ -26,8 +26,10 @@ import org.springframework.validation.annotation.Validated;
import java.math.BigDecimal;
import java.math.RoundingMode;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.LinkedHashMap;
import java.util.List;
import java.util.stream.Collectors;
import static org.agt.framework.common.exception.util.ServiceExceptionUtil.exception;
import static org.agt.module.license.enums.ErrorCodeConstants.CUSTOMER_CODE_DUPLICATE;
@@ -56,9 +58,10 @@ public class CustomerServiceImpl implements CustomerService {
@Override
public DashboardRespVO dashboard() {
Long customerCount = customerMapper.selectCount(Wrappers.<CustomerDO>lambdaQuery().ne(CustomerDO::getName, "AGT"));
CustomerDO customerDO = customerMapper.selectOne(Wrappers.<CustomerDO>lambdaQuery().eq(CustomerDO::getName, "AGT"), false);
Long projectCount = projectMapper.selectCount(Wrappers.<ProjectDO>lambdaQuery().ne(customerDO != null, ProjectDO::getCustomerId, customerDO.getId()));
Long customerCount = customerMapper.selectCount(Wrappers.<CustomerDO>lambdaQuery().notIn(CustomerDO::getName, Arrays.asList("AGT", "BA", "Blue Arcus")));
List<CustomerDO> customerDOS = customerMapper.selectList(Wrappers.<CustomerDO>lambdaQuery().in(CustomerDO::getName, Arrays.asList("AGT", "BA", "Blue Arcus")));
List<Long> customerIds = customerDOS.stream().map(CustomerDO::getId).collect(Collectors.toList());
Long projectCount = projectMapper.selectCount(Wrappers.<ProjectDO>lambdaQuery().notIn(CollUtil.isNotEmpty(customerIds), ProjectDO::getCustomerId, customerIds));
Long contractCount = projectMapper.selectCount(Wrappers.<ProjectDO>lambdaQuery().ne(ProjectDO::getContractCode, "0"));
Long licenseCount = licenseMapper.selectCount();
DashboardRespVO dashboardRespVO = new DashboardRespVO();

View File

@@ -65,9 +65,9 @@
LEFT JOIN system_users u3 ON p.technical_owner_a = u3.id
AND u3.deleted = 0
where p.deleted = 0
and c.update_time >= DATE_SUB(CURDATE(), INTERVAL 1 WEEK)
ORDER BY
c.update_time DESC
LIMIT 10
</select>
</mapper>