feat: lic文件名取提供的;合同数等
This commit is contained in:
@@ -24,6 +24,18 @@ public class CommentTreeRespVO {
|
|||||||
@Schema(description = "项目名称", example = "18334")
|
@Schema(description = "项目名称", example = "18334")
|
||||||
private String projectName;
|
private String projectName;
|
||||||
|
|
||||||
|
@Schema(description = "项目状态", example = "18334")
|
||||||
|
private Integer status;
|
||||||
|
|
||||||
|
@Schema(description = "serialNo", example = "随便")
|
||||||
|
private String serialNo;
|
||||||
|
|
||||||
|
@Schema(description = "业务负责人")
|
||||||
|
private String businessOwner;
|
||||||
|
|
||||||
|
@Schema(description = "技术负责人1")
|
||||||
|
private String technicalOwnerA;
|
||||||
|
|
||||||
@Schema(description = "用户ID", example = "30248")
|
@Schema(description = "用户ID", example = "30248")
|
||||||
@ExcelProperty("用户ID")
|
@ExcelProperty("用户ID")
|
||||||
private Long userId;
|
private Long userId;
|
||||||
|
|||||||
@@ -23,4 +23,7 @@ public class DashboardRespVO {
|
|||||||
|
|
||||||
@Schema(description = "用户数量")
|
@Schema(description = "用户数量")
|
||||||
private Long userCount;
|
private Long userCount;
|
||||||
|
|
||||||
|
@Schema(description = "合同数量")
|
||||||
|
private Long contractCount;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import org.agt.framework.mybatis.core.mapper.BaseMapperX;
|
|||||||
import org.agt.framework.mybatis.core.query.LambdaQueryWrapperX;
|
import org.agt.framework.mybatis.core.query.LambdaQueryWrapperX;
|
||||||
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.dal.dataobject.license.LicenseDO;
|
import org.agt.module.license.dal.dataobject.license.LicenseDO;
|
||||||
|
import org.agt.module.license.enums.LicenseStatusEnum;
|
||||||
import org.apache.ibatis.annotations.Mapper;
|
import org.apache.ibatis.annotations.Mapper;
|
||||||
|
|
||||||
import java.time.LocalDateTime;
|
import java.time.LocalDateTime;
|
||||||
@@ -37,8 +38,9 @@ public interface LicenseMapper extends BaseMapperX<LicenseDO> {
|
|||||||
default List<LicenseDO> selectListByExpiryDate() {
|
default List<LicenseDO> selectListByExpiryDate() {
|
||||||
return selectList(new LambdaQueryWrapperX<LicenseDO>()
|
return selectList(new LambdaQueryWrapperX<LicenseDO>()
|
||||||
.gt(LicenseDO::getExpiryDate, LocalDateTime.now())
|
.gt(LicenseDO::getExpiryDate, LocalDateTime.now())
|
||||||
.last("limit 10")
|
.le(LicenseDO::getExpiryDate, LocalDateTime.now().plusDays(8))
|
||||||
.orderByDesc(LicenseDO::getApplicationTime));
|
.eq(LicenseDO::getStatus, LicenseStatusEnum.COMPLETED.getCode())
|
||||||
|
.orderByAsc(LicenseDO::getExpiryDate));
|
||||||
}
|
}
|
||||||
|
|
||||||
default LicenseDO selectBySn(String sn) {
|
default LicenseDO selectBySn(String sn) {
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package org.agt.module.license.service.customer;
|
|||||||
|
|
||||||
import cn.hutool.core.collection.CollUtil;
|
import cn.hutool.core.collection.CollUtil;
|
||||||
import cn.hutool.core.util.StrUtil;
|
import cn.hutool.core.util.StrUtil;
|
||||||
|
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||||
import jakarta.annotation.Resource;
|
import jakarta.annotation.Resource;
|
||||||
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;
|
||||||
@@ -12,6 +13,7 @@ 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.customer.vo.DashboardRespVO;
|
||||||
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.dal.dataobject.customer.CustomerDO;
|
import org.agt.module.license.dal.dataobject.customer.CustomerDO;
|
||||||
|
import org.agt.module.license.dal.dataobject.project.ProjectDO;
|
||||||
import org.agt.module.license.dal.mysql.customer.CustomerMapper;
|
import org.agt.module.license.dal.mysql.customer.CustomerMapper;
|
||||||
import org.agt.module.license.dal.mysql.license.LicenseMapper;
|
import org.agt.module.license.dal.mysql.license.LicenseMapper;
|
||||||
import org.agt.module.license.dal.mysql.project.ProjectMapper;
|
import org.agt.module.license.dal.mysql.project.ProjectMapper;
|
||||||
@@ -53,12 +55,15 @@ public class CustomerServiceImpl implements CustomerService {
|
|||||||
public DashboardRespVO dashboard() {
|
public DashboardRespVO dashboard() {
|
||||||
Long customerCount = customerMapper.selectCount();
|
Long customerCount = customerMapper.selectCount();
|
||||||
Long projectCount = projectMapper.selectCount();
|
Long projectCount = projectMapper.selectCount();
|
||||||
|
Long contractCount = projectMapper.selectCount(Wrappers.<ProjectDO>lambdaQuery().ne(ProjectDO::getContractCode, "0"));
|
||||||
Long licenseCount = licenseMapper.selectCount();
|
Long licenseCount = licenseMapper.selectCount();
|
||||||
DashboardRespVO dashboardRespVO = new DashboardRespVO();
|
DashboardRespVO dashboardRespVO = new DashboardRespVO();
|
||||||
dashboardRespVO.setCustomerCount(customerCount);
|
dashboardRespVO.setCustomerCount(customerCount);
|
||||||
dashboardRespVO.setProjectCount(projectCount);
|
dashboardRespVO.setProjectCount(projectCount);
|
||||||
dashboardRespVO.setLicenseCount(licenseCount);
|
dashboardRespVO.setLicenseCount(licenseCount);
|
||||||
|
dashboardRespVO.setContractCount(contractCount);
|
||||||
dashboardRespVO.setUserCount(customerMapper.selectUserCount());
|
dashboardRespVO.setUserCount(customerMapper.selectUserCount());
|
||||||
|
|
||||||
return dashboardRespVO;
|
return dashboardRespVO;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -132,6 +132,7 @@ public class LicenseServiceImpl implements LicenseService {
|
|||||||
|
|
||||||
List<LicenseDetailDO> licenseDetails = BeanUtils.toBean(neCodeList, LicenseDetailDO.class);
|
List<LicenseDetailDO> licenseDetails = BeanUtils.toBean(neCodeList, LicenseDetailDO.class);
|
||||||
for (LicenseDetailDO licenseDetail : licenseDetails) {
|
for (LicenseDetailDO licenseDetail : licenseDetails) {
|
||||||
|
licenseDetail.setId(null);
|
||||||
licenseDetail.setLicenseId(license.getId());
|
licenseDetail.setLicenseId(license.getId());
|
||||||
}
|
}
|
||||||
licenseDetailMapper.insertBatch(licenseDetails);
|
licenseDetailMapper.insertBatch(licenseDetails);
|
||||||
@@ -245,6 +246,7 @@ public class LicenseServiceImpl implements LicenseService {
|
|||||||
licenseDetailMapper.delete(Wrappers.<LicenseDetailDO>lambdaQuery().eq(LicenseDetailDO::getLicenseId, licenseDO.getId()));
|
licenseDetailMapper.delete(Wrappers.<LicenseDetailDO>lambdaQuery().eq(LicenseDetailDO::getLicenseId, licenseDO.getId()));
|
||||||
|
|
||||||
for (LicenseDetailVO neCode : updateReqVO.getNeCodeList()) {
|
for (LicenseDetailVO neCode : updateReqVO.getNeCodeList()) {
|
||||||
|
neCode.setId(null);
|
||||||
neCode.setFileUrlLegacy(null);
|
neCode.setFileUrlLegacy(null);
|
||||||
neCode.setFileUrl(null);
|
neCode.setFileUrl(null);
|
||||||
neCode.setProviderId(null);
|
neCode.setProviderId(null);
|
||||||
@@ -306,6 +308,7 @@ public class LicenseServiceImpl implements LicenseService {
|
|||||||
try {
|
try {
|
||||||
log.info("下载License文件路径为:{}", newFilePath1);
|
log.info("下载License文件路径为:{}", newFilePath1);
|
||||||
fileContent = FileUtil.readBytes(newFilePath1);
|
fileContent = FileUtil.readBytes(newFilePath1);
|
||||||
|
fileName = FileUtil.getName(newFilePath1);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("读取文件失败", e);
|
log.error("读取文件失败", e);
|
||||||
}
|
}
|
||||||
@@ -314,11 +317,11 @@ public class LicenseServiceImpl implements LicenseService {
|
|||||||
// fileContent = ResourceUtil.readBytes("file/MME_13750602_2024-08-02_system.ini");
|
// fileContent = ResourceUtil.readBytes("file/MME_13750602_2024-08-02_system.ini");
|
||||||
} else {
|
} else {
|
||||||
// 上传到文件服务
|
// 上传到文件服务
|
||||||
String preFileName = "45G_";
|
// String preFileName = "45G_";
|
||||||
if (newFilePath1.contains("Legacy_")) {
|
// if (newFilePath1.contains("Legacy_")) {
|
||||||
preFileName = "Legacy_";
|
// preFileName = "Legacy_";
|
||||||
}
|
// }
|
||||||
String fileURL = fileApi.createFile(fileContent, preFileName + fileName);
|
String fileURL = fileApi.createFile(fileContent, fileName);
|
||||||
fileUrls.add(fileURL);
|
fileUrls.add(fileURL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -330,6 +333,7 @@ public class LicenseServiceImpl implements LicenseService {
|
|||||||
try {
|
try {
|
||||||
log.info("下载Legacy_License文件路径为:{}", newFilePath0);
|
log.info("下载Legacy_License文件路径为:{}", newFilePath0);
|
||||||
fileContent0 = FileUtil.readBytes(newFilePath0);
|
fileContent0 = FileUtil.readBytes(newFilePath0);
|
||||||
|
fileName = FileUtil.getName(newFilePath0);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
log.error("读取文件失败", e);
|
log.error("读取文件失败", e);
|
||||||
}
|
}
|
||||||
@@ -338,11 +342,11 @@ public class LicenseServiceImpl implements LicenseService {
|
|||||||
// fileContent0 = ResourceUtil.readBytes("file/MME_13750602_2024-08-02_system.ini");
|
// fileContent0 = ResourceUtil.readBytes("file/MME_13750602_2024-08-02_system.ini");
|
||||||
} else {
|
} else {
|
||||||
// 上传到文件服务
|
// 上传到文件服务
|
||||||
String preFileName = "45G_";
|
// String preFileName = "45G_";
|
||||||
if (newFilePath0.contains("Legacy_")) {
|
// if (newFilePath0.contains("Legacy_")) {
|
||||||
preFileName = "Legacy_";
|
// preFileName = "Legacy_";
|
||||||
}
|
// }
|
||||||
String fileURL = fileApi.createFile(fileContent0, preFileName + fileName);
|
String fileURL = fileApi.createFile(fileContent0, fileName);
|
||||||
fileUrls.add(fileURL);
|
fileUrls.add(fileURL);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -373,19 +377,21 @@ public class LicenseServiceImpl implements LicenseService {
|
|||||||
LicenseProviderDO licenseProviderDO = licenseProviderMapper.selectById(detail.getProviderId());
|
LicenseProviderDO licenseProviderDO = licenseProviderMapper.selectById(detail.getProviderId());
|
||||||
String fileName = getFileName(licenseDO.getSerialNo(), detail.getNeList());
|
String fileName = getFileName(licenseDO.getSerialNo(), detail.getNeList());
|
||||||
if (StrUtil.isNotBlank(licenseProviderDO.getNewFilePath1())) {
|
if (StrUtil.isNotBlank(licenseProviderDO.getNewFilePath1())) {
|
||||||
String preFileName = "45G_";
|
// String preFileName = "45G_";
|
||||||
if (licenseProviderDO.getNewFilePath1().contains("Legacy_")) {
|
// if (licenseProviderDO.getNewFilePath1().contains("Legacy_")) {
|
||||||
preFileName = "Legacy_";
|
// preFileName = "Legacy_";
|
||||||
}
|
// }
|
||||||
pathList.add(preFileName + fileName);
|
fileName = FileUtil.getName(licenseProviderDO.getNewFilePath1());
|
||||||
|
pathList.add(fileName);
|
||||||
inputStreamList.add(new ByteArrayInputStream(FileUtil.readBytes(licenseProviderDO.getNewFilePath1())));
|
inputStreamList.add(new ByteArrayInputStream(FileUtil.readBytes(licenseProviderDO.getNewFilePath1())));
|
||||||
}
|
}
|
||||||
if (StrUtil.isNotBlank(licenseProviderDO.getNewFilePath0())) {
|
if (StrUtil.isNotBlank(licenseProviderDO.getNewFilePath0())) {
|
||||||
String preFileName = "45G_";
|
// String preFileName = "45G_";
|
||||||
if (licenseProviderDO.getNewFilePath0().contains("Legacy_")) {
|
// if (licenseProviderDO.getNewFilePath0().contains("Legacy_")) {
|
||||||
preFileName = "Legacy_";
|
// preFileName = "Legacy_";
|
||||||
}
|
// }
|
||||||
pathList.add(preFileName + fileName);
|
fileName = FileUtil.getName(licenseProviderDO.getNewFilePath0());
|
||||||
|
pathList.add(fileName);
|
||||||
inputStreamList.add(new ByteArrayInputStream(FileUtil.readBytes(licenseProviderDO.getNewFilePath0())));
|
inputStreamList.add(new ByteArrayInputStream(FileUtil.readBytes(licenseProviderDO.getNewFilePath0())));
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -556,9 +562,9 @@ public class LicenseServiceImpl implements LicenseService {
|
|||||||
public PageResult<LicenseRespVO> getLicensePage(LicensePageReqVO pageReqVO) {
|
public PageResult<LicenseRespVO> getLicensePage(LicensePageReqVO pageReqVO) {
|
||||||
PageResult<LicenseDO> pageResult = licenseMapper.selectPage(pageReqVO);
|
PageResult<LicenseDO> pageResult = licenseMapper.selectPage(pageReqVO);
|
||||||
PageResult<LicenseRespVO> voPageResult = BeanUtils.toBean(pageResult, LicenseRespVO.class);
|
PageResult<LicenseRespVO> voPageResult = BeanUtils.toBean(pageResult, LicenseRespVO.class);
|
||||||
// for (LicenseRespVO licenseRespVO : voPageResult.getList()) {
|
for (LicenseRespVO licenseRespVO : voPageResult.getList()) {
|
||||||
// fillLicenseRespVO(licenseRespVO);
|
fillLicenseRespVO(licenseRespVO);
|
||||||
// }
|
}
|
||||||
return voPageResult;
|
return voPageResult;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -29,7 +29,11 @@
|
|||||||
c.*,
|
c.*,
|
||||||
u.nickname author,
|
u.nickname author,
|
||||||
u.avatar,
|
u.avatar,
|
||||||
p.`name` project_name
|
p.`name` project_name,
|
||||||
|
p.status,
|
||||||
|
p.business_owner,
|
||||||
|
p.technical_owner_a,
|
||||||
|
CONCAT( cu.`code`, p.`code` ) serial_no
|
||||||
FROM
|
FROM
|
||||||
(
|
(
|
||||||
SELECT
|
SELECT
|
||||||
@@ -51,6 +55,8 @@
|
|||||||
AND u.deleted = 0
|
AND u.deleted = 0
|
||||||
LEFT JOIN crm_project p ON c.project_id = p.id
|
LEFT JOIN crm_project p ON c.project_id = p.id
|
||||||
AND p.deleted = 0
|
AND p.deleted = 0
|
||||||
|
LEFT JOIN crm_customer cu ON p.customer_id = cu.id
|
||||||
|
AND cu.deleted = 0
|
||||||
ORDER BY
|
ORDER BY
|
||||||
c.update_time DESC
|
c.update_time DESC
|
||||||
LIMIT 10
|
LIMIT 10
|
||||||
|
|||||||
Reference in New Issue
Block a user