feat: license文件导入支持
This commit is contained in:
@@ -219,4 +219,12 @@ public class LicenseController {
|
||||
List<LicenseImportExcelVO> list = ExcelUtils.read(file, LicenseImportExcelVO.class);
|
||||
return success(licenseService.importList(list, updateSupport));
|
||||
}
|
||||
|
||||
@PutMapping("/update-detail")
|
||||
@Operation(summary = "更新License明细")
|
||||
@PreAuthorize("@ss.hasPermission('license:license:update')")
|
||||
public CommonResult<Boolean> updateDetailById(@Valid @RequestBody LicenseDetailVO updateReqVO) {
|
||||
licenseService.updateDetailById(updateReqVO);
|
||||
return success(true);
|
||||
}
|
||||
}
|
||||
@@ -15,6 +15,9 @@ import java.util.Map;
|
||||
@Data
|
||||
public class LicenseDetailVO {
|
||||
|
||||
@Schema(description = "ID")
|
||||
private Long id;
|
||||
|
||||
@Schema(description = "网元开关")
|
||||
private List<Integer> neList;
|
||||
|
||||
|
||||
@@ -3,6 +3,7 @@ package org.agt.module.license.service.license;
|
||||
import jakarta.validation.Valid;
|
||||
import org.agt.framework.common.pojo.PageResult;
|
||||
import org.agt.module.license.controller.admin.license.vo.ImportRespVO;
|
||||
import org.agt.module.license.controller.admin.license.vo.LicenseDetailVO;
|
||||
import org.agt.module.license.controller.admin.license.vo.LicenseImportExcelVO;
|
||||
import org.agt.module.license.controller.admin.license.vo.LicensePageReqVO;
|
||||
import org.agt.module.license.controller.admin.license.vo.LicenseRespVO;
|
||||
@@ -91,4 +92,6 @@ public interface LicenseService {
|
||||
List<LicenseRespVO> getLicenseHistory(Long id);
|
||||
|
||||
ImportRespVO importList(List<LicenseImportExcelVO> list, Boolean updateSupport);
|
||||
|
||||
void updateDetailById(LicenseDetailVO licenseDetail);
|
||||
}
|
||||
@@ -556,9 +556,9 @@ public class LicenseServiceImpl implements LicenseService {
|
||||
public PageResult<LicenseRespVO> getLicensePage(LicensePageReqVO pageReqVO) {
|
||||
PageResult<LicenseDO> pageResult = licenseMapper.selectPage(pageReqVO);
|
||||
PageResult<LicenseRespVO> voPageResult = BeanUtils.toBean(pageResult, LicenseRespVO.class);
|
||||
for (LicenseRespVO licenseRespVO : voPageResult.getList()) {
|
||||
fillLicenseRespVO(licenseRespVO);
|
||||
}
|
||||
// for (LicenseRespVO licenseRespVO : voPageResult.getList()) {
|
||||
// fillLicenseRespVO(licenseRespVO);
|
||||
// }
|
||||
return voPageResult;
|
||||
}
|
||||
|
||||
@@ -730,4 +730,14 @@ public class LicenseServiceImpl implements LicenseService {
|
||||
fillDetail(details, license);
|
||||
|
||||
}
|
||||
|
||||
public void updateDetailById(LicenseDetailVO licenseDetail) {
|
||||
LicenseDetailDO licenseDetailDO = licenseDetailMapper.selectById(licenseDetail.getId());
|
||||
if (StrUtil.isBlank(licenseDetailDO.getFileUrl())) {
|
||||
licenseDetailDO.setFileUrl(licenseDetail.getFileUrl());
|
||||
} else {
|
||||
licenseDetailDO.setFileUrlLegacy(licenseDetail.getFileUrl());
|
||||
}
|
||||
licenseDetailMapper.updateById(licenseDetailDO);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user