提交 bfdae58c authored 作者: renjiancai's avatar renjiancai

--no commit message

上级 df7f0394
......@@ -10,7 +10,8 @@ import lombok.Data;
@Data
@ApiModel(value = "SaveContributeForm", description = "保存内容form")
public class SaveContributeForm {
@ApiModelProperty("id,新增不需要")
private String id;
@ApiModelProperty("标题")
private String title;
@ApiModelProperty("视频说明")
......
......@@ -28,9 +28,11 @@ public class FgContributeOneVo {
@ApiModelProperty("区域管理员")
private String userType_2;
@ApiModelProperty("视频")
private String video;
private String videoPath;
@ApiModelProperty("上传时间")
private Date uploadTime;
@ApiModelProperty("头像")
private String image;
@ApiModelProperty("中心管理员头像")
private String image_1;
@ApiModelProperty("区域管理员头像")
private String image_2;
}
......@@ -74,23 +74,29 @@ public class FgContributeController {
User user = fgUserService.selectByPrimaryKey(userId);
//查询当前用户所属区域部门
Integer deptId = fgUserService.getDeptIdByUserId(userId).get(0);
if(count<5) {
Contribute contibute = new Contribute();
BeanUtils.copyProperties(form, contibute);
contibute.setUploadTime(new Date());
contibute.setUserId(userId);
contibute.setStatus(ContributeEnum.NOT_REVIEW.getCode());
contibute.setUserName(userName);
contibute.setArea_adminId(user.getArea_adminId());
if(deptId != null) {
DeptVO deptVO = fgDepartmentService.get(deptId);
if(deptVO != null) {
contibute.setDepartment(deptVO.getDeptName());
contibute.setDepartmentId(deptVO.getDeptId());
if(form.getId()==null) {
BeanUtils.copyProperties(form, contibute);
contibute.setUploadTime(new Date());
contibute.setUserId(userId);
contibute.setStatus(ContributeEnum.NOT_REVIEW.getCode());
contibute.setUserName(userName);
contibute.setArea_adminId(user.getArea_adminId());
if(deptId != null) {
DeptVO deptVO = fgDepartmentService.get(deptId);
if(deptVO != null) {
contibute.setDepartment(deptVO.getDeptName());
contibute.setDepartmentId(deptVO.getDeptId());
}
}
service.insert(contibute);
}else {
contibute=service.selectByPrimaryKey(contibute.getId());
BeanUtils.copyProperties(form, contibute);
contibute.setUpdateTime(new Date());
service.updateByPrimaryKeySelective(contibute);
}
service.insert(contibute);
}else {
throw new BusinessValidateException(1, "投稿条数上限!");
}
......@@ -117,7 +123,7 @@ public class FgContributeController {
vo.setUserType_2("区域管理员");
User user=fgUserService.selectByPrimaryKey(contributeRelation.getUserId());
if(user!=null) {
vo.setImage(user.getImg());
vo.setImage_1(user.getImg());
}
}else if(contributeRelation.getUserType().equals(UserTypeEnum.TYPE_2.getCode())){
vo.setOpinion_1(contributeRelation.getOpinion());
......@@ -125,14 +131,14 @@ public class FgContributeController {
vo.setUserType_1("中心管理员");
User user=fgUserService.selectByPrimaryKey(contributeRelation.getUserId());
if(user!=null) {
vo.setImage(user.getImg());
vo.setImage_2(user.getImg());
}
}
}
List<String> fileNameList = Arrays.asList(vo.getVideo());
List<String> fileNameList = Arrays.asList(vo.getVideoPath());
CallBack<List<String>> result = fileInfoClient.getFilePath(fileNameList);
if (result.hasEntity() && ArrayUtils.isNotEmpty(result.getData())) {
vo.setVideo(result.getData().get(0));
vo.setVideoPath(result.getData().get(0));
}
return CallBack.success(vo);
}
......
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论