feat: license报表
This commit is contained in:
@@ -6,6 +6,8 @@ import jakarta.annotation.Resource;
|
||||
import jakarta.validation.Valid;
|
||||
import org.agt.framework.common.pojo.CommonResult;
|
||||
import org.agt.framework.common.pojo.PageResult;
|
||||
import org.agt.module.license.controller.admin.report.vo.ReportLicensePageReqVO;
|
||||
import org.agt.module.license.controller.admin.report.vo.ReportLicenseRespVO;
|
||||
import org.agt.module.license.controller.admin.report.vo.ReportProgressProjectReqVO;
|
||||
import org.agt.module.license.controller.admin.report.vo.ReportProgressProjectRespVO;
|
||||
import org.agt.module.license.service.report.ReportService;
|
||||
@@ -38,4 +40,11 @@ public class ReportController {
|
||||
PageResult<ReportProgressProjectRespVO> pageResult = reportService.getCommentByStaff(query);
|
||||
return success(pageResult);
|
||||
}
|
||||
|
||||
@GetMapping("/license/expire")
|
||||
@Operation(summary = "获得license到期列表")
|
||||
public CommonResult<PageResult<ReportLicenseRespVO>> getExpiryLicense(@Valid ReportLicensePageReqVO query) {
|
||||
PageResult<ReportLicenseRespVO> pageResult = reportService.getExpiryLicense(query);
|
||||
return success(pageResult);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,79 @@
|
||||
package org.agt.module.license.controller.admin.report.vo;
|
||||
|
||||
import io.swagger.v3.oas.annotations.media.Schema;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.ToString;
|
||||
import org.agt.framework.common.pojo.PageParam;
|
||||
import org.agt.module.license.controller.admin.license.vo.LicenseDetailVO;
|
||||
import org.springframework.format.annotation.DateTimeFormat;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
import static org.agt.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY;
|
||||
import static org.agt.framework.common.util.date.DateUtils.FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND;
|
||||
|
||||
@Schema(description = "管理后台 - License分页 Request VO")
|
||||
@Data
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@ToString(callSuper = true)
|
||||
public class ReportLicensePageReqVO extends PageParam {
|
||||
|
||||
@Schema(description = "客户ID", example = "31667")
|
||||
private Long customerId;
|
||||
|
||||
@Schema(description = "项目ID", example = "2496")
|
||||
private Long projectId;
|
||||
|
||||
@Schema(description = "sn")
|
||||
private String serialNo;
|
||||
|
||||
@Schema(description = "到期时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] expiryDate;
|
||||
|
||||
@Schema(description = "到期时间-开始")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
|
||||
private LocalDate expiryDateStart;
|
||||
|
||||
@Schema(description = "到期时间-结束")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY)
|
||||
private LocalDate expiryDateEnd;
|
||||
|
||||
@Schema(description = "网元激活码列表")
|
||||
private List<LicenseDetailVO> neCodeList;
|
||||
|
||||
@Schema(description = "用户数")
|
||||
private Integer userNumber;
|
||||
|
||||
@Schema(description = "基站数")
|
||||
private Integer ranNumber;
|
||||
|
||||
@Schema(description = "文件URL")
|
||||
private String fileUrl;
|
||||
|
||||
@Schema(description = "申请人")
|
||||
private Long applicant;
|
||||
|
||||
@Schema(description = "申请时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] applicationTime;
|
||||
|
||||
@Schema(description = "审批人")
|
||||
private Long approver;
|
||||
|
||||
@Schema(description = "状态", example = "1")
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "是否过期", example = "随便")
|
||||
private Boolean isExpired;
|
||||
|
||||
@Schema(description = "创建时间")
|
||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||
private LocalDateTime[] createTime;
|
||||
}
|
||||
@@ -0,0 +1,129 @@
|
||||
package org.agt.module.license.controller.admin.report.vo;
|
||||
|
||||
import com.alibaba.excel.annotation.ExcelIgnoreUnannotated;
|
||||
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 lombok.Data;
|
||||
import org.agt.framework.excel.core.annotations.DictFormat;
|
||||
import org.agt.framework.excel.core.convert.DictConvert;
|
||||
import org.agt.module.license.controller.admin.license.vo.LicenseDetailVO;
|
||||
import org.agt.module.license.dal.dataobject.customer.CustomerDO;
|
||||
import org.agt.module.license.dal.dataobject.project.ProjectDO;
|
||||
|
||||
import java.time.LocalDate;
|
||||
import java.time.LocalDateTime;
|
||||
import java.util.List;
|
||||
|
||||
@Schema(description = "管理后台 - 报表 License Response VO")
|
||||
@Data
|
||||
@ExcelIgnoreUnannotated
|
||||
public class ReportLicenseRespVO implements VO {
|
||||
|
||||
@Schema(description = "主键", requiredMode = Schema.RequiredMode.REQUIRED, example = "25585")
|
||||
// @ExcelProperty("主键")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "客户ID", requiredMode = Schema.RequiredMode.REQUIRED, example = "31667")
|
||||
@Trans(type = TransType.SIMPLE, target = CustomerDO.class, fields = "name", ref = "customerName")
|
||||
private Long customerId;
|
||||
|
||||
@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("项目名称")
|
||||
private String projectName;
|
||||
|
||||
@Schema(description = "sn", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("SN")
|
||||
private String serialNo;
|
||||
|
||||
@Schema(description = "到期时间")
|
||||
private LocalDateTime expiryDate;
|
||||
|
||||
@Schema(description = "到期时间格式化")
|
||||
private LocalDateTime expiryDateFormat;
|
||||
|
||||
@Schema(description = "到期时间导出")
|
||||
@ExcelProperty("到期时间")
|
||||
private LocalDate expiryDateExt;
|
||||
|
||||
@Schema(description = "网元")
|
||||
@ExcelProperty("网元")
|
||||
private String neListStr;
|
||||
|
||||
@Schema(description = "激活码")
|
||||
@ExcelProperty("激活码")
|
||||
private String activationCode;
|
||||
|
||||
@Schema(description = "网元激活码列表")
|
||||
private List<LicenseDetailVO> neCodeList;
|
||||
|
||||
@Schema(description = "用户数")
|
||||
@ExcelProperty("用户数")
|
||||
private Integer userNumber;
|
||||
|
||||
@Schema(description = "基站数")
|
||||
@ExcelProperty("基站数")
|
||||
private Integer ranNumber;
|
||||
|
||||
@Schema(description = "文件URL")
|
||||
// @ExcelProperty("文件URL")
|
||||
private String fileUrl;
|
||||
|
||||
@Schema(description = "申请人ID")
|
||||
private Long applicant;
|
||||
|
||||
@Schema(description = "申请人", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("申请人")
|
||||
private String applicantName;
|
||||
|
||||
@Schema(description = "审批人")
|
||||
private Long approver;
|
||||
|
||||
@Schema(description = "审批人", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("审批人")
|
||||
private String approverName;
|
||||
|
||||
@Schema(description = "状态", example = "1")
|
||||
@ExcelProperty(value = "状态", converter = DictConvert.class)
|
||||
@DictFormat("lic_license_status") // TODO 代码优化:建议设置到对应的 DictTypeConstants 枚举类中
|
||||
private Integer status;
|
||||
|
||||
@Schema(description = "备注", example = "随便")
|
||||
@ExcelProperty("说明")
|
||||
private String remark;
|
||||
|
||||
@Schema(description = "创建时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
// @ExcelProperty("创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
@Schema(description = "申请时间")
|
||||
@ExcelProperty("申请时间")
|
||||
private LocalDateTime applicationTime;
|
||||
|
||||
@Schema(description = "license申请次数")
|
||||
@ExcelProperty("申请次数")
|
||||
private Integer applyCount;
|
||||
|
||||
@Schema(description = "业务负责人")
|
||||
private String businessOwnerName;
|
||||
|
||||
@Schema(description = "技术负责人1")
|
||||
private String technicalOwnerAName;
|
||||
|
||||
@Schema(description = "技术负责人2")
|
||||
private String technicalOwnerBName;
|
||||
|
||||
@Schema(description = "项目开始时间", requiredMode = Schema.RequiredMode.REQUIRED)
|
||||
@ExcelProperty("项目开始时间")
|
||||
private LocalDateTime startTime;
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
package org.agt.module.license.dal.mysql.report;
|
||||
|
||||
import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import org.agt.module.license.controller.admin.report.vo.ReportLicensePageReqVO;
|
||||
import org.agt.module.license.controller.admin.report.vo.ReportLicenseRespVO;
|
||||
import org.agt.module.license.controller.admin.report.vo.ReportProgressProjectReqVO;
|
||||
import org.agt.module.license.controller.admin.report.vo.ReportProgressProjectRespVO;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
@@ -17,4 +19,6 @@ public interface ReportMapper {
|
||||
IPage<ReportProgressProjectRespVO> getCommentByProject(IPage<?> page, @Param("query") ReportProgressProjectReqVO query);
|
||||
|
||||
IPage<ReportProgressProjectRespVO> getCommentByStaff(IPage<?> page, @Param("query") ReportProgressProjectReqVO query);
|
||||
|
||||
IPage<ReportLicenseRespVO> getExpiryLicense(IPage<?> page, @Param("query") ReportLicensePageReqVO query);
|
||||
}
|
||||
@@ -1,6 +1,8 @@
|
||||
package org.agt.module.license.service.report;
|
||||
|
||||
import org.agt.framework.common.pojo.PageResult;
|
||||
import org.agt.module.license.controller.admin.report.vo.ReportLicensePageReqVO;
|
||||
import org.agt.module.license.controller.admin.report.vo.ReportLicenseRespVO;
|
||||
import org.agt.module.license.controller.admin.report.vo.ReportProgressProjectReqVO;
|
||||
import org.agt.module.license.controller.admin.report.vo.ReportProgressProjectRespVO;
|
||||
|
||||
@@ -11,7 +13,9 @@ import org.agt.module.license.controller.admin.report.vo.ReportProgressProjectRe
|
||||
*/
|
||||
public interface ReportService {
|
||||
|
||||
PageResult<ReportProgressProjectRespVO> getCommentByProject(ReportProgressProjectReqVO query);
|
||||
PageResult<ReportProgressProjectRespVO> getCommentByProject(ReportProgressProjectReqVO pageReqVO);
|
||||
|
||||
PageResult<ReportProgressProjectRespVO> getCommentByStaff(ReportProgressProjectReqVO query);
|
||||
PageResult<ReportProgressProjectRespVO> getCommentByStaff(ReportProgressProjectReqVO pageReqVO);
|
||||
|
||||
PageResult<ReportLicenseRespVO> getExpiryLicense(ReportLicensePageReqVO pageReqVO);
|
||||
}
|
||||
@@ -4,6 +4,8 @@ import com.baomidou.mybatisplus.core.metadata.IPage;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import jakarta.annotation.Resource;
|
||||
import org.agt.framework.common.pojo.PageResult;
|
||||
import org.agt.module.license.controller.admin.report.vo.ReportLicensePageReqVO;
|
||||
import org.agt.module.license.controller.admin.report.vo.ReportLicenseRespVO;
|
||||
import org.agt.module.license.controller.admin.report.vo.ReportProgressProjectReqVO;
|
||||
import org.agt.module.license.controller.admin.report.vo.ReportProgressProjectRespVO;
|
||||
import org.agt.module.license.dal.mysql.report.ReportMapper;
|
||||
@@ -36,4 +38,11 @@ public class ReportServiceImpl implements ReportService {
|
||||
return new PageResult<>(page.getRecords(), page.getTotal());
|
||||
}
|
||||
|
||||
@Override
|
||||
public PageResult<ReportLicenseRespVO> getExpiryLicense(ReportLicensePageReqVO pageReqVO) {
|
||||
IPage<ReportLicenseRespVO> page = reportMapper.getExpiryLicense(new Page<>(pageReqVO.getPageNo(), pageReqVO.getPageSize()), pageReqVO);
|
||||
|
||||
return new PageResult<>(page.getRecords(), page.getTotal());
|
||||
}
|
||||
|
||||
}
|
||||
@@ -73,4 +73,100 @@
|
||||
AND u.id = #{query.authorId}
|
||||
</if>
|
||||
</sql>
|
||||
|
||||
<select id="getExpiryLicense" resultType="org.agt.module.license.controller.admin.report.vo.ReportLicenseRespVO">
|
||||
SELECT
|
||||
l.id,
|
||||
l.project_id,
|
||||
l.serial_no,
|
||||
l.expiry_date,
|
||||
l.expiry_date expiry_date_format,
|
||||
l.ran_number,
|
||||
l.user_number,
|
||||
l.file_url,
|
||||
l.applicant,
|
||||
l.application_time,
|
||||
l.license_admin,
|
||||
l.approver,
|
||||
l.approve_time,
|
||||
p.`status`,
|
||||
l.remark,
|
||||
l.data_type,
|
||||
l.creator,
|
||||
l.create_time,
|
||||
l.updater,
|
||||
l.update_time,
|
||||
l.deleted,
|
||||
l.tenant_id,
|
||||
p.customer_id,
|
||||
p.start_time,
|
||||
p.`name` project_name,
|
||||
c.`name` customer_name,
|
||||
bo.nickname business_owner_name,
|
||||
toa.nickname technical_owner_a_name,
|
||||
tob.nickname technical_owner_b_name
|
||||
FROM
|
||||
crm_license_server l
|
||||
LEFT JOIN crm_project p ON l.project_id = p.id
|
||||
AND p.deleted = 0
|
||||
LEFT JOIN crm_customer c ON l.customer_id = c.id
|
||||
AND c.deleted = 0
|
||||
LEFT JOIN system_users bo ON p.business_owner = bo.id
|
||||
AND bo.deleted = 0
|
||||
LEFT JOIN system_users toa ON p.technical_owner_a = toa.id
|
||||
AND toa.deleted = 0
|
||||
LEFT JOIN system_users tob ON p.technical_owner_b = tob.id
|
||||
AND tob.deleted = 0
|
||||
WHERE
|
||||
l.deleted = 0
|
||||
<if test="query.customerId != null">
|
||||
AND p.customer_id = #{query.customerId}
|
||||
</if>
|
||||
<if test="query.projectId != null">
|
||||
AND l.project_id = #{query.projectId}
|
||||
</if>
|
||||
<if test="query.serialNo != null and query.serialNo != ''">
|
||||
AND l.serial_no LIKE CONCAT('%',#{query.serialNo},'%')
|
||||
</if>
|
||||
<if test="query.expiryDate != null and query.expiryDate.length > 1">
|
||||
AND l.expiry_date BETWEEN #{query.expiryDate[0]} AND #{query.expiryDate[1]}
|
||||
</if>
|
||||
<if test="query.userNumber != null">
|
||||
AND l.user_number = #{query.userNumber}
|
||||
</if>
|
||||
<if test="query.ranNumber != null">
|
||||
AND l.ran_number = #{query.ranNumber}
|
||||
</if>
|
||||
<if test="query.applicant != null">
|
||||
AND l.applicant = #{query.applicant}
|
||||
</if>
|
||||
<if test="query.approver != null">
|
||||
AND l.approver = #{query.approver}
|
||||
</if>
|
||||
<if test="query.status != null">
|
||||
AND l.status = #{query.status}
|
||||
</if>
|
||||
<if test="query.remark != null and query.remark != ''">
|
||||
AND l.remark LIKE CONCAT('%',#{query.remark},'%')
|
||||
</if>
|
||||
<if test="query.applicationTime != null and query.applicationTime.length > 1">
|
||||
AND l.application_time BETWEEN #{query.applicationTime[0]} AND #{query.applicationTime[1]}
|
||||
</if>
|
||||
<if test="query.createTime != null and query.createTime.length > 1">
|
||||
AND l.create_time BETWEEN #{query.createTime[0]} AND #{query.createTime[1]}
|
||||
</if>
|
||||
<if test="query.expiryDateStart != null and query.expiryDateEnd != null">
|
||||
AND DATE_FORMAT(l.expiry_date, '%Y-%m-%d') BETWEEN DATE_FORMAT(#{query.expiryDateStart}, '%Y-%m-%d') AND DATE_FORMAT(#{query.expiryDateEnd}, '%Y-%m-%d')
|
||||
</if>
|
||||
<if test="query.isExpired != null and query.isExpired">
|
||||
AND DATE_FORMAT(l.expiry_date, '%Y%m%d') < DATE_FORMAT(now(), '%Y%m%d')
|
||||
ORDER BY
|
||||
l.expiry_date DESC
|
||||
</if>
|
||||
<if test="query.isExpired != null and !query.isExpired">
|
||||
AND DATE_FORMAT(l.expiry_date, '%Y%m%d') >= DATE_FORMAT(now(), '%Y%m%d')
|
||||
ORDER BY
|
||||
l.expiry_date
|
||||
</if>
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user