Commit f7d53dcb authored by liqin's avatar liqin 💬

bug fixed

parent 13a3dcb0
package cn.chnmuseum.party.model;
import cn.chnmuseum.party.common.validator.groups.Add;
import cn.chnmuseum.party.common.validator.groups.Update;
import com.baomidou.mybatisplus.annotation.*;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.time.LocalDateTime;
/**
* <p>
* 文件资产临时
* </p>
*
* @author Danny Lee
* @since 2021-04-18
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@TableName("asset_tmp")
@ApiModel(value = "文件资产临时", description = "文件资产临时")
public class AssetTmp implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty("文件资产ID")
@TableId(value = "id", type = IdType.ASSIGN_ID)
@NotNull(message = "文件资产ID不能为空", groups = {Add.class, Update.class})
private String id;
@ApiModelProperty("所属项ID")
@TableField("ref_item_id")
private String refItemId;
@ApiModelProperty("原始文件名")
@TableField("file_name")
private String fileName;
@ApiModelProperty("加密后文件名")
@TableField("file_name_crypto")
private String fileNameCrypto;
@ApiModelProperty("扩展名")
@TableField("file_ext_name")
private String fileExtName;
@ApiModelProperty("文件类型")
@TableField("file_type")
private String fileType;
@ApiModelProperty("文件分类")
@TableField("file_cat")
private String fileCat;
@ApiModelProperty("文件大小(B)")
@TableField("file_size")
private Long fileSize;
@ApiModelProperty("下载链接")
@TableField("file_url")
private String fileUrl;
@ApiModelProperty("加密链接")
@TableField("file_url_crypto")
private String fileUrlCrypto;
@ApiModelProperty("视频缩略图")
@TableField("thumbnail")
private String thumbnail;
@ApiModelProperty("语言")
@TableField("language")
private String language;
@ApiModelProperty("MD5")
@TableField("md5")
private String md5;
@TableField("crc32")
private Long crc32;
@TableField("video_content_name")
private String videoContentName;
@ApiModelProperty("创建日期")
@TableField(value = "create_time", fill = FieldFill.INSERT)
private LocalDateTime createTime;
@ApiModelProperty("修改日期")
@TableField(value = "update_time", fill = FieldFill.INSERT_UPDATE)
private LocalDateTime updateTime;
}
......@@ -158,18 +158,10 @@ public class ExhibitionBoard implements Serializable {
@TableField(exist = false)
private List<Asset> audioList;
@ApiModelProperty("展板视频(审核详情使用)")
@TableField(exist = false)
private List<AssetTmp> audioTmpList;
@ApiModelProperty("参考资料列表")
@TableField(exist = false)
private List<Asset> datumList;
@ApiModelProperty("参考资料列表(审核详情使用)")
@TableField(exist = false)
private List<AssetTmp> datumTmpList;
@ApiModelProperty("审核意见记录")
@TableField(exist = false)
private List<Audit> auditHistoryList;
......
package cn.chnmuseum.party.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* <p>
* 展板临时
* </p>
*
* @author Danny Lee
* @since 2021-04-17
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@TableName("exhibition_board_tmp")
public class ExhibitionBoardTmp implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(hidden = true)
@TableId(value = "id", type = IdType.INPUT)
private String id;
@ApiModelProperty(hidden = true)
@TableField("data")
private String data;
}
package cn.chnmuseum.party.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* <p>
* 学习内容临时
* </p>
*
* @author Danny Lee
* @since 2021-04-17
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@TableName("learning_content_tmp")
public class LearningContentTmp implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(hidden = true)
@TableId(value = "id", type = IdType.INPUT)
private String id;
@ApiModelProperty(hidden = true)
@TableField("data")
private String data;
}
package cn.chnmuseum.party.model;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;
import lombok.experimental.Accessors;
import java.io.Serializable;
/**
* <p>
* 视频内容临时
* </p>
*
* @author Danny Lee
* @since 2021-04-17
*/
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@Accessors(chain = true)
@EqualsAndHashCode(callSuper = false)
@TableName("video_content_tmp")
public class VideoContentTmp implements Serializable {
private static final long serialVersionUID = 1L;
@ApiModelProperty(hidden = true)
@TableId(value = "id", type = IdType.INPUT)
private String id;
@ApiModelProperty(hidden = true)
@TableField("data")
private String data;
}
......@@ -15,7 +15,6 @@ import cn.chnmuseum.party.service.*;
import cn.chnmuseum.party.web.controller.base.BaseController;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
......@@ -154,61 +153,14 @@ public class LearningContentController extends BaseController {
@ApiOperation(value = "修改学习内容信息", notes = "修改学习内容信息")
@MethodLog(operModule = OperModule.LEARNCONTENT, operType = OperType.UPDATE)
public Map<String, Object> updateLearningContent(@Validated(value = {Update.class}) LearningContent learningContent) {
final LambdaQueryWrapper<LearningContent> lambdaQueryWrapper = Wrappers.<LearningContent>lambdaQuery().eq(LearningContent::getName, learningContent.getName().trim());
lambdaQueryWrapper.ne(LearningContent::getId, learningContent.getId());
final int count = this.learningContentService.count(lambdaQueryWrapper);
if (count > 0) {
return getFailResult("400", "名称已存在,请修改名称");
}
TUser user = getcurUser();
learningContent.setAuditStatus(AuditStatusEnum.TBC.name());
// 保存业务节点信息
final String learningContentId = learningContent.getId();
final List<String> exhibitionBoardCatIdList = learningContent.getExhibitionBoardCatIdList();
if (exhibitionBoardCatIdList != null && !exhibitionBoardCatIdList.isEmpty()) {
LambdaUpdateWrapper<LearningContentBoardCat> lambdaUpdateWrapper = Wrappers.<LearningContentBoardCat>lambdaUpdate().eq(LearningContentBoardCat::getLearningContentId, learningContentId);
this.learningContentBoardCatService.remove(lambdaUpdateWrapper);
for (String exhibitionBoardCatId : exhibitionBoardCatIdList) {
LearningContentBoardCat learningContentBoardCat = LearningContentBoardCat.builder().exhibitionBoardCatId(exhibitionBoardCatId).learningContentId(learningContentId).build();
this.learningContentBoardCatService.save(learningContentBoardCat);
}
}
final List<String> copyrightOwnerIdList = learningContent.getCopyrightOwnerIdList();
if (copyrightOwnerIdList != null && !copyrightOwnerIdList.isEmpty()) {
LambdaUpdateWrapper<LearningContentCopyrightOwner> lambdaUpdateWrapper = Wrappers.<LearningContentCopyrightOwner>lambdaUpdate().eq(LearningContentCopyrightOwner::getLearningContentId, learningContentId);
this.learningContentCopyrightOwnerService.remove(lambdaUpdateWrapper);
for (String copyrightOwnerId : copyrightOwnerIdList) {
LearningContentCopyrightOwner contentCopyrightOwner = LearningContentCopyrightOwner.builder().copyrightOwnerId(copyrightOwnerId).learningContentId(learningContentId).build();
this.learningContentCopyrightOwnerService.save(contentCopyrightOwner);
}
}
final LearningContent one = this.learningContentService.getById(learningContent.getId());
one.setAuditStatus(AuditStatusEnum.TBC.name());
this.learningContentService.updateById(one);
final List<String> exhibitionBoardIdList = learningContent.getExhibitionBoardIdList();
if (exhibitionBoardIdList != null && !exhibitionBoardIdList.isEmpty()) {
LambdaUpdateWrapper<LearningContentBoard> lambdaUpdateWrapper = Wrappers.<LearningContentBoard>lambdaUpdate().eq(LearningContentBoard::getLearningContentId, learningContentId);
this.learningContentBoardService.remove(lambdaUpdateWrapper);
for (String exhibitionBoardId : exhibitionBoardIdList) {
LearningContentBoard learningContentBoard = LearningContentBoard.builder()
.learningContentId(learningContentId)
.exhibitionBoardCatId(this.exhibitionBoardService.getById(exhibitionBoardId).getExhibitionBoardCatId())
.exhibitionBoardId(exhibitionBoardId)
.build();
this.learningContentBoardService.save(learningContentBoard);
}
}
boolean flag = learningContentService.updateById(learningContent);
if (flag) {
final Audit audit = Audit.builder()
.content(learningContent.getName())
.name(learningContent.getName())
.userId(user.getId())
.userId(getcurUser().getId())
.refItemId(learningContent.getId())
.type(AuditTypeEnum.LEARNING_CONTENT.name())
.operation(AuditOperationEnum.EDIT.name())
......@@ -216,11 +168,8 @@ public class LearningContentController extends BaseController {
.level(AuditStatusEnum.TBC.name())
.build();
this.auditService.save(audit);
return getSuccessResult();
}
return getFailResult();
}
@GetMapping("/getList")
@RequiresAuthentication //@RequiresPermissions("learning:content:list")
......
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