feat: 项目管理负责人查询

This commit is contained in:
caiyuchao
2025-05-28 10:16:09 +08:00
parent ba9132e3c4
commit 4b7cc83f15
8 changed files with 102 additions and 30 deletions

View File

@@ -30,6 +30,7 @@ import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
import java.io.IOException; import java.io.IOException;
import java.util.List;
import static org.agt.framework.apilog.core.enums.OperateTypeEnum.EXPORT; import static org.agt.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
import static org.agt.framework.common.pojo.CommonResult.success; import static org.agt.framework.common.pojo.CommonResult.success;
@@ -108,6 +109,14 @@ public class CustomerController {
return success(buildCustomerVOList(pageResult)); return success(buildCustomerVOList(pageResult));
} }
@GetMapping("/list")
@Operation(summary = "获得客户分页")
@PreAuthorize("@ss.hasPermission('license:customer:query')")
public CommonResult<List<CustomerRespVO>> getCustomerList() {
List<CustomerDO> listResult = customerService.getCustomerList();
return success(BeanUtils.toBean(listResult, CustomerRespVO.class));
}
@GetMapping("/export-excel") @GetMapping("/export-excel")
@Operation(summary = "导出客户 Excel") @Operation(summary = "导出客户 Excel")
@PreAuthorize("@ss.hasPermission('license:customer:export')") @PreAuthorize("@ss.hasPermission('license:customer:export')")

View File

@@ -1,33 +1,39 @@
package org.agt.module.license.controller.admin.project; package org.agt.module.license.controller.admin.project;
import org.springframework.web.bind.annotation.*;
import jakarta.annotation.Resource;
import org.springframework.validation.annotation.Validated;
import org.springframework.security.access.prepost.PreAuthorize;
import io.swagger.v3.oas.annotations.tags.Tag;
import io.swagger.v3.oas.annotations.Parameter;
import io.swagger.v3.oas.annotations.Operation; import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import jakarta.validation.constraints.*; import io.swagger.v3.oas.annotations.tags.Tag;
import jakarta.validation.*; import jakarta.annotation.Resource;
import jakarta.servlet.http.*; import jakarta.servlet.http.HttpServletResponse;
import java.util.*; import jakarta.validation.Valid;
import java.io.IOException; import org.agt.framework.apilog.core.annotation.ApiAccessLog;
import org.agt.framework.common.pojo.CommonResult;
import org.agt.framework.common.pojo.PageParam; import org.agt.framework.common.pojo.PageParam;
import org.agt.framework.common.pojo.PageResult; import org.agt.framework.common.pojo.PageResult;
import org.agt.framework.common.pojo.CommonResult;
import org.agt.framework.common.util.object.BeanUtils; import org.agt.framework.common.util.object.BeanUtils;
import static org.agt.framework.common.pojo.CommonResult.success;
import org.agt.framework.excel.core.util.ExcelUtils; import org.agt.framework.excel.core.util.ExcelUtils;
import org.agt.framework.translate.core.TranslateUtils;
import org.agt.framework.apilog.core.annotation.ApiAccessLog; import org.agt.module.license.controller.admin.project.vo.ProjectPageReqVO;
import static org.agt.framework.apilog.core.enums.OperateTypeEnum.*; 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.*;
import org.agt.module.license.dal.dataobject.project.ProjectDO; import org.agt.module.license.dal.dataobject.project.ProjectDO;
import org.agt.module.license.service.project.ProjectService; import org.agt.module.license.service.project.ProjectService;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;
import java.io.IOException;
import java.util.List;
import static org.agt.framework.apilog.core.enums.OperateTypeEnum.EXPORT;
import static org.agt.framework.common.pojo.CommonResult.success;
@Tag(name = "管理后台 - 项目") @Tag(name = "管理后台 - 项目")
@RestController @RestController
@@ -89,7 +95,7 @@ public class ProjectController {
List<ProjectDO> list = projectService.getProjectPage(pageReqVO).getList(); List<ProjectDO> list = projectService.getProjectPage(pageReqVO).getList();
// 导出 Excel // 导出 Excel
ExcelUtils.write(response, "项目.xls", "数据", ProjectRespVO.class, ExcelUtils.write(response, "项目.xls", "数据", ProjectRespVO.class,
BeanUtils.toBean(list, ProjectRespVO.class)); TranslateUtils.translate(BeanUtils.toBean(list, ProjectRespVO.class)));
} }
} }

View File

