附件上传-督评联三个系列所有活动的附件上传后新增一个选项(关联近期会议、不关联),打通会议文件功能模块,选择关联的会议后此附件自动上传到所选的会议文件内,可在会议文件中直接查看
This commit is contained in:
parent
493f5c1f11
commit
e4f90124d0
|
@ -16,7 +16,9 @@ import com.ydool.boot.modules.sys.entity.Street;
|
|||
import com.ydool.boot.modules.sys.service.StreetService;
|
||||
import io.swagger.annotations.Api;
|
||||
import io.swagger.annotations.ApiImplicitParam;
|
||||
import io.swagger.annotations.ApiImplicitParams;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.web.bind.annotation.GetMapping;
|
||||
import org.springframework.web.bind.annotation.RequestMapping;
|
||||
|
@ -57,6 +59,7 @@ public class ApiBaseDataController extends ApiBaseController {
|
|||
@Autowired
|
||||
private OfficeService officeService;
|
||||
|
||||
|
||||
@GetMapping("street")
|
||||
@ResponseBody
|
||||
@ApiOperation(value = "获取街道列表")
|
||||
|
@ -141,4 +144,18 @@ public class ApiBaseDataController extends ApiBaseController {
|
|||
render(Ret.ok().data(ConfigUtils.getStr(code)));
|
||||
}
|
||||
|
||||
@GetMapping("associationMeeting")
|
||||
@ResponseBody
|
||||
@ApiOperation(value = "附件关联会议")
|
||||
@ApiImplicitParams({
|
||||
@ApiImplicitParam(name = "conferenceId", value = "关联会议id", required = true),
|
||||
@ApiImplicitParam(name = "attachment", value = "关联附件路径", required = true),
|
||||
@ApiImplicitParam(name = "title", value = "附件名", required = true),
|
||||
@ApiImplicitParam(name = "headline", value = "会议议题(附件所属的主题名)", required = true)
|
||||
})
|
||||
public void associationMeeting(String conferenceId, String attachment, String title, String headline) {
|
||||
boolean flag = conferenceAttachmentService.associationMeeting(conferenceId, attachment, title, headline, getApiUserId());
|
||||
renderJson(!flag ? Ret.fail("操作失败") : Ret.ok());
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -5,8 +5,8 @@ import com.baomidou.mybatisplus.annotation.TableName;
|
|||
import com.ydool.boot.core.entity.BaseEntity;
|
||||
import com.ydool.boot.core.entity.TreeEntity;
|
||||
import io.swagger.annotations.ApiModelProperty;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.*;
|
||||
import lombok.experimental.Accessors;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
|
||||
import java.util.List;
|
||||
|
@ -20,6 +20,9 @@ import java.util.List;
|
|||
* @since 2020-10-15
|
||||
*/
|
||||
@Data
|
||||
@Builder
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@TableName("t_conference_attachment")
|
||||
public class ConferenceAttachment extends TreeEntity {
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
package com.ydool.boot.modules.rddb.service;
|
||||
|
||||
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.ydool.boot.core.service.BaseService;
|
||||
import com.ydool.boot.core.service.BaseTreeService;
|
||||
|
@ -7,6 +8,9 @@ import com.ydool.boot.modules.rddb.entity.ConferenceAttachment;
|
|||
import com.ydool.boot.modules.rddb.mapper.ConferenceAttachmentMapper;
|
||||
import org.springframework.beans.factory.annotation.Autowired;
|
||||
import org.springframework.stereotype.Service;
|
||||
import org.springframework.transaction.annotation.Transactional;
|
||||
|
||||
import java.time.LocalDateTime;
|
||||
|
||||
/**
|
||||
* <p>
|
||||
|
@ -25,4 +29,58 @@ public class ConferenceAttachmentService extends BaseTreeService<ConferenceAttac
|
|||
public Page page(Page page, String conferenceTitle, String attachmentTitle) {
|
||||
return conferenceAttachmentMapper.page(page, conferenceTitle, attachmentTitle);
|
||||
}
|
||||
|
||||
@Transactional
|
||||
public boolean associationMeeting(String conferenceId, String attachment, String title, String headline, String userId) {
|
||||
boolean flag = false;
|
||||
//查找议题是否存在
|
||||
ConferenceAttachment conferenceAttachment = getOne(new QueryWrapper<ConferenceAttachment>().eq("conference_id", conferenceId).eq("title", headline));
|
||||
//已存在
|
||||
if (conferenceAttachment != null) {
|
||||
ConferenceAttachment conferenceAttachment1 = new ConferenceAttachment()
|
||||
.builder()
|
||||
.title(title)
|
||||
.conferenceId(conferenceId)
|
||||
.attachment(attachment)
|
||||
.pid(conferenceAttachment.getId())
|
||||
.createdId(userId)
|
||||
.updatedId(userId)
|
||||
.build();
|
||||
conferenceAttachment1.setCreatedAt(LocalDateTime.now());
|
||||
conferenceAttachment1.setUpdatedAt(LocalDateTime.now());
|
||||
flag = saveOrUpdate(conferenceAttachment1);
|
||||
}
|
||||
//不存在
|
||||
else {
|
||||
//创建议题
|
||||
ConferenceAttachment conferenceAttachment2 = new ConferenceAttachment()
|
||||
.builder()
|
||||
.title(headline)
|
||||
.conferenceId(conferenceId)
|
||||
.attachment(attachment)
|
||||
.createdId(userId)
|
||||
.updatedId(userId)
|
||||
.pid("")
|
||||
.build();
|
||||
conferenceAttachment2.setCreatedAt(LocalDateTime.now());
|
||||
conferenceAttachment2.setUpdatedAt(LocalDateTime.now());
|
||||
flag = saveOrUpdate(conferenceAttachment2);
|
||||
|
||||
System.out.println(conferenceAttachment2);
|
||||
//创建附件
|
||||
ConferenceAttachment conferenceAttachment1 = new ConferenceAttachment()
|
||||
.builder()
|
||||
.title(title)
|
||||
.conferenceId(conferenceId)
|
||||
.attachment(attachment)
|
||||
.pid(conferenceAttachment2.getId())
|
||||
.createdId(userId)
|
||||
.updatedId(userId)
|
||||
.build();
|
||||
conferenceAttachment1.setCreatedAt(LocalDateTime.now());
|
||||
conferenceAttachment1.setUpdatedAt(LocalDateTime.now());
|
||||
flag = saveOrUpdate(conferenceAttachment1);
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue