feat: license删除多余字段
This commit is contained in:
@@ -20,7 +20,6 @@ import org.agt.module.license.controller.admin.license.vo.LicenseNeCodeVO;
|
|||||||
import org.agt.module.license.controller.admin.license.vo.LicensePageReqVO;
|
import org.agt.module.license.controller.admin.license.vo.LicensePageReqVO;
|
||||||
import org.agt.module.license.controller.admin.license.vo.LicenseRespVO;
|
import org.agt.module.license.controller.admin.license.vo.LicenseRespVO;
|
||||||
import org.agt.module.license.controller.admin.license.vo.LicenseSaveReqVO;
|
import org.agt.module.license.controller.admin.license.vo.LicenseSaveReqVO;
|
||||||
import org.agt.module.license.dal.dataobject.license.LicenseDO;
|
|
||||||
import org.agt.module.license.service.license.LicenseService;
|
import org.agt.module.license.service.license.LicenseService;
|
||||||
import org.springframework.security.access.prepost.PreAuthorize;
|
import org.springframework.security.access.prepost.PreAuthorize;
|
||||||
import org.springframework.validation.annotation.Validated;
|
import org.springframework.validation.annotation.Validated;
|
||||||
@@ -94,16 +93,16 @@ public class LicenseController {
|
|||||||
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
@Parameter(name = "id", description = "编号", required = true, example = "1024")
|
||||||
@PreAuthorize("@ss.hasPermission('license:license:query')")
|
@PreAuthorize("@ss.hasPermission('license:license:query')")
|
||||||
public CommonResult<LicenseRespVO> getLicense(@RequestParam("id") Long id) {
|
public CommonResult<LicenseRespVO> getLicense(@RequestParam("id") Long id) {
|
||||||
LicenseDO license = licenseService.getLicense(id);
|
LicenseRespVO license = licenseService.getLicense(id);
|
||||||
return success(BeanUtils.toBean(license, LicenseRespVO.class));
|
return success(license);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/page")
|
@GetMapping("/page")
|
||||||
@Operation(summary = "获得License分页")
|
@Operation(summary = "获得License分页")
|
||||||
@PreAuthorize("@ss.hasPermission('license:license:query')")
|
@PreAuthorize("@ss.hasPermission('license:license:query')")
|
||||||
public CommonResult<PageResult<LicenseRespVO>> getLicensePage(@Valid LicensePageReqVO pageReqVO) {
|
public CommonResult<PageResult<LicenseRespVO>> getLicensePage(@Valid LicensePageReqVO pageReqVO) {
|
||||||
PageResult<LicenseDO> pageResult = licenseService.getLicensePage(pageReqVO);
|
PageResult<LicenseRespVO> pageResult = licenseService.getLicensePage(pageReqVO);
|
||||||
return success(BeanUtils.toBean(pageResult, LicenseRespVO.class));
|
return success(pageResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
@GetMapping("/export-excel")
|
@GetMapping("/export-excel")
|
||||||
@@ -113,9 +112,7 @@ public class LicenseController {
|
|||||||
public void exportLicenseExcel(@Valid LicensePageReqVO pageReqVO,
|
public void exportLicenseExcel(@Valid LicensePageReqVO pageReqVO,
|
||||||
HttpServletResponse response) throws IOException {
|
HttpServletResponse response) throws IOException {
|
||||||
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
pageReqVO.setPageSize(PageParam.PAGE_SIZE_NONE);
|
||||||
List<LicenseDO> list = licenseService.getLicensePage(pageReqVO).getList();
|
List<LicenseRespVO> voList = licenseService.getLicensePage(pageReqVO).getList();
|
||||||
|
|
||||||
List<LicenseRespVO> voList = BeanUtils.toBean(list, LicenseRespVO.class);
|
|
||||||
|
|
||||||
List<LicenseRespVO> results = new ArrayList<>();
|
List<LicenseRespVO> results = new ArrayList<>();
|
||||||
for (LicenseRespVO license : voList) {
|
for (LicenseRespVO license : voList) {
|
||||||
|
|||||||
@@ -31,9 +31,6 @@ public class LicensePageReqVO extends PageParam {
|
|||||||
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
@DateTimeFormat(pattern = FORMAT_YEAR_MONTH_DAY_HOUR_MINUTE_SECOND)
|
||||||
private LocalDateTime[] expiryDate;
|
private LocalDateTime[] expiryDate;
|
||||||
|
|
||||||
@Schema(description = "网元开关")
|
|
||||||
private List<Integer> neList;
|
|
||||||
|
|
||||||
@Schema(description = "网元激活码列表")
|
@Schema(description = "网元激活码列表")
|
||||||
private List<LicenseNeCodeVO> neCodeList;
|
private List<LicenseNeCodeVO> neCodeList;
|
||||||
|
|
||||||
@@ -43,15 +40,9 @@ public class LicensePageReqVO extends PageParam {
|
|||||||
@Schema(description = "基站数")
|
@Schema(description = "基站数")
|
||||||
private Integer ranNumber;
|
private Integer ranNumber;
|
||||||
|
|
||||||
@Schema(description = "激活码")
|
|
||||||
private String activationCode;
|
|
||||||
|
|
||||||
@Schema(description = "文件URL")
|
@Schema(description = "文件URL")
|
||||||
private String fileUrl;
|
private String fileUrl;
|
||||||
|
|
||||||
@Schema(description = "License内容")
|
|
||||||
private String licenseContent;
|
|
||||||
|
|
||||||
@Schema(description = "申请人")
|
@Schema(description = "申请人")
|
||||||
private Long applicant;
|
private Long applicant;
|
||||||
|
|
||||||
|
|||||||
@@ -77,10 +77,6 @@ public class LicenseRespVO implements VO {
|
|||||||
// @ExcelProperty("文件URL")
|
// @ExcelProperty("文件URL")
|
||||||
private String fileUrl;
|
private String fileUrl;
|
||||||
|
|
||||||
@Schema(description = "License内容")
|
|
||||||
// @ExcelProperty("License内容")
|
|
||||||
private String licenseContent;
|
|
||||||
|
|
||||||
@Schema(description = "申请人ID")
|
@Schema(description = "申请人ID")
|
||||||
@Trans(type = TransType.AUTO_TRANS, key = AdminUserApi.PREFIX, fields = "nickname", ref = "applicantName")
|
@Trans(type = TransType.AUTO_TRANS, key = AdminUserApi.PREFIX, fields = "nickname", ref = "applicantName")
|
||||||
private Long applicant;
|
private Long applicant;
|
||||||
|
|||||||
@@ -30,27 +30,18 @@ public class LicenseSaveReqVO {
|
|||||||
@Schema(description = "到期时间")
|
@Schema(description = "到期时间")
|
||||||
private LocalDateTime expiryDate;
|
private LocalDateTime expiryDate;
|
||||||
|
|
||||||
@Schema(description = "网元开关")
|
|
||||||
private List<Integer> neList;
|
|
||||||
|
|
||||||
@Schema(description = "用户数")
|
@Schema(description = "用户数")
|
||||||
private Integer userNumber;
|
private Integer userNumber;
|
||||||
|
|
||||||
@Schema(description = "基站数")
|
@Schema(description = "基站数")
|
||||||
private Integer ranNumber;
|
private Integer ranNumber;
|
||||||
|
|
||||||
@Schema(description = "激活码")
|
|
||||||
private String activationCode;
|
|
||||||
|
|
||||||
@Schema(description = "网元激活码列表")
|
@Schema(description = "网元激活码列表")
|
||||||
private List<LicenseNeCodeVO> neCodeList;
|
private List<LicenseNeCodeVO> neCodeList;
|
||||||
|
|
||||||
@Schema(description = "文件URL")
|
@Schema(description = "文件URL")
|
||||||
private String fileUrl;
|
private String fileUrl;
|
||||||
|
|
||||||
@Schema(description = "License内容")
|
|
||||||
private String licenseContent;
|
|
||||||
|
|
||||||
@Schema(description = "申请人")
|
@Schema(description = "申请人")
|
||||||
private Long applicant;
|
private Long applicant;
|
||||||
|
|
||||||
|
|||||||
@@ -1,10 +1,8 @@
|
|||||||
package org.agt.module.license.dal.dataobject.license;
|
package org.agt.module.license.dal.dataobject.license;
|
||||||
|
|
||||||
import com.baomidou.mybatisplus.annotation.KeySequence;
|
import com.baomidou.mybatisplus.annotation.KeySequence;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
import com.baomidou.mybatisplus.annotation.TableName;
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.baomidou.mybatisplus.extension.handlers.JacksonTypeHandler;
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Builder;
|
import lombok.Builder;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
@@ -12,10 +10,8 @@ import lombok.EqualsAndHashCode;
|
|||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.ToString;
|
import lombok.ToString;
|
||||||
import org.agt.framework.mybatis.core.dataobject.BaseDO;
|
import org.agt.framework.mybatis.core.dataobject.BaseDO;
|
||||||
import org.agt.module.license.controller.admin.license.vo.LicenseNeCodeVO;
|
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* License DO
|
* License DO
|
||||||
@@ -53,19 +49,7 @@ public class LicenseDO extends BaseDO {
|
|||||||
* 到期时间
|
* 到期时间
|
||||||
*/
|
*/
|
||||||
private LocalDateTime expiryDate;
|
private LocalDateTime expiryDate;
|
||||||
/**
|
|
||||||
* 网元开关
|
|
||||||
*
|
|
||||||
* 枚举 {@link TODO lic_ne_switch 对应的类}
|
|
||||||
*/
|
|
||||||
@TableField(typeHandler = JacksonTypeHandler.class)
|
|
||||||
private List<Integer> neList;
|
|
||||||
/**
|
|
||||||
* 网元激活码列表
|
|
||||||
*
|
|
||||||
*/
|
|
||||||
@TableField(typeHandler = JacksonTypeHandler.class)
|
|
||||||
private List<LicenseNeCodeVO> neCodeList;
|
|
||||||
/**
|
/**
|
||||||
* 用户数
|
* 用户数
|
||||||
*/
|
*/
|
||||||
@@ -74,18 +58,10 @@ public class LicenseDO extends BaseDO {
|
|||||||
* 基站数
|
* 基站数
|
||||||
*/
|
*/
|
||||||
private Integer ranNumber;
|
private Integer ranNumber;
|
||||||
/**
|
|
||||||
* 激活码
|
|
||||||
*/
|
|
||||||
private String activationCode;
|
|
||||||
/**
|
/**
|
||||||
* 文件URL
|
* 文件URL
|
||||||
*/
|
*/
|
||||||
private String fileUrl;
|
private String fileUrl;
|
||||||
/**
|
|
||||||
* License内容
|
|
||||||
*/
|
|
||||||
private String licenseContent;
|
|
||||||
/**
|
/**
|
||||||
* 申请人
|
* 申请人
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -1,6 +1,5 @@
|
|||||||
package org.agt.module.license.dal.mysql.license;
|
package org.agt.module.license.dal.mysql.license;
|
||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
|
||||||
import org.agt.framework.common.pojo.PageResult;
|
import org.agt.framework.common.pojo.PageResult;
|
||||||
import org.agt.framework.mybatis.core.mapper.BaseMapperX;
|
import org.agt.framework.mybatis.core.mapper.BaseMapperX;
|
||||||
import org.agt.framework.mybatis.core.query.LambdaQueryWrapperX;
|
import org.agt.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
@@ -24,15 +23,11 @@ public interface LicenseMapper extends BaseMapperX<LicenseDO> {
|
|||||||
.betweenIfPresent(LicenseDO::getExpiryDate, reqVO.getExpiryDate())
|
.betweenIfPresent(LicenseDO::getExpiryDate, reqVO.getExpiryDate())
|
||||||
.eqIfPresent(LicenseDO::getUserNumber, reqVO.getUserNumber())
|
.eqIfPresent(LicenseDO::getUserNumber, reqVO.getUserNumber())
|
||||||
.eqIfPresent(LicenseDO::getRanNumber, reqVO.getRanNumber())
|
.eqIfPresent(LicenseDO::getRanNumber, reqVO.getRanNumber())
|
||||||
.eqIfPresent(LicenseDO::getActivationCode, reqVO.getActivationCode())
|
|
||||||
.eqIfPresent(LicenseDO::getLicenseContent, reqVO.getLicenseContent())
|
|
||||||
.eqIfPresent(LicenseDO::getApplicant, reqVO.getApplicant())
|
.eqIfPresent(LicenseDO::getApplicant, reqVO.getApplicant())
|
||||||
.eqIfPresent(LicenseDO::getApprover, reqVO.getApprover())
|
.eqIfPresent(LicenseDO::getApprover, reqVO.getApprover())
|
||||||
.eqIfPresent(LicenseDO::getStatus, reqVO.getStatus())
|
.eqIfPresent(LicenseDO::getStatus, reqVO.getStatus())
|
||||||
.eqIfPresent(LicenseDO::getRemark, reqVO.getRemark())
|
.eqIfPresent(LicenseDO::getRemark, reqVO.getRemark())
|
||||||
.betweenIfPresent(LicenseDO::getCreateTime, reqVO.getCreateTime())
|
.betweenIfPresent(LicenseDO::getCreateTime, reqVO.getCreateTime())
|
||||||
.apply(CollUtil.isNotEmpty(reqVO.getNeList()), "JSON_CONTAINS(ne_switch, {0})",
|
|
||||||
reqVO.getNeList() != null ? reqVO.getNeList().toString() : "")
|
|
||||||
.orderByDesc(LicenseDO::getId));
|
.orderByDesc(LicenseDO::getId));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,8 +3,8 @@ package org.agt.module.license.service.license;
|
|||||||
import jakarta.validation.Valid;
|
import jakarta.validation.Valid;
|
||||||
import org.agt.framework.common.pojo.PageResult;
|
import org.agt.framework.common.pojo.PageResult;
|
||||||
import org.agt.module.license.controller.admin.license.vo.LicensePageReqVO;
|
import org.agt.module.license.controller.admin.license.vo.LicensePageReqVO;
|
||||||
|
import org.agt.module.license.controller.admin.license.vo.LicenseRespVO;
|
||||||
import org.agt.module.license.controller.admin.license.vo.LicenseSaveReqVO;
|
import org.agt.module.license.controller.admin.license.vo.LicenseSaveReqVO;
|
||||||
import org.agt.module.license.dal.dataobject.license.LicenseDO;
|
|
||||||
import org.agt.module.license.dal.dataobject.license.LicenseDetailDO;
|
import org.agt.module.license.dal.dataobject.license.LicenseDetailDO;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -59,7 +59,7 @@ public interface LicenseService {
|
|||||||
* @param id 编号
|
* @param id 编号
|
||||||
* @return License
|
* @return License
|
||||||
*/
|
*/
|
||||||
LicenseDO getLicense(Long id);
|
LicenseRespVO getLicense(Long id);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 获得License分页
|
* 获得License分页
|
||||||
@@ -67,7 +67,7 @@ public interface LicenseService {
|
|||||||
* @param pageReqVO 分页查询
|
* @param pageReqVO 分页查询
|
||||||
* @return License分页
|
* @return License分页
|
||||||
*/
|
*/
|
||||||
PageResult<LicenseDO> getLicensePage(LicensePageReqVO pageReqVO);
|
PageResult<LicenseRespVO> getLicensePage(LicensePageReqVO pageReqVO);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* 校验License的sn是否唯一
|
* 校验License的sn是否唯一
|
||||||
|
|||||||
@@ -15,6 +15,7 @@ import org.agt.framework.web.core.util.WebFrameworkUtils;
|
|||||||
import org.agt.module.infra.api.file.FileApi;
|
import org.agt.module.infra.api.file.FileApi;
|
||||||
import org.agt.module.license.controller.admin.license.vo.LicenseNeCodeVO;
|
import org.agt.module.license.controller.admin.license.vo.LicenseNeCodeVO;
|
||||||
import org.agt.module.license.controller.admin.license.vo.LicensePageReqVO;
|
import org.agt.module.license.controller.admin.license.vo.LicensePageReqVO;
|
||||||
|
import org.agt.module.license.controller.admin.license.vo.LicenseRespVO;
|
||||||
import org.agt.module.license.controller.admin.license.vo.LicenseSaveReqVO;
|
import org.agt.module.license.controller.admin.license.vo.LicenseSaveReqVO;
|
||||||
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.LicenseDO;
|
||||||
@@ -386,8 +387,9 @@ public class LicenseServiceImpl implements LicenseService {
|
|||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public LicenseDO getLicense(Long id) {
|
public LicenseRespVO getLicense(Long id) {
|
||||||
LicenseDO licenseDO = licenseMapper.selectById(id);
|
LicenseDO licenseDO = licenseMapper.selectById(id);
|
||||||
|
LicenseRespVO licenseRespVO = BeanUtils.toBean(licenseDO, LicenseRespVO.class);
|
||||||
List<LicenseDetailDO> licenseDetailDOS = licenseDetailMapper.selectList(Wrappers.<LicenseDetailDO>lambdaQuery().eq(LicenseDetailDO::getLicenseId, licenseDO.getId()));
|
List<LicenseDetailDO> licenseDetailDOS = licenseDetailMapper.selectList(Wrappers.<LicenseDetailDO>lambdaQuery().eq(LicenseDetailDO::getLicenseId, licenseDO.getId()));
|
||||||
List<LicenseNeCodeVO> details = BeanUtils.toBean(licenseDetailDOS, LicenseNeCodeVO.class);
|
List<LicenseNeCodeVO> details = BeanUtils.toBean(licenseDetailDOS, LicenseNeCodeVO.class);
|
||||||
for (LicenseNeCodeVO detail : details) {
|
for (LicenseNeCodeVO detail : details) {
|
||||||
@@ -400,15 +402,16 @@ public class LicenseServiceImpl implements LicenseService {
|
|||||||
}
|
}
|
||||||
detail.setFileUrlList(fileUrlList);
|
detail.setFileUrlList(fileUrlList);
|
||||||
}
|
}
|
||||||
licenseDO.setNeCodeList(details);
|
licenseRespVO.setNeCodeList(details);
|
||||||
return licenseDO;
|
return licenseRespVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public PageResult<LicenseDO> getLicensePage(LicensePageReqVO pageReqVO) {
|
public PageResult<LicenseRespVO> getLicensePage(LicensePageReqVO pageReqVO) {
|
||||||
PageResult<LicenseDO> pageResult = licenseMapper.selectPage(pageReqVO);
|
PageResult<LicenseDO> pageResult = licenseMapper.selectPage(pageReqVO);
|
||||||
for (LicenseDO licenseDO : pageResult.getList()) {
|
PageResult<LicenseRespVO> voPageResult = BeanUtils.toBean(pageResult, LicenseRespVO.class);
|
||||||
List<LicenseDetailDO> licenseDetailDOS = licenseDetailMapper.selectList(Wrappers.<LicenseDetailDO>lambdaQuery().eq(LicenseDetailDO::getLicenseId, licenseDO.getId()));
|
for (LicenseRespVO licenseRespVO : voPageResult.getList()) {
|
||||||
|
List<LicenseDetailDO> licenseDetailDOS = licenseDetailMapper.selectList(Wrappers.<LicenseDetailDO>lambdaQuery().eq(LicenseDetailDO::getLicenseId, licenseRespVO.getId()));
|
||||||
List<LicenseNeCodeVO> details = BeanUtils.toBean(licenseDetailDOS, LicenseNeCodeVO.class);
|
List<LicenseNeCodeVO> details = BeanUtils.toBean(licenseDetailDOS, LicenseNeCodeVO.class);
|
||||||
for (LicenseNeCodeVO detail : details) {
|
for (LicenseNeCodeVO detail : details) {
|
||||||
List<String> fileUrlList = new ArrayList<>();
|
List<String> fileUrlList = new ArrayList<>();
|
||||||
@@ -420,9 +423,9 @@ public class LicenseServiceImpl implements LicenseService {
|
|||||||
}
|
}
|
||||||
detail.setFileUrlList(fileUrlList);
|
detail.setFileUrlList(fileUrlList);
|
||||||
}
|
}
|
||||||
licenseDO.setNeCodeList(details);
|
licenseRespVO.setNeCodeList(details);
|
||||||
}
|
}
|
||||||
return pageResult;
|
return voPageResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
Reference in New Issue
Block a user