@@ -2,22 +2,35 @@ package org.agt.module.license.controller.admin.project.vo;
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated; import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
import com.alibaba.excel.annotation.ExcelProperty; import com.alibaba.excel.annotation.ExcelProperty;
import com.fhs.core.trans.anno.Trans;
import com.fhs.core.trans.constant.TransType;
import com.fhs.core.trans.vo.VO;
import io.swagger.v3.oas.annotations.media.Schema; import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data; import lombok.Data;
import org.agt.framework.excel.core.annotations.DictFormat; import org.agt.framework.excel.core.annotations.DictFormat;
import org.agt.framework.excel.core.convert.DictConvert; import org.agt.framework.excel.core.convert.DictConvert;
import org.agt.module.license.dal.dataobject.customer.CustomerDO;
import org.agt.module.system.api.user.AdminUserApi;
import java.time.LocalDateTime; import java.time.LocalDateTime;
@Schema(description = "管理后台 - 项目 Response VO") @Schema(description = "管理后台 - 项目 Response VO")
@Data @Data
@ExcelIgnoreUnannotated @ExcelIgnoreUnannotated
public class ProjectRespVO { public class ProjectRespVO implements VO {
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "25585") @Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "25585")
@ExcelProperty("主键") @ExcelProperty("主键")
private Long id; private Long id;
@Schema(description = "客户ID")
@Trans(type = TransType.SIMPLE, target = CustomerDO.class, fields = "name", ref = "customerName")
private Long customerId;
@Schema(description = "所属客户")
@ExcelProperty("所属客户")
private String customerName;
@Schema(description = "项目名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "aa") @Schema(description = "项目名称", requiredMode = Schema.RequiredMode.REQUIRED, example = "aa")
@ExcelProperty("项目名称") @ExcelProperty("项目名称")
private String name; private String name;
@@ -35,25 +48,46 @@ public class ProjectRespVO {
@DictFormat("lic_business_status") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中 @DictFormat("lic_business_status") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
private Integer businessStatus; private Integer businessStatus;
@Schema(description = "业务负责人ID", requiredMode = Schema.RequiredMode.REQUIRED)
@Trans(type = TransType.AUTO_TRANS, key = AdminUserApi.PREFIX, fields = "nickname", ref = "businessOwnerName")
private Long businessOwner;
@Schema(description = "客户对接人ID", requiredMode = Schema.RequiredMode.REQUIRED)
@Trans(type = TransType.AUTO_TRANS, key = AdminUserApi.PREFIX, fields = "nickname", ref = "customerOwnerName")
private Long customerOwner;
@Schema(description = "技术负责人1ID", requiredMode = Schema.RequiredMode.REQUIRED)
@Trans(type = TransType.AUTO_TRANS, key = AdminUserApi.PREFIX, fields = "nickname", ref = "technicalOwnerAName")
private Long technicalOwnerA;
@Schema(description = "技术负责人2ID")
@Trans(type = TransType.AUTO_TRANS, key = AdminUserApi.PREFIX, fields = "nickname", ref = "technicalOwnerBName")
private Long technicalOwnerB;
@Schema(description = "技术负责人3ID")
@Trans(type = TransType.AUTO_TRANS, key = AdminUserApi.PREFIX, fields = "nickname", ref = "technicalOwnerCName")
private Long technicalOwnerC;
@Schema(description = "业务负责人", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "业务负责人", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("业务负责人") @ExcelProperty("业务负责人")
private Long businessOwner; private String businessOwnerName;
@Schema(description = "客户对接人", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "客户对接人", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("客户对接人") @ExcelProperty("客户对接人")
private Long customerOwner; private String customerOwnerName;
@Schema(description = "技术负责人1", requiredMode = Schema.RequiredMode.REQUIRED) @Schema(description = "技术负责人1", requiredMode = Schema.RequiredMode.REQUIRED)
@ExcelProperty("技术负责人1") @ExcelProperty("技术负责人1")
private Long technicalOwnerA; private String technicalOwnerAName;
@Schema(description = "技术负责人2") @Schema(description = "技术负责人2")
@ExcelProperty("技术负责人2") @ExcelProperty("技术负责人2")
private Long technicalOwnerB; private String technicalOwnerBName;
@Schema(description = "技术负责人3") @Schema(description = "技术负责人3")
@ExcelProperty("技术负责人3") @ExcelProperty("技术负责人3")
private Long technicalOwnerC; private String technicalOwnerCName;
@Schema(description = "项目开始时间") @Schema(description = "项目开始时间")
@ExcelProperty("项目开始时间") @ExcelProperty("项目开始时间")

View File

@@ -7,6 +7,8 @@ import org.agt.module.license.controller.admin.customer.vo.CustomerPageReqVO;
import org.agt.module.license.dal.dataobject.customer.CustomerDO; import org.agt.module.license.dal.dataobject.customer.CustomerDO;
import org.apache.ibatis.annotations.Mapper; import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/** /**
* 客户 Mapper * 客户 Mapper
* *
@@ -26,6 +28,10 @@ public interface CustomerMapper extends BaseMapperX<CustomerDO> {
.orderByDesc(CustomerDO::getId)); .orderByDesc(CustomerDO::getId));
} }
default List<CustomerDO> selectList() {
return selectList(new LambdaQueryWrapperX<CustomerDO>().orderByDesc(CustomerDO::getId));
}
default CustomerDO selectByName(String name) { default CustomerDO selectByName(String name) {
return selectOne(CustomerDO::getName, name); return selectOne(CustomerDO::getName, name);
} }

View File

@@ -6,6 +6,8 @@ import org.agt.module.license.controller.admin.customer.vo.CustomerPageReqVO;
import org.agt.module.license.controller.admin.customer.vo.CustomerSaveReqVO; import org.agt.module.license.controller.admin.customer.vo.CustomerSaveReqVO;
import org.agt.module.license.dal.dataobject.customer.CustomerDO; import org.agt.module.license.dal.dataobject.customer.CustomerDO;
import java.util.List;
/** /**
* 客户 Service 接口 * 客户 Service 接口
* *
@@ -51,6 +53,13 @@ public interface CustomerService {
*/ */
PageResult<CustomerDO> getCustomerPage(CustomerPageReqVO pageReqVO); PageResult<CustomerDO> getCustomerPage(CustomerPageReqVO pageReqVO);
/**
* 获得客户列表
*
* @return 客户分页
*/
List<CustomerDO> getCustomerList();
/** /**
* 校验客户名称是否唯一 * 校验客户名称是否唯一
* *

View File

@@ -11,6 +11,8 @@ import org.agt.module.license.dal.mysql.customer.CustomerMapper;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.validation.annotation.Validated; import org.springframework.validation.annotation.Validated;
import java.util.List;
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.CUSTOMER_CODE_DUPLICATE; import static org.agt.module.license.enums.ErrorCodeConstants.CUSTOMER_CODE_DUPLICATE;
import static org.agt.module.license.enums.ErrorCodeConstants.CUSTOMER_NAME_DUPLICATE; import static org.agt.module.license.enums.ErrorCodeConstants.CUSTOMER_NAME_DUPLICATE;
@@ -85,6 +87,11 @@ public class CustomerServiceImpl implements CustomerService {
return customerMapper.selectPage(pageReqVO); return customerMapper.selectPage(pageReqVO);
} }
@Override
public List<CustomerDO> getCustomerList() {
return customerMapper.selectList();
}
@Override @Override
public Boolean validateCustomerNameUnique(String name, Long id) { public Boolean validateCustomerNameUnique(String name, Long id) {
if (StrUtil.isBlank(name)) { if (StrUtil.isBlank(name)) {

View File

@@ -71,7 +71,7 @@ mybatis-plus:
logic-delete-value: 1 # 逻辑已删除值(默认为 1) logic-delete-value: 1 # 逻辑已删除值(默认为 1)
logic-not-delete-value: 0 # 逻辑未删除值(默认为 0) logic-not-delete-value: 0 # 逻辑未删除值(默认为 0)
banner: false # 关闭控制台的 Banner 打印 banner: false # 关闭控制台的 Banner 打印
type-aliases-package: ${agt.info.base-package}.module.*.dal.dataobject type-aliases-package: ${agt.info.base-package}.dal.dataobject
encryptor: encryptor:
password: XDV71a+xqStEA3WH # 加解密的秘钥,可使用 https://www.imaegoo.com/2020/aes-key-generator/ 网站生成 password: XDV71a+xqStEA3WH # 加解密的秘钥,可使用 https://www.imaegoo.com/2020/aes-key-generator/ 网站生成

View File

@@ -164,6 +164,7 @@ logging:
org.agt.module.iot.dal.mysql: debug org.agt.module.iot.dal.mysql: debug
org.agt.module.iot.dal.tdengine: DEBUG org.agt.module.iot.dal.tdengine: DEBUG
org.agt.module.ai.dal.mysql: debug org.agt.module.ai.dal.mysql: debug
org.agt.module.license.dal.mysql: debug
org.springframework.context.support.PostProcessorRegistrationDelegate: ERROR # TODO 芋艿先禁用Spring Boot 3.X 存在部分错误的 WARN 提示 org.springframework.context.support.PostProcessorRegistrationDelegate: ERROR # TODO 芋艿先禁用Spring Boot 3.X 存在部分错误的 WARN 提示
debug: false debug: false