fix: 修复可选客户项目、字段名、导出等
This commit is contained in:
@@ -36,6 +36,9 @@ public class CommentTreeRespVO {
|
||||
@Schema(description = "技术负责人1")
|
||||
private String technicalOwnerA;
|
||||
|
||||
@Schema(description = "客户名称")
|
||||
private String customerName;
|
||||
|
||||
@Schema(description = "用户ID", example = "30248")
|
||||
@ExcelProperty("用户ID")
|
||||
private Long userId;
|
||||
|
||||
@@ -209,4 +209,11 @@ public class CustomerController {
|
||||
List<CustomerImportRespVO> list = ExcelUtils.read(file, CustomerImportRespVO.class);
|
||||
return success(customerService.importList(list, updateSupport));
|
||||
}
|
||||
|
||||
@GetMapping("/license-list")
|
||||
@Operation(summary = "获得申请license可选择的客户列表")
|
||||
@PreAuthorize("@ss.hasPermission('license:customer:query')")
|
||||
public CommonResult<List<CustomerRespVO>> getLicenseCustomers() {
|
||||
return success(customerService.getLicenseCustomers());
|
||||
}
|
||||
}
|
||||
@@ -30,16 +30,16 @@ public class LicenseRespVO implements VO {
|
||||
@Trans(type = TransType.SIMPLE, target = CustomerDO.class, fields = "name", ref = "customerName")
|
||||
private Long customerId;
|
||||
|
||||
@Schema(description = "客户")
|
||||
@ExcelProperty("客户")
|
||||
@Schema(description = "客户名称")
|
||||
@ExcelProperty("客户名称")
|
||||
private String customerName;
|
||||
|
||||
@Schema(description = "项目ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "2496")
|
||||
@Trans(type = TransType.SIMPLE, target = ProjectDO.class, fields = "name", ref = "projectName")
|
||||
private Long projectId;
|
||||
|
||||
@Schema(description = "项目")
|
||||
@ExcelProperty("项目")
|
||||
@Schema(description = "项目名称")
|
||||
@ExcelProperty("项目名称")
|
||||
private String projectName;
|
||||
|
||||
@Schema(description = "sn", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@@ -109,7 +109,7 @@ public class LicenseRespVO implements VO {
|
||||
@ExcelProperty("申请时间")
|
||||
private LocalDateTime applicationTime;
|
||||
|
||||
@Schema(description = "申请次数")
|
||||
@Schema(description = "license申请次数")
|
||||
@ExcelProperty("申请次数")
|
||||
private Integer applyCount;
|
||||
|
||||
|
||||
@@ -163,4 +163,11 @@ public class ProjectController {
|
||||
List<ProjectImportRespVO> list = ExcelUtils.read(file, ProjectImportRespVO.class);
|
||||
return success(projectService.importList(list, updateSupport));
|
||||
}
|
||||
|
||||
@GetMapping("/license-list")
|
||||
@Operation(summary = "获得申请license可选择的项目列表")
|
||||
@PreAuthorize("@ss.hasPermission('license:project:query')")
|
||||
public CommonResult<List<ProjectRespVO>> getLicenseProjects(@Valid ProjectListReqVO reqVO) {
|
||||
return success(projectService.getLicenseProjects(reqVO));
|
||||
}
|
||||
}
|
||||
@@ -91,13 +91,14 @@ public class ProjectImportRespVO implements VO {
|
||||
@DictFormat("lic_env_info")
|
||||
private Integer envInfo;
|
||||
|
||||
@Schema(description = "软件版本信息")
|
||||
@ExcelProperty(value = "软件版本信息", converter = DictConvert.class)
|
||||
@Schema(description = "操作系统平台")
|
||||
@ExcelProperty(value = "操作系统平台", converter = DictConvert.class)
|
||||
@DictFormat("lic_operating_system")
|
||||
private Integer operatingSystem;
|
||||
|
||||
@Schema(description = "软件版本")
|
||||
@ExcelProperty(value = "软件版本", converter = DictConvert.class)
|
||||
@DictFormat("lic_software_version")
|
||||
private Integer softwareVersion;
|
||||
|
||||
@Schema(description = "操作系统")
|
||||
@ExcelProperty(value = "操作系统", converter = DictConvert.class)
|
||||
@DictFormat("lic_operating_system")
|
||||
private Integer operatingSystem;
|
||||
}
|
||||
@@ -61,10 +61,10 @@ public class ProjectListReqVO extends PageParam {
|
||||
@Schema(description = "环境信息")
|
||||
private Integer envInfo;
|
||||
|
||||
@Schema(description = "软件版本信息")
|
||||
@Schema(description = "软件版本")
|
||||
private Integer softwareVersion;
|
||||
|
||||
@Schema(description = "操作系统")
|
||||
@Schema(description = "操作系统平台")
|
||||
private Integer operatingSystem;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
|
||||
@@ -61,10 +61,10 @@ public class ProjectPageReqVO extends PageParam {
|
||||
@Schema(description = "环境信息")
|
||||
private Integer envInfo;
|
||||
|
||||
@Schema(description = "软件版本信息")
|
||||
@Schema(description = "软件版本")
|
||||
private Integer softwareVersion;
|
||||
|
||||
@Schema(description = "操作系统")
|
||||
@Schema(description = "操作系统平台")
|
||||
private Integer operatingSystem;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
|
||||
@@ -35,8 +35,8 @@ public class ProjectRespVO implements VO {
|
||||
@ExcelProperty("项目编号")
|
||||
private Long code;
|
||||
|
||||
@Schema(description = "所属客户")
|
||||
@ExcelProperty("所属客户")
|
||||
@Schema(description = "客户名称")
|
||||
@ExcelProperty("客户名称")
|
||||
private String customerName;
|
||||
|
||||
@Schema(description = "项目开始时间")
|
||||
@@ -85,7 +85,7 @@ public class ProjectRespVO implements VO {
|
||||
private String technicalOwnerBName;
|
||||
|
||||
@Schema(description = "技术负责人3")
|
||||
@ExcelProperty("技术负责人3")
|
||||
// @ExcelProperty("技术负责人3")
|
||||
private String technicalOwnerCName;
|
||||
|
||||
@Schema(description = "商务状态", example = "2")
|
||||
@@ -106,16 +106,16 @@ public class ProjectRespVO implements VO {
|
||||
@DictFormat("lic_env_info")
|
||||
private Integer envInfo;
|
||||
|
||||
@Schema(description = "软件版本信息")
|
||||
@ExcelProperty(value = "软件版本信息", converter = DictConvert.class)
|
||||
@DictFormat("lic_software_version")
|
||||
private Integer softwareVersion;
|
||||
|
||||
@Schema(description = "操作系统")
|
||||
@ExcelProperty(value = "操作系统", converter = DictConvert.class)
|
||||
@Schema(description = "操作系统平台")
|
||||
@ExcelProperty(value = "操作系统平台", converter = DictConvert.class)
|
||||
@DictFormat("lic_operating_system")
|
||||
private Integer operatingSystem;
|
||||
|
||||
@Schema(description = "软件版本")
|
||||
@ExcelProperty(value = "软件版本", converter = DictConvert.class)
|
||||
@DictFormat("lic_software_version")
|
||||
private Integer softwareVersion;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
@@ -123,8 +123,8 @@ public class ProjectRespVO implements VO {
|
||||
@ExcelProperty("评论数")
|
||||
private Integer commentNum;
|
||||
|
||||
@Schema(description = "申请数")
|
||||
@ExcelProperty("申请数")
|
||||
@Schema(description = "license申请数")
|
||||
@ExcelProperty("license申请数")
|
||||
private Integer applyCount;
|
||||
|
||||
@Schema(description = "最后修改时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
|
||||
@@ -64,10 +64,10 @@ public class ProjectSaveReqVO {
|
||||
@Schema(description = "环境信息")
|
||||
private Integer envInfo;
|
||||
|
||||
@Schema(description = "操作系统")
|
||||
@Schema(description = "操作系统平台")
|
||||
private Integer operatingSystem;
|
||||
|
||||
@Schema(description = "软件版本信息")
|
||||
@Schema(description = "软件版本")
|
||||
private Integer softwareVersion;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
|
||||
@@ -4,6 +4,7 @@ import org.agt.framework.common.pojo.PageResult;
|
||||
import org.agt.framework.mybatis.core.mapper.BaseMapperX;
|
||||
import org.agt.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||
import org.agt.module.license.controller.admin.customer.vo.CustomerPageReqVO;
|
||||
import org.agt.module.license.controller.admin.customer.vo.CustomerRespVO;
|
||||
import org.agt.module.license.dal.dataobject.customer.CustomerDO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
@@ -48,4 +49,6 @@ public interface CustomerMapper extends BaseMapperX<CustomerDO> {
|
||||
Long getUserByName(@Param("nickname") String nickname);
|
||||
|
||||
Integer selectOldMaxCode();
|
||||
|
||||
List<CustomerRespVO> getLicenseCustomers();
|
||||
}
|
||||
|
||||
@@ -83,4 +83,6 @@ public interface ProjectMapper extends BaseMapperX<ProjectDO> {
|
||||
Integer selectOldMaxCode();
|
||||
|
||||
IPage<ProjectRespVO> queryPage(IPage<?> page, @Param("query") ProjectPageReqVO reqVO);
|
||||
|
||||
List<ProjectRespVO> getLicenseProjects(@Param("query") ProjectListReqVO reqVO);
|
||||
}
|
||||
@@ -7,7 +7,9 @@ import org.agt.module.license.controller.admin.comment.vo.CommentListReqVO;
|
||||
import org.agt.module.license.controller.admin.comment.vo.CommentSaveReqVO;
|
||||
import org.agt.module.license.controller.admin.comment.vo.CommentTreeRespVO;
|
||||
import org.agt.module.license.dal.dataobject.comment.CommentDO;
|
||||
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.project.ProjectMapper;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.validation.annotation.Validated;
|
||||
|
||||
@@ -36,6 +38,9 @@ public class CommentServiceImpl implements CommentService {
|
||||
@Resource
|
||||
private CommentMapper commentMapper;
|
||||
|
||||
@Resource
|
||||
private ProjectMapper projectMapper;
|
||||
|
||||
@Override
|
||||
public Long createComment(CommentSaveReqVO createReqVO) {
|
||||
createReqVO.setUserId(WebFrameworkUtils.getLoginUserId());
|
||||
@@ -50,6 +55,8 @@ public class CommentServiceImpl implements CommentService {
|
||||
// 插入
|
||||
CommentDO comment = BeanUtils.toBean(createReqVO, CommentDO.class);
|
||||
commentMapper.insert(comment);
|
||||
|
||||
projectMapper.updateById(new ProjectDO().setId(createReqVO.getProjectId()));
|
||||
// 返回
|
||||
return comment.getId();
|
||||
}
|
||||
@@ -66,6 +73,8 @@ public class CommentServiceImpl implements CommentService {
|
||||
// 更新
|
||||
CommentDO updateObj = BeanUtils.toBean(updateReqVO, CommentDO.class);
|
||||
commentMapper.updateById(updateObj);
|
||||
|
||||
projectMapper.updateById(new ProjectDO().setId(updateReqVO.getProjectId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -4,6 +4,7 @@ import jakarta.validation.Valid;
|
||||
import org.agt.framework.common.pojo.PageResult;
|
||||
import org.agt.module.license.controller.admin.customer.vo.CustomerImportRespVO;
|
||||
import org.agt.module.license.controller.admin.customer.vo.CustomerPageReqVO;
|
||||
import org.agt.module.license.controller.admin.customer.vo.CustomerRespVO;
|
||||
import org.agt.module.license.controller.admin.customer.vo.CustomerSaveReqVO;
|
||||
import org.agt.module.license.controller.admin.customer.vo.DashboardRespVO;
|
||||
import org.agt.module.license.controller.admin.license.vo.ImportRespVO;
|
||||
@@ -91,4 +92,6 @@ public interface CustomerService {
|
||||
Integer selectMaxCode();
|
||||
|
||||
ImportRespVO importList(List<CustomerImportRespVO> list, Boolean updateSupport);
|
||||
|
||||
List<CustomerRespVO> getLicenseCustomers();
|
||||
}
|
||||
@@ -9,6 +9,7 @@ import org.agt.framework.common.util.object.BeanUtils;
|
||||
import org.agt.framework.ip.core.utils.AreaUtils;
|
||||
import org.agt.module.license.controller.admin.customer.vo.CustomerImportRespVO;
|
||||
import org.agt.module.license.controller.admin.customer.vo.CustomerPageReqVO;
|
||||
import org.agt.module.license.controller.admin.customer.vo.CustomerRespVO;
|
||||
import org.agt.module.license.controller.admin.customer.vo.CustomerSaveReqVO;
|
||||
import org.agt.module.license.controller.admin.customer.vo.DashboardRespVO;
|
||||
import org.agt.module.license.controller.admin.license.vo.ImportRespVO;
|
||||
@@ -236,4 +237,9 @@ public class CustomerServiceImpl implements CustomerService {
|
||||
return respVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<CustomerRespVO> getLicenseCustomers() {
|
||||
return customerMapper.getLicenseCustomers();
|
||||
}
|
||||
|
||||
}
|
||||
@@ -91,4 +91,6 @@ public interface ProjectService {
|
||||
Integer selectMaxCode();
|
||||
|
||||
ImportRespVO importList(List<ProjectImportRespVO> list, Boolean updateSupport);
|
||||
|
||||
List<ProjectRespVO> getLicenseProjects(ProjectListReqVO reqVO);
|
||||
}
|
||||
@@ -290,4 +290,9 @@ public class ProjectServiceImpl implements ProjectService {
|
||||
}
|
||||
return respVO;
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<ProjectRespVO> getLicenseProjects(ProjectListReqVO reqVO) {
|
||||
return projectMapper.getLicenseProjects(reqVO);
|
||||
}
|
||||
}
|
||||
@@ -31,9 +31,10 @@
|
||||
u.avatar,
|
||||
p.`name` project_name,
|
||||
p.status,
|
||||
p.business_owner,
|
||||
p.technical_owner_a,
|
||||
CONCAT( cu.`code`, p.`code` ) serial_no
|
||||
u2.nickname business_owner,
|
||||
u3.nickname technical_owner_a,
|
||||
l.serial_no,
|
||||
cu.name customer_name
|
||||
FROM
|
||||
(
|
||||
SELECT
|
||||
@@ -57,6 +58,12 @@
|
||||
AND p.deleted = 0
|
||||
LEFT JOIN crm_customer cu ON p.customer_id = cu.id
|
||||
AND cu.deleted = 0
|
||||
LEFT JOIN crm_license_server l ON p.id = l.project_id
|
||||
AND l.deleted = 0
|
||||
LEFT JOIN system_users u2 ON p.business_owner = u2.id
|
||||
AND u2.deleted = 0
|
||||
LEFT JOIN system_users u3 ON p.technical_owner_a = u3.id
|
||||
AND u3.deleted = 0
|
||||
where p.deleted = 0
|
||||
ORDER BY
|
||||
c.update_time DESC
|
||||
|
||||
@@ -18,5 +18,18 @@
|
||||
SELECT max(`code` + 0) from crm_customer where `code` + 0 < 2000
|
||||
</select>
|
||||
|
||||
|
||||
<select id="getLicenseCustomers" resultType="org.agt.module.license.controller.admin.customer.vo.CustomerRespVO">
|
||||
SELECT
|
||||
c.*
|
||||
FROM
|
||||
`crm_project` p
|
||||
LEFT JOIN `crm_license_server` l ON p.id = l.project_id
|
||||
AND l.deleted = 0
|
||||
LEFT JOIN `crm_customer` c ON c.id = p.customer_id
|
||||
AND c.deleted = 0
|
||||
WHERE
|
||||
p.deleted = 0
|
||||
AND l.id IS NULL
|
||||
AND c.id IS NOT NULL
|
||||
</select>
|
||||
</mapper>
|
||||
@@ -69,4 +69,18 @@
|
||||
p.id DESC
|
||||
</select>
|
||||
|
||||
<select id="getLicenseProjects" resultType="org.agt.module.license.controller.admin.project.vo.ProjectRespVO">
|
||||
SELECT
|
||||
p.*
|
||||
FROM
|
||||
`crm_project` p
|
||||
LEFT JOIN `crm_license_server` l ON p.id = l.project_id
|
||||
AND l.deleted = 0
|
||||
WHERE
|
||||
p.deleted = 0
|
||||
<if test="query.customerId != null and query.customerId != ''">
|
||||
AND p.customer_id = #{query.customerId}
|
||||
</if>
|
||||
AND l.id IS NULL
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user