add: 内外部会议模块增删改查
This commit is contained in:
+11
@@ -7,6 +7,7 @@ import com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutSideMeeting;
|
|||||||
import com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutsideMeetingVO;
|
import com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutsideMeetingVO;
|
||||||
import com.adc.da.slrs.InsideOntSideMeeting.service.InsideOutsideMeetingService;
|
import com.adc.da.slrs.InsideOntSideMeeting.service.InsideOutsideMeetingService;
|
||||||
import io.swagger.annotations.ApiOperation;
|
import io.swagger.annotations.ApiOperation;
|
||||||
|
import org.apache.commons.lang3.ObjectUtils;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.web.bind.annotation.*;
|
import org.springframework.web.bind.annotation.*;
|
||||||
|
|
||||||
@@ -58,4 +59,14 @@ public class InsideOutSideMeetingController extends BaseController<InsideOutSide
|
|||||||
meetingService.deleteMeetingById(meetingId);
|
meetingService.deleteMeetingById(meetingId);
|
||||||
return Result.success();
|
return Result.success();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ApiOperation("根据会议ID修改会议信息")
|
||||||
|
@PutMapping("/updateMeetingInfo")
|
||||||
|
public ResponseMessage<?> updateMeetingInfo(@RequestBody InsideOutSideMeeting insideOutSideMeeting) {
|
||||||
|
if (ObjectUtils.isEmpty(insideOutSideMeeting)) {
|
||||||
|
return Result.error("更新失败,会议信息不存在");
|
||||||
|
}
|
||||||
|
Boolean updateResult = meetingService.updateMeetingInfo(insideOutSideMeeting);
|
||||||
|
return updateResult ? Result.success() : Result.error("更新失败");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+6
-1
@@ -1,8 +1,10 @@
|
|||||||
package com.adc.da.slrs.InsideOntSideMeeting.entity;
|
package com.adc.da.slrs.InsideOntSideMeeting.entity;
|
||||||
|
|
||||||
import com.adc.da.base.entity.BaseEntity;
|
import com.adc.da.base.entity.BaseEntity;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
@@ -12,6 +14,7 @@ import lombok.experimental.Accessors;
|
|||||||
|
|
||||||
import java.util.Date;
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Objects;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @author tjzdw
|
* @author tjzdw
|
||||||
@@ -22,12 +25,13 @@ import java.util.List;
|
|||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@ApiModel(value="inside_outside_meeting表对象", description="内外部会议")
|
@ApiModel(value="inside_outside_meeting表对象", description="内外部会议")
|
||||||
|
@TableName("inside_outside_meeting")
|
||||||
public class InsideOutSideMeeting extends BaseEntity {
|
public class InsideOutSideMeeting extends BaseEntity {
|
||||||
|
|
||||||
private static final long serialVersionUID = 1L;
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
@ApiModelProperty(value = "主键")
|
@ApiModelProperty(value = "主键")
|
||||||
@TableId("ID")
|
@TableId(value = "ID", type = IdType.ID_WORKER_STR)
|
||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
@ApiModelProperty(value = "会议名称")
|
@ApiModelProperty(value = "会议名称")
|
||||||
@@ -72,6 +76,7 @@ public class InsideOutSideMeeting extends BaseEntity {
|
|||||||
private String secondMeetingType;
|
private String secondMeetingType;
|
||||||
|
|
||||||
@ApiModelProperty(value = "会议议题")
|
@ApiModelProperty(value = "会议议题")
|
||||||
|
@TableField(exist = false)
|
||||||
private List<MeetingTopic> meetingTopicList;
|
private List<MeetingTopic> meetingTopicList;
|
||||||
|
|
||||||
@ApiModelProperty(value = "逻辑删除,0可用,1不可用")
|
@ApiModelProperty(value = "逻辑删除,0可用,1不可用")
|
||||||
|
|||||||
+4
-1
@@ -1,8 +1,10 @@
|
|||||||
package com.adc.da.slrs.InsideOntSideMeeting.entity;
|
package com.adc.da.slrs.InsideOntSideMeeting.entity;
|
||||||
|
|
||||||
import com.adc.da.base.entity.BaseEntity;
|
import com.adc.da.base.entity.BaseEntity;
|
||||||
|
import com.baomidou.mybatisplus.annotation.IdType;
|
||||||
import com.baomidou.mybatisplus.annotation.TableField;
|
import com.baomidou.mybatisplus.annotation.TableField;
|
||||||
import com.baomidou.mybatisplus.annotation.TableId;
|
import com.baomidou.mybatisplus.annotation.TableId;
|
||||||
|
import com.baomidou.mybatisplus.annotation.TableName;
|
||||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||||
import io.swagger.annotations.ApiModel;
|
import io.swagger.annotations.ApiModel;
|
||||||
import io.swagger.annotations.ApiModelProperty;
|
import io.swagger.annotations.ApiModelProperty;
|
||||||
@@ -21,10 +23,11 @@ import java.util.Date;
|
|||||||
@EqualsAndHashCode(callSuper = true)
|
@EqualsAndHashCode(callSuper = true)
|
||||||
@Accessors(chain = true)
|
@Accessors(chain = true)
|
||||||
@ApiModel(value="meeting_topic表对象", description="会议议题表")
|
@ApiModel(value="meeting_topic表对象", description="会议议题表")
|
||||||
|
@TableName("meeting_topic")
|
||||||
public class MeetingTopic extends BaseEntity {
|
public class MeetingTopic extends BaseEntity {
|
||||||
|
|
||||||
@ApiModelProperty(value = "主键")
|
@ApiModelProperty(value = "主键")
|
||||||
@TableId("ID")
|
@TableId(value = "ID", type = IdType.ID_WORKER_STR)
|
||||||
private String id;
|
private String id;
|
||||||
|
|
||||||
@ApiModelProperty(value = "内外部会议ID")
|
@ApiModelProperty(value = "内外部会议ID")
|
||||||
|
|||||||
+3
-1
@@ -19,5 +19,7 @@ public interface InsideOutsideMeetingService extends IService<InsideOutSideMeeti
|
|||||||
|
|
||||||
InsideOutSideMeeting getMeetingInfo(String meetingId);
|
InsideOutSideMeeting getMeetingInfo(String meetingId);
|
||||||
|
|
||||||
Integer deleteMeetingById(String meetingId);
|
Boolean deleteMeetingById(String meetingId);
|
||||||
|
|
||||||
|
Boolean updateMeetingInfo(InsideOutSideMeeting insideOutSideMeeting);
|
||||||
}
|
}
|
||||||
|
|||||||
+12
@@ -0,0 +1,12 @@
|
|||||||
|
package com.adc.da.slrs.InsideOntSideMeeting.service;
|
||||||
|
|
||||||
|
import com.adc.da.slrs.InsideOntSideMeeting.entity.MeetingTopic;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.IService;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author tjzdw
|
||||||
|
* @description
|
||||||
|
* @date 2023/10/13
|
||||||
|
*/
|
||||||
|
public interface MeetingTopicService extends IService<MeetingTopic> {
|
||||||
|
}
|
||||||
+36
-9
@@ -1,12 +1,14 @@
|
|||||||
package com.adc.da.slrs.InsideOntSideMeeting.service.impl;
|
package com.adc.da.slrs.InsideOntSideMeeting.service.impl;
|
||||||
|
|
||||||
|
import com.adc.da.base.page.Pager;
|
||||||
import com.adc.da.slrs.InsideOntSideMeeting.dao.InsideOutsideMeetingDao;
|
import com.adc.da.slrs.InsideOntSideMeeting.dao.InsideOutsideMeetingDao;
|
||||||
import com.adc.da.slrs.InsideOntSideMeeting.dao.MeetingTopicDao;
|
|
||||||
import com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutSideMeeting;
|
import com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutSideMeeting;
|
||||||
import com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutsideMeetingVO;
|
import com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutsideMeetingVO;
|
||||||
import com.adc.da.slrs.InsideOntSideMeeting.entity.MeetingTopic;
|
import com.adc.da.slrs.InsideOntSideMeeting.entity.MeetingTopic;
|
||||||
import com.adc.da.slrs.InsideOntSideMeeting.service.InsideOutsideMeetingService;
|
import com.adc.da.slrs.InsideOntSideMeeting.service.InsideOutsideMeetingService;
|
||||||
|
import com.adc.da.slrs.InsideOntSideMeeting.service.MeetingTopicService;
|
||||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||||
|
import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper;
|
||||||
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
import org.apache.commons.lang3.StringUtils;
|
import org.apache.commons.lang3.StringUtils;
|
||||||
import org.springframework.stereotype.Service;
|
import org.springframework.stereotype.Service;
|
||||||
@@ -26,7 +28,7 @@ import java.util.List;
|
|||||||
public class InsideOutsideMeetingServiceImpl extends ServiceImpl<InsideOutsideMeetingDao, InsideOutSideMeeting> implements InsideOutsideMeetingService {
|
public class InsideOutsideMeetingServiceImpl extends ServiceImpl<InsideOutsideMeetingDao, InsideOutSideMeeting> implements InsideOutsideMeetingService {
|
||||||
|
|
||||||
@Resource
|
@Resource
|
||||||
private MeetingTopicDao meetingTopicDao;
|
private MeetingTopicService meetingTopicService;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public InsideOutSideMeeting getMeetingInfo(String meetingId){
|
public InsideOutSideMeeting getMeetingInfo(String meetingId){
|
||||||
@@ -34,7 +36,7 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl<InsideOutsideMe
|
|||||||
if (insideOutSideMeeting != null) {
|
if (insideOutSideMeeting != null) {
|
||||||
LambdaQueryWrapper<MeetingTopic> wrapper = new LambdaQueryWrapper<>();
|
LambdaQueryWrapper<MeetingTopic> wrapper = new LambdaQueryWrapper<>();
|
||||||
wrapper.eq(MeetingTopic::getMeetingId, meetingId);
|
wrapper.eq(MeetingTopic::getMeetingId, meetingId);
|
||||||
List<MeetingTopic> meetingTopicList = meetingTopicDao.selectList(wrapper);
|
List<MeetingTopic> meetingTopicList = meetingTopicService.list(wrapper);
|
||||||
insideOutSideMeeting.setMeetingTopicList(meetingTopicList);
|
insideOutSideMeeting.setMeetingTopicList(meetingTopicList);
|
||||||
}
|
}
|
||||||
return insideOutSideMeeting;
|
return insideOutSideMeeting;
|
||||||
@@ -42,12 +44,35 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl<InsideOutsideMe
|
|||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@Override
|
@Override
|
||||||
public Integer deleteMeetingById(String meetingId) {
|
public Boolean deleteMeetingById(String meetingId) {
|
||||||
int deleteById = this.baseMapper.deleteById(meetingId);
|
LambdaUpdateWrapper<InsideOutSideMeeting> wrapper = new LambdaUpdateWrapper<>();
|
||||||
if (deleteById > 0) {
|
wrapper.eq(InsideOutSideMeeting::getId, meetingId);
|
||||||
meetingTopicDao.deleteById(meetingId);
|
wrapper.set(InsideOutSideMeeting::getValidFlag,1);
|
||||||
|
boolean update = update(wrapper);
|
||||||
|
if (update) {
|
||||||
|
LambdaUpdateWrapper<MeetingTopic> topicWrapper = new LambdaUpdateWrapper<>();
|
||||||
|
topicWrapper.eq(MeetingTopic::getMeetingId, meetingId);
|
||||||
|
topicWrapper.set(MeetingTopic::getValidFlag,1);
|
||||||
|
meetingTopicService.update(topicWrapper);
|
||||||
}
|
}
|
||||||
return deleteById;
|
return update;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Transactional
|
||||||
|
@Override
|
||||||
|
public Boolean updateMeetingInfo(InsideOutSideMeeting insideOutSideMeeting) {
|
||||||
|
if (StringUtils.isBlank(insideOutSideMeeting.getId())) {
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
insideOutSideMeeting.setModifyTime(new Date());
|
||||||
|
int update = this.baseMapper.updateById(insideOutSideMeeting);
|
||||||
|
if (update > 0) {
|
||||||
|
for (MeetingTopic meetingTopic : insideOutSideMeeting.getMeetingTopicList()) {
|
||||||
|
meetingTopic.setModifyTime(new Date());
|
||||||
|
meetingTopicService.updateById(meetingTopic);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Transactional
|
@Transactional
|
||||||
@@ -59,10 +84,11 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl<InsideOutsideMe
|
|||||||
int insert = this.baseMapper.insert(insideOutSideMeeting);
|
int insert = this.baseMapper.insert(insideOutSideMeeting);
|
||||||
if (!insideOutSideMeeting.getMeetingTopicList().isEmpty()) {
|
if (!insideOutSideMeeting.getMeetingTopicList().isEmpty()) {
|
||||||
for (MeetingTopic meetingTopic : insideOutSideMeeting.getMeetingTopicList()) {
|
for (MeetingTopic meetingTopic : insideOutSideMeeting.getMeetingTopicList()) {
|
||||||
|
meetingTopic.setMeetingId(insideOutSideMeeting.getId());
|
||||||
meetingTopic.setCreateTime(new Date());
|
meetingTopic.setCreateTime(new Date());
|
||||||
meetingTopic.setModifyTime(new Date());
|
meetingTopic.setModifyTime(new Date());
|
||||||
meetingTopic.setValidFlag(0);
|
meetingTopic.setValidFlag(0);
|
||||||
meetingTopicDao.insert(meetingTopic);
|
meetingTopicService.save(meetingTopic);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return insert;
|
return insert;
|
||||||
@@ -75,6 +101,7 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl<InsideOutsideMe
|
|||||||
}
|
}
|
||||||
Integer rowCount = this.baseMapper.queryByPageCount(page);
|
Integer rowCount = this.baseMapper.queryByPageCount(page);
|
||||||
page.getPager().setRowCount(rowCount);
|
page.getPager().setRowCount(rowCount);
|
||||||
|
page.setPage(page.getPage()-1);
|
||||||
return this.baseMapper.queryByPage(page);
|
return this.baseMapper.queryByPage(page);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
+16
@@ -0,0 +1,16 @@
|
|||||||
|
package com.adc.da.slrs.InsideOntSideMeeting.service.impl;
|
||||||
|
|
||||||
|
import com.adc.da.slrs.InsideOntSideMeeting.dao.MeetingTopicDao;
|
||||||
|
import com.adc.da.slrs.InsideOntSideMeeting.entity.MeetingTopic;
|
||||||
|
import com.adc.da.slrs.InsideOntSideMeeting.service.MeetingTopicService;
|
||||||
|
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
|
||||||
|
import org.springframework.stereotype.Service;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @author tjzdw
|
||||||
|
* @description
|
||||||
|
* @date 2023/10/13
|
||||||
|
*/
|
||||||
|
@Service
|
||||||
|
public class MeetingTopicServiceImpl extends ServiceImpl<MeetingTopicDao, MeetingTopic> implements MeetingTopicService {
|
||||||
|
}
|
||||||
-2
@@ -104,6 +104,4 @@
|
|||||||
order by iom.ID
|
order by iom.ID
|
||||||
limit #{page},#{pageSize}
|
limit #{page},#{pageSize}
|
||||||
</select>
|
</select>
|
||||||
|
|
||||||
|
|
||||||
</mapper>
|
</mapper>
|
||||||
Reference in New Issue
Block a user