Commit 2e53c8a0 authored by nie'hong's avatar nie'hong

修改-项目主内容在审批前还能够修改项目

parent 1cb4be95
...@@ -100,4 +100,8 @@ public class LearningProject implements Serializable { ...@@ -100,4 +100,8 @@ public class LearningProject implements Serializable {
@TableField(exist = false) @TableField(exist = false)
private LearningContent majorLearning; private LearningContent majorLearning;
@ApiModelProperty("项目的主学习内容的审核状态|")
@TableField(exist = false)
private String auditStatus;
} }
...@@ -37,10 +37,6 @@ public class TVideoVisitor implements Serializable { ...@@ -37,10 +37,6 @@ public class TVideoVisitor implements Serializable {
@TableField("video_id") @TableField("video_id")
private String videoId; private String videoId;
@ApiModelProperty(value = "area", name = "地区")
@TableField("area")
private String area;
@ApiModelProperty(value = "area", name = "地区编码") @ApiModelProperty(value = "area", name = "地区编码")
@TableField("area_code") @TableField("area_code")
private String areaCode; private String areaCode;
......
...@@ -236,7 +236,7 @@ public class ExhibitionBoardController extends BaseController { ...@@ -236,7 +236,7 @@ public class ExhibitionBoardController extends BaseController {
@ApiOperation(value = "根据学习项目获取展板全部列表(无分页)", notes = "根据学习项目获取展板全部列表(无分页)") @ApiOperation(value = "根据学习项目获取展板全部列表(无分页)", notes = "根据学习项目获取展板全部列表(无分页)")
@MethodLog(operModule = OperModule.DISPLAYCONTENT, operType = OperType.SELECT) @MethodLog(operModule = OperModule.DISPLAYCONTENT, operType = OperType.SELECT)
public Map<String, Object> getExhibitionBoardList(String learningProjectId, @RequestParam(value = "exhibitionBoardCatIdList") List<String> boardCatIds) { public Map<String, Object> getExhibitionBoardList(String learningProjectId, @RequestParam(value = "exhibitionBoardCatIdList") List<String> boardCatIds) {
if (StringUtils.isBlank(learningProjectId)) { if (StringUtils.isEmpty(learningProjectId)) {
return getFailResult("学习项目不能为空!"); return getFailResult("学习项目不能为空!");
} }
if (CollectionUtils.isEmpty(boardCatIds)) { if (CollectionUtils.isEmpty(boardCatIds)) {
...@@ -582,7 +582,6 @@ public class ExhibitionBoardController extends BaseController { ...@@ -582,7 +582,6 @@ public class ExhibitionBoardController extends BaseController {
} }
} }
} }
} }
final ExhibitionBoard exhibitionBoard = this.exhibitionBoardService.getById(id); final ExhibitionBoard exhibitionBoard = this.exhibitionBoardService.getById(id);
......
...@@ -28,6 +28,7 @@ import org.springframework.validation.annotation.Validated; ...@@ -28,6 +28,7 @@ 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 java.util.ArrayList;
import java.util.List; import java.util.List;
import java.util.Map; import java.util.Map;
...@@ -113,7 +114,7 @@ public class LearningProjectController extends BaseController { ...@@ -113,7 +114,7 @@ public class LearningProjectController extends BaseController {
return getFailResult(); return getFailResult();
} }
// 查询项目的主学习内容 // 查询项目的主学习内容
LambdaQueryWrapper<LearningContent> queryWrapper = Wrappers.<LearningContent>lambdaQuery(); LambdaQueryWrapper<LearningContent> queryWrapper = Wrappers.lambdaQuery();
queryWrapper.eq(LearningContent::getLearningProjectId, learningProject.getId()); queryWrapper.eq(LearningContent::getLearningProjectId, learningProject.getId());
queryWrapper.eq(LearningContent::getIsMajor, true); queryWrapper.eq(LearningContent::getIsMajor, true);
LearningContent one = this.learningContentService.getOne(queryWrapper); LearningContent one = this.learningContentService.getOne(queryWrapper);
...@@ -121,14 +122,14 @@ public class LearningProjectController extends BaseController { ...@@ -121,14 +122,14 @@ public class LearningProjectController extends BaseController {
return getFailResult("该学习项目下没有主学习内容"); return getFailResult("该学习项目下没有主学习内容");
} }
// 查询该学习项目的子学习内容版权方、展板分类、展板 // 查询该学习项目的子学习内容版权方、展板分类、展板
LambdaQueryWrapper<LearningContent> lambdaQueryWrapper = Wrappers.<LearningContent>lambdaQuery(); LambdaQueryWrapper<LearningContent> lambdaQueryWrapper = Wrappers.lambdaQuery();
lambdaQueryWrapper.eq(LearningContent::getLearningProjectId, learningProject.getId()); lambdaQueryWrapper.eq(LearningContent::getLearningProjectId, learningProject.getId());
lambdaQueryWrapper.eq(LearningContent::getIsMajor, false); // lambdaQueryWrapper.eq(LearningContent::getIsMajor, false);
lambdaQueryWrapper.select(LearningContent::getId); lambdaQueryWrapper.select(LearningContent::getId);
List<String> list = this.learningContentService.listObjs(lambdaQueryWrapper, Object::toString); List<String> list = this.learningContentService.listObjs(lambdaQueryWrapper, Object::toString);
if (CollectionUtil.isNotEmpty(list)) { if (CollectionUtil.isNotEmpty(list)) {
// 查询子学习内容的版权方 // 查询子学习内容的版权方
LambdaQueryWrapper<LearningContentCopyrightOwner> query = Wrappers.<LearningContentCopyrightOwner>lambdaQuery(); LambdaQueryWrapper<LearningContentCopyrightOwner> query = Wrappers.lambdaQuery();
query.in(LearningContentCopyrightOwner::getLearningContentId, list); query.in(LearningContentCopyrightOwner::getLearningContentId, list);
query.select(LearningContentCopyrightOwner::getCopyrightOwnerId); query.select(LearningContentCopyrightOwner::getCopyrightOwnerId);
List<String> list1 = this.learningContentCopyrightOwnerService.listObjs(query, Object::toString); List<String> list1 = this.learningContentCopyrightOwnerService.listObjs(query, Object::toString);
...@@ -150,7 +151,7 @@ public class LearningProjectController extends BaseController { ...@@ -150,7 +151,7 @@ public class LearningProjectController extends BaseController {
} }
// 查询子学习内容的展板分类 // 查询子学习内容的展板分类
LambdaQueryWrapper<LearningContentBoardCat> query1 = Wrappers.<LearningContentBoardCat>lambdaQuery(); LambdaQueryWrapper<LearningContentBoardCat> query1 = Wrappers.lambdaQuery();
query1.in(LearningContentBoardCat::getLearningContentId, list); query1.in(LearningContentBoardCat::getLearningContentId, list);
query1.select(LearningContentBoardCat::getExhibitionBoardCatId); query1.select(LearningContentBoardCat::getExhibitionBoardCatId);
List<String> list2 = this.learningContentBoardCatService.listObjs(query1, Object::toString); List<String> list2 = this.learningContentBoardCatService.listObjs(query1, Object::toString);
...@@ -173,7 +174,7 @@ public class LearningProjectController extends BaseController { ...@@ -173,7 +174,7 @@ public class LearningProjectController extends BaseController {
} }
// 查询子学习内容的展板 // 查询子学习内容的展板
LambdaQueryWrapper<LearningContentBoard> query2 = Wrappers.<LearningContentBoard>lambdaQuery(); LambdaQueryWrapper<LearningContentBoard> query2 = Wrappers.lambdaQuery();
query2.in(LearningContentBoard::getLearningContentId, list); query2.in(LearningContentBoard::getLearningContentId, list);
query2.select(LearningContentBoard::getExhibitionBoardId); query2.select(LearningContentBoard::getExhibitionBoardId);
List<String> list3 = this.learningContentBoardService.listObjs(query2, Object::toString); List<String> list3 = this.learningContentBoardService.listObjs(query2, Object::toString);
...@@ -182,7 +183,11 @@ public class LearningProjectController extends BaseController { ...@@ -182,7 +183,11 @@ public class LearningProjectController extends BaseController {
// 差集 // 差集
list3.removeAll(learningProject.getExhibitionBoardIdList()); list3.removeAll(learningProject.getExhibitionBoardIdList());
// 查询被删除的展板信息 // 查询被删除的展板信息
List<ExhibitionBoard> exhibitionBoards = this.exhibitionBoardService.listByIds(list3); LambdaQueryWrapper<ExhibitionBoard> lambdaQuery = Wrappers.lambdaQuery();
lambdaQuery.eq(ExhibitionBoard::getPublished, true);
lambdaQuery.in(ExhibitionBoard::getId, list3);
List<ExhibitionBoard> exhibitionBoards = this.exhibitionBoardService.list(lambdaQuery);
// 被删除的展板名称
StringBuilder stringBuilder = new StringBuilder(); StringBuilder stringBuilder = new StringBuilder();
exhibitionBoards.forEach(s -> { exhibitionBoards.forEach(s -> {
stringBuilder.append(s.getName()); stringBuilder.append(s.getName());
...@@ -202,8 +207,8 @@ public class LearningProjectController extends BaseController { ...@@ -202,8 +207,8 @@ public class LearningProjectController extends BaseController {
.cover(learningProject.getCover()) .cover(learningProject.getCover())
.exhibitionBoardCatIdList(learningProject.getExhibitionBoardCatIdList()) .exhibitionBoardCatIdList(learningProject.getExhibitionBoardCatIdList())
.exhibitionBoardIdList(learningProject.getExhibitionBoardIdList()).build(); .exhibitionBoardIdList(learningProject.getExhibitionBoardIdList()).build();
this.learningContentController.updateLearningContent(learningContent); Map<String, Object> map = this.learningContentController.updateLearningContent(learningContent);
return getSuccessResult(); return map;
} }
@GetMapping("/getList") @GetMapping("/getList")
...@@ -247,11 +252,19 @@ public class LearningProjectController extends BaseController { ...@@ -247,11 +252,19 @@ public class LearningProjectController extends BaseController {
LearningProject::getCreateTime, LearningProject::getCreateTime,
LearningProject::getUpdateTime); LearningProject::getUpdateTime);
Page<LearningProject> page = this.learningProjectService.page(getPage(), queryWrapper); Page<LearningProject> page = this.learningProjectService.page(getPage(), queryWrapper);
for (LearningProject learningProject : page.getRecords()) { for (LearningProject learningProject : page.getRecords()) {
LambdaQueryWrapper<LearningContent> lambdaQueryWrapper = Wrappers.<LearningContent>lambdaQuery() LambdaQueryWrapper<LearningContent> lambdaQueryWrapper = Wrappers.<LearningContent>lambdaQuery()
.eq(LearningContent::getLearningProjectId, learningProject.getId()); .eq(LearningContent::getLearningProjectId, learningProject.getId());
lambdaQueryWrapper.select(LearningContent::getName); List<LearningContent> learningContentList = this.learningContentService.list(lambdaQueryWrapper);
List<String> learningContentNameList = this.learningContentService.listObjs(lambdaQueryWrapper, Object::toString); List<String> learningContentNameList = new ArrayList<>();
learningContentList.forEach(s->{
if (s.getIsMajor()) {
learningProject.setAuditStatus(s.getAuditStatus());
}else {
learningContentNameList.add(s.getName());
}
});
learningProject.setLearningContentNames(String.join("、", learningContentNameList)); learningProject.setLearningContentNames(String.join("、", learningContentNameList));
} }
return getResult(page); return getResult(page);
......
...@@ -88,13 +88,10 @@ public class StatisticController extends BaseController { ...@@ -88,13 +88,10 @@ public class StatisticController extends BaseController {
Map<String, String> addressByIp = AddressUtil.getAddressByIp(ipAddress); Map<String, String> addressByIp = AddressUtil.getAddressByIp(ipAddress);
if (StringUtils.isNotBlank(addressByIp.get("region"))) { if (StringUtils.isNotBlank(addressByIp.get("region"))) {
tVideoVisitor.setAreaCode(addressByIp.get("regionCode")); tVideoVisitor.setAreaCode(addressByIp.get("regionCode"));
tVideoVisitor.setArea(addressByIp.get("region"));
}else if(StringUtils.isNotBlank(addressByIp.get("city"))){ }else if(StringUtils.isNotBlank(addressByIp.get("city"))){
tVideoVisitor.setAreaCode(addressByIp.get("cityCode")); tVideoVisitor.setAreaCode(addressByIp.get("cityCode"));
tVideoVisitor.setArea(addressByIp.get("city"));
}else { }else {
tVideoVisitor.setAreaCode(addressByIp.get("proCode")); tVideoVisitor.setAreaCode(addressByIp.get("proCode"));
tVideoVisitor.setArea(addressByIp.get("pro"));
} }
// 该条信息的创建时间和更新时间 // 该条信息的创建时间和更新时间
......
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