Commit c4901dd1 authored by liqin's avatar liqin 💬

bug fixed

parent a3bd1b70
......@@ -24,9 +24,6 @@ public abstract class BasePageOrderParam extends BasePageParam {
@ApiModelProperty("名称/编码")
private String nameOrCode;
@ApiModelProperty("类型")
private String type;
@ApiModelProperty("操作类型")
private String operationType;
......@@ -42,6 +39,9 @@ public abstract class BasePageOrderParam extends BasePageParam {
@ApiModelProperty("创建人")
private String creatorName;
@ApiModelProperty("版权方类型")
private String ownerType;
@ApiModelProperty("视频分类ID")
private String assetTypeId;
......
......@@ -224,12 +224,16 @@ public class AssetController extends BaseController {
Asset asset = assetService.getById(id);
if (asset.getAssetTypeId() != null) {
AssetType assetType = this.assetTypeService.getById(asset.getAssetTypeId());
if (assetType != null) {
asset.setAssetTypeName(assetType.getName());
}
}
if (asset.getAssetCopyrightOwnerId() != null) {
CopyrightOwner copyrightOwner = this.copyrightOwnerService.getById(asset.getAssetCopyrightOwnerId());
if (copyrightOwner != null) {
asset.setAssetCopyrightOwnerName(copyrightOwner.getName());
}
}
return getResult(asset);
}
......
......@@ -135,7 +135,6 @@ public class AssetTypeController extends BaseController {
Page<AssetType> page = this.assetTypeService.page(getPage(), queryWrapper);
for (AssetType assetType : page.getRecords()) {
LambdaQueryWrapper<Asset> lambdaQueryWrapper = Wrappers.<Asset>lambdaQuery().eq(Asset::getAssetTypeId, assetType.getId());
//lambdaQueryWrapper.eq(Asset::getAuditStatusAdd)
lambdaQueryWrapper = lambdaQueryWrapper.select(Asset::getId).select(Asset::getAssetCopyrightOwnerId);
List<Asset> assetList = this.assetService.list(lambdaQueryWrapper);
final List<String> assetCopyrightOwnerIdList = assetList.stream().map(Asset::getAssetCopyrightOwnerId).collect(Collectors.toList());
......
package cn.wisenergy.chnmuseum.party.web.controller;
import cn.wisenergy.chnmuseum.party.common.enums.CopyrightOwnerTypeEnum;
import cn.wisenergy.chnmuseum.party.common.util.TimeUtils;
import cn.wisenergy.chnmuseum.party.common.validator.groups.Add;
import cn.wisenergy.chnmuseum.party.common.validator.groups.Update;
import cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam;
......@@ -137,17 +138,24 @@ public class CopyrightOwnerController extends BaseController {
return getFailResult();
}
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "copyrightOwnerType", value = "版权方类型", paramType = "query", dataType = "String", required = true)
})
@GetMapping("/getList")
@RequiresPermissions("copyright:owner:list")
@ApiOperation(value = "获取版权方全部列表(无分页)", notes = "获取版权方全部列表(无分页)")
public Map<String, Object> getCopyrightOwnerList() {
List<CopyrightOwner> copyrightOwnerList = copyrightOwnerService.list(Wrappers.<CopyrightOwner>lambdaQuery());
public Map<String, Object> getCopyrightOwnerList(@RequestParam("copyrightOwnerType") CopyrightOwnerTypeEnum copyrightOwnerTypeEnum) {
LambdaQueryWrapper<CopyrightOwner> lambdaQueryWrapper = Wrappers.<CopyrightOwner>lambdaQuery().eq(CopyrightOwner::getOwnerType, copyrightOwnerTypeEnum.name());
lambdaQueryWrapper.le(CopyrightOwner::getExpireDateStart, TimeUtils.getDateTimeOfTimestamp(System.currentTimeMillis()))
.ge(CopyrightOwner::getExpireDateEnd, TimeUtils.getDateTimeOfTimestamp(System.currentTimeMillis()));
List<CopyrightOwner> copyrightOwnerList = copyrightOwnerService.list(lambdaQueryWrapper);
return getResult(copyrightOwnerList);
}
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "_index", value = "分页起始偏移量", paramType = "query", dataType = "Integer"),
@ApiImplicitParam(name = "_size", value = "返回条数", paramType = "query", dataType = "Integer"),
@ApiImplicitParam(name = "ownerType", value = "版权方类型", paramType = "query", dataType = "String", required = true),
@ApiImplicitParam(name = "nameOrCode", value = "名称或编码", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "startDate", value = "创建时间-开始", paramType = "query", dataType = "String"),
@ApiImplicitParam(name = "endDate", value = "创建时间-结束", paramType = "query", dataType = "String")
......@@ -157,6 +165,7 @@ public class CopyrightOwnerController extends BaseController {
@ApiOperation(value = "获取版权方分页列表", notes = "获取版权方分页列表")
public Map<String, Object> getCopyrightOwnerPageList(GenericPageParam genericPageParam) {
LambdaQueryWrapper<CopyrightOwner> queryWrapper = new LambdaQueryWrapper<>();
queryWrapper.eq(CopyrightOwner::getOwnerType, genericPageParam.getOwnerType());
// 对名称或编码模糊查询
if (StringUtils.isNotBlank(genericPageParam.getNameOrCode())) {
queryWrapper.like(CopyrightOwner::getName, genericPageParam.getNameOrCode());
......@@ -172,15 +181,27 @@ public class CopyrightOwnerController extends BaseController {
queryWrapper.select(
CopyrightOwner::getId,
CopyrightOwner::getName,
CopyrightOwner::getExpireDateStart,
CopyrightOwner::getExpireDateEnd,
CopyrightOwner::getRemarks,
CopyrightOwner::getCreateTime,
CopyrightOwner::getUpdateTime);
Page<CopyrightOwner> page = this.copyrightOwnerService.page(getPage(), queryWrapper);
for (CopyrightOwner copyrightOwner : page.getRecords()) {
if (CopyrightOwnerTypeEnum.ASSET.name().equals(genericPageParam.getOwnerType())) {
final List<CopyrightOwnerAssetType> CopyrightOwnerAssetTypeList = this.copyrightOwnerAssetTypeService.list(Wrappers.<CopyrightOwnerAssetType>lambdaQuery().eq(CopyrightOwnerAssetType::getCopyrightOwnerId, copyrightOwner.getId()));
final List<String> idList = CopyrightOwnerAssetTypeList.stream().map(CopyrightOwnerAssetType::getAssetTypeId).collect(Collectors.toList());
List<AssetType> assetTypeList = this.assetTypeService.listByIds(idList);
final String assetTypeNameList = assetTypeList.stream().map(AssetType::getName).collect(Collectors.joining("、"));
copyrightOwner.setAssetTypeNames(assetTypeNameList);
} else if (CopyrightOwnerTypeEnum.EXHIBITION_BOARD.name().equals(genericPageParam.getOwnerType())) {
LambdaQueryWrapper<ExhibitionBoard> lambdaQueryWrapper = Wrappers.<ExhibitionBoard>lambdaQuery().eq(ExhibitionBoard::getBoardCopyrightOwnerId, copyrightOwner.getId());
final List<ExhibitionBoard> exhibitionBoardList = this.exhibitionBoardService.list(lambdaQueryWrapper);
final List<String> assetTypeIdList = exhibitionBoardList.stream().map(ExhibitionBoard::getAssetTypeId).collect(Collectors.toList());
final List<AssetType> assetTypeList = this.assetTypeService.listByIds(assetTypeIdList);
String assetTypeNames = assetTypeList.stream().map(AssetType::getName).collect(Collectors.joining("、"));
copyrightOwner.setAssetTypeNames(assetTypeNames);
}
}
return getResult(page);
}
......
......@@ -156,6 +156,10 @@ public class ExhibitionBoardCatController extends BaseController {
Page<ExhibitionBoardCat> page = this.exhibitionBoardCatService.page(getPage(), queryWrapper);
for (ExhibitionBoardCat exhibitionBoardCat : page.getRecords()) {
}
return getResult(page);
}
......
package cn.wisenergy.chnmuseum.party.web.controller;
import cn.hutool.core.util.ArrayUtil;
import cn.wisenergy.chnmuseum.party.common.dfs.FastDFSUtils;
import cn.wisenergy.chnmuseum.party.common.enums.FileTypeEnum;
import cn.wisenergy.chnmuseum.party.common.enums.HANDLE_STATUS_ENUM;
......@@ -7,6 +8,7 @@ import cn.wisenergy.chnmuseum.party.common.enums.RESPONSE_CODE_ENUM;
import cn.wisenergy.chnmuseum.party.common.mvc.InterfaceException;
import cn.wisenergy.chnmuseum.party.common.vo.BatchUploadResVO;
import cn.wisenergy.chnmuseum.party.common.vo.ImageUploadResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
......@@ -37,6 +39,7 @@ import java.util.Objects;
@Slf4j
@RestController
@RequestMapping("/file")
@Api(tags = {"文件上传接口"})
public class FileUploadController {
// 允许上传的格式
......@@ -46,7 +49,10 @@ public class FileUploadController {
private static final String[] VIDEO_TYPE = new String[]{"MP4", "FLV"};
// 允许上传的格式
private static final String[] DATUM_TYPE = new String[]{"PDF", "DOC", "DOCX", "XLS", "XLSX", "PPT", "PPTX", "JPG", "JPEG", "PNG", "BMP", "WBMP", "MP4", "FLV"};
private static final String[] DOC_TYPE = new String[]{"PDF", "DOC", "DOCX", "XLS", "XLSX", "PPT", "PPTX"};
// 允许上传的格式
private static final String[] DATUM_TYPE = ArrayUtil.addAll(DOC_TYPE, IMAGE_TYPE, VIDEO_TYPE);
// @RequestMapping(value = "/upload", method = RequestMethod.POST)
// public ResponseEntity<PicUploadResult> upload(@RequestParam(value = "bc_cover", required = true) MultipartFile uploadFile, HttpServletResponse response) throws Exception {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment