Commit 652c8f95 authored by liqin's avatar liqin 💬

bug fixed

parent 730274bc
...@@ -48,7 +48,7 @@ public class LearningContent implements Serializable { ...@@ -48,7 +48,7 @@ public class LearningContent implements Serializable {
@NotBlank(message = "学习内容宣传图不能为空", groups = {Add.class, Update.class}) @NotBlank(message = "学习内容宣传图不能为空", groups = {Add.class, Update.class})
private String cover; private String cover;
@ApiModelProperty("适用范围") @ApiModelProperty(value = "适用范围", allowableValues = "ALL_PLAT, THIS_ORGAN, THIS_ORGAN_SUB")
@TableField("applicable_scope") @TableField("applicable_scope")
@NotBlank(message = "适用范围不能为空", groups = {Add.class, Update.class}) @NotBlank(message = "适用范围不能为空", groups = {Add.class, Update.class})
private String applicableScope; private String applicableScope;
......
...@@ -95,8 +95,7 @@ public class CopyrightOwnerController extends BaseController { ...@@ -95,8 +95,7 @@ public class CopyrightOwnerController extends BaseController {
@PutMapping("/update") @PutMapping("/update")
@RequiresPermissions("copyright:owner:update") @RequiresPermissions("copyright:owner:update")
@ApiOperation(value = "修改版权方信息", notes = "修改版权方信息") @ApiOperation(value = "修改版权方信息", notes = "修改版权方信息")
public Map<String, Object> updateCopyrightOwner(@Validated(value = {Update.class}) CopyrightOwner copyrightOwner, @RequestParam("copyrightOwnerType") CopyrightOwnerTypeEnum copyrightOwnerTypeEnum) { public Map<String, Object> updateCopyrightOwner(@Validated(value = {Update.class}) CopyrightOwner copyrightOwner) {
copyrightOwner.setOwnerType(copyrightOwnerTypeEnum.name());
boolean flag = copyrightOwnerService.updateById(copyrightOwner); boolean flag = copyrightOwnerService.updateById(copyrightOwner);
List<String> assetTypeIdList = copyrightOwner.getAssetTypeIdList(); List<String> assetTypeIdList = copyrightOwner.getAssetTypeIdList();
......
...@@ -5,10 +5,12 @@ import cn.wisenergy.chnmuseum.party.common.validator.groups.Add; ...@@ -5,10 +5,12 @@ import cn.wisenergy.chnmuseum.party.common.validator.groups.Add;
import cn.wisenergy.chnmuseum.party.common.validator.groups.Update; import cn.wisenergy.chnmuseum.party.common.validator.groups.Update;
import cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam; import cn.wisenergy.chnmuseum.party.common.vo.GenericPageParam;
import cn.wisenergy.chnmuseum.party.model.LearningContent; import cn.wisenergy.chnmuseum.party.model.LearningContent;
import cn.wisenergy.chnmuseum.party.service.LearningContentBoardCatService;
import cn.wisenergy.chnmuseum.party.service.LearningContentBoardService;
import cn.wisenergy.chnmuseum.party.service.LearningContentCopyrightOwnerService;
import cn.wisenergy.chnmuseum.party.service.LearningContentService; import cn.wisenergy.chnmuseum.party.service.LearningContentService;
import cn.wisenergy.chnmuseum.party.web.controller.base.BaseController; import cn.wisenergy.chnmuseum.party.web.controller.base.BaseController;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.update.UpdateWrapper;
import com.baomidou.mybatisplus.core.toolkit.Wrappers; import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api; import io.swagger.annotations.Api;
...@@ -22,7 +24,6 @@ import org.springframework.validation.annotation.Validated; ...@@ -22,7 +24,6 @@ import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.*; import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource; import javax.annotation.Resource;
import javax.validation.constraints.NotNull;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -42,21 +43,12 @@ public class LearningContentController extends BaseController { ...@@ -42,21 +43,12 @@ public class LearningContentController extends BaseController {
@Resource @Resource
private LearningContentService learningContentService; private LearningContentService learningContentService;
@Resource
@PostMapping("/batchSave") private LearningContentBoardCatService learningContentBoardCatService;
@RequiresPermissions("learning:content:batch:save") @Resource
@ApiOperation(value = "批量添加学习内容", notes = "批量添加学习内容") private LearningContentBoardService learningContentBoardService;
public Map<String, Object> batchSaveLearningContent(@Validated(value = {Add.class}) List<LearningContent> learningContentList) { @Resource
// 保存业务节点信息 private LearningContentCopyrightOwnerService learningContentCopyrightOwnerService;
boolean result = learningContentService.saveBatch(learningContentList);
// 返回操作结果
if (result) {
return getSuccessResult();
} else {
// 保存失败
return getFailResult();
}
}
@PostMapping("/save") @PostMapping("/save")
@RequiresPermissions("learning:content:save") @RequiresPermissions("learning:content:save")
...@@ -64,6 +56,17 @@ public class LearningContentController extends BaseController { ...@@ -64,6 +56,17 @@ public class LearningContentController extends BaseController {
public Map<String, Object> saveLearningContent(@Validated(value = {Add.class}) LearningContent learningContent) { public Map<String, Object> saveLearningContent(@Validated(value = {Add.class}) LearningContent learningContent) {
// 保存业务节点信息 // 保存业务节点信息
boolean result = learningContentService.save(learningContent); boolean result = learningContentService.save(learningContent);
// 返回操作结果 // 返回操作结果
if (result) { if (result) {
return getSuccessResult(); return getSuccessResult();
...@@ -84,24 +87,6 @@ public class LearningContentController extends BaseController { ...@@ -84,24 +87,6 @@ public class LearningContentController extends BaseController {
return getFailResult(); return getFailResult();
} }
@PutMapping("/updateAuditStatus/{id}")
@RequiresPermissions("learning:content:update:audit:status")
@ApiOperation(value = "更新学习内容审核状态", notes = "更新学习内容审核状态")
@ApiImplicitParams(value = {
@ApiImplicitParam(name = "id", value = "标识ID", dataType = "String", paramType = "path"),
@ApiImplicitParam(name = "status", value = "状态", paramType = "query", dataType = "String")
})
public Map<String, Object> updateStatus(@NotNull(message = "学习内容ID不能为空") @PathVariable("id") String id, @RequestParam("status") AuditStatusEnum status) {
UpdateWrapper<LearningContent> updateWrapper = new UpdateWrapper<>();
updateWrapper.eq("id", id);
updateWrapper.eq("audit_status", status.name());
boolean flag = learningContentService.update(updateWrapper);
if (flag) {
return getSuccessResult();
}
return getFailResult();
}
@DeleteMapping("/delete/{id}") @DeleteMapping("/delete/{id}")
@RequiresPermissions("learning:content:delete") @RequiresPermissions("learning:content:delete")
@ApiOperation(value = "根据ID删除学习内容", notes = "根据ID删除学习内容") @ApiOperation(value = "根据ID删除学习内容", notes = "根据ID删除学习内容")
......
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