fix: 项目管理申请次数和客户查询权限放开
This commit is contained in:
@@ -147,7 +147,7 @@ public class CustomerController {
|
|||||||
|
|
||||||
@GetMapping("/list")
|
@GetMapping("/list")
|
||||||
@Operation(summary = "获得客户列表")
|
@Operation(summary = "获得客户列表")
|
||||||
@PreAuthorize("@ss.hasPermission('license:customer:query')")
|
// @PreAuthorize("@ss.hasPermission('license:customer:query')")
|
||||||
public CommonResult<List<CustomerRespVO>> getCustomerList() {
|
public CommonResult<List<CustomerRespVO>> getCustomerList() {
|
||||||
List<CustomerDO> listResult = customerService.getCustomerList();
|
List<CustomerDO> listResult = customerService.getCustomerList();
|
||||||
|
|
||||||
|
|||||||
@@ -9,7 +9,6 @@ import jakarta.annotation.Resource;
|
|||||||
import lombok.extern.slf4j.Slf4j;
|
import lombok.extern.slf4j.Slf4j;
|
||||||
import org.agt.framework.common.pojo.PageResult;
|
import org.agt.framework.common.pojo.PageResult;
|
||||||
import org.agt.framework.common.util.object.BeanUtils;
|
import org.agt.framework.common.util.object.BeanUtils;
|
||||||
import org.agt.module.license.controller.admin.comment.vo.CommentTreeRespVO;
|
|
||||||
import org.agt.module.license.controller.admin.license.vo.ImportRespVO;
|
import org.agt.module.license.controller.admin.license.vo.ImportRespVO;
|
||||||
import org.agt.module.license.controller.admin.project.vo.ProjectImportRespVO;
|
import org.agt.module.license.controller.admin.project.vo.ProjectImportRespVO;
|
||||||
import org.agt.module.license.controller.admin.project.vo.ProjectListReqVO;
|
import org.agt.module.license.controller.admin.project.vo.ProjectListReqVO;
|
||||||
@@ -17,8 +16,6 @@ import org.agt.module.license.controller.admin.project.vo.ProjectPageReqVO;
|
|||||||
import org.agt.module.license.controller.admin.project.vo.ProjectRespVO;
|
import org.agt.module.license.controller.admin.project.vo.ProjectRespVO;
|
||||||
import org.agt.module.license.controller.admin.project.vo.ProjectSaveReqVO;
|
import org.agt.module.license.controller.admin.project.vo.ProjectSaveReqVO;
|
||||||
import org.agt.module.license.dal.dataobject.customer.CustomerDO;
|
import org.agt.module.license.dal.dataobject.customer.CustomerDO;
|
||||||
import org.agt.module.license.dal.dataobject.license.LicenseDO;
|
|
||||||
import org.agt.module.license.dal.dataobject.license.LicenseHistoryDO;
|
|
||||||
import org.agt.module.license.dal.dataobject.project.ProjectDO;
|
import org.agt.module.license.dal.dataobject.project.ProjectDO;
|
||||||
import org.agt.module.license.dal.mysql.comment.CommentMapper;
|
import org.agt.module.license.dal.mysql.comment.CommentMapper;
|
||||||
import org.agt.module.license.dal.mysql.customer.CustomerMapper;
|
import org.agt.module.license.dal.mysql.customer.CustomerMapper;
|
||||||
@@ -31,7 +28,6 @@ import org.springframework.validation.annotation.Validated;
|
|||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.LinkedHashMap;
|
import java.util.LinkedHashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Optional;
|
|
||||||
|
|
||||||
import static org.agt.framework.common.exception.util.ServiceExceptionUtil.exception;
|
import static org.agt.framework.common.exception.util.ServiceExceptionUtil.exception;
|
||||||
import static org.agt.module.license.enums.ErrorCodeConstants.PROJECT_CODE_DUPLICATE;
|
import static org.agt.module.license.enums.ErrorCodeConstants.PROJECT_CODE_DUPLICATE;
|
||||||
@@ -123,21 +119,6 @@ public class ProjectServiceImpl implements ProjectService {
|
|||||||
}
|
}
|
||||||
IPage<ProjectRespVO> page = projectMapper.queryPage(new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()), pageReqVO);
|
IPage<ProjectRespVO> page = projectMapper.queryPage(new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()), pageReqVO);
|
||||||
|
|
||||||
for (ProjectRespVO record : page.getRecords()) {
|
|
||||||
List<CommentTreeRespVO> comments = commentMapper.getCommentList(record.getId());
|
|
||||||
record.setCommentNum(comments.size());
|
|
||||||
|
|
||||||
List<LicenseDO> licenseList = licenseMapper.selectList(Wrappers.<LicenseDO>lambdaQuery().eq(LicenseDO::getProjectId, record.getId()));
|
|
||||||
Optional<LicenseDO> licenseOptional = licenseList.stream().findFirst();
|
|
||||||
int applyCount = 0;
|
|
||||||
if (licenseOptional.isPresent()) {
|
|
||||||
List<LicenseHistoryDO> historyList = licenseHistoryMapper.selectList(Wrappers.<LicenseHistoryDO>lambdaQuery()
|
|
||||||
.eq(LicenseHistoryDO::getLicenseId, licenseOptional.get().getId()));
|
|
||||||
applyCount = 1 + historyList.size();
|
|
||||||
}
|
|
||||||
record.setApplyCount(applyCount);
|
|
||||||
|
|
||||||
}
|
|
||||||
return new PageResult<>(page.getRecords(), page.getTotal());
|
return new PageResult<>(page.getRecords(), page.getTotal());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -90,7 +90,7 @@
|
|||||||
LEFT JOIN (
|
LEFT JOIN (
|
||||||
SELECT
|
SELECT
|
||||||
l.project_id,
|
l.project_id,
|
||||||
count( lh.id ) + 1 apply_count
|
count( lh.id ) + count(l.serial_no) apply_count
|
||||||
FROM
|
FROM
|
||||||
crm_license_server l
|
crm_license_server l
|
||||||
LEFT JOIN crm_license_server_history lh ON l.id = lh.license_id
|
LEFT JOIN crm_license_server_history lh ON l.id = lh.license_id
|
||||||
|
|||||||
Reference in New Issue
Block a user