add: 内外部会议模块增删改查

This commit is contained in:
wxyclub
2023-10-16 09:22:15 +08:00
parent addbc378e2
commit 01bf8b376f
8 changed files with 88 additions and 14 deletions
@@ -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.service.InsideOutsideMeetingService;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.*;
@@ -58,4 +59,14 @@ public class InsideOutSideMeetingController extends BaseController<InsideOutSide
meetingService.deleteMeetingById(meetingId);
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("更新失败");
}
}
@@ -1,8 +1,10 @@
package com.adc.da.slrs.InsideOntSideMeeting.entity;
import com.adc.da.base.entity.BaseEntity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -12,6 +14,7 @@ import lombok.experimental.Accessors;
import java.util.Date;
import java.util.List;
import java.util.Objects;
/**
* @author tjzdw
@@ -22,12 +25,13 @@ import java.util.List;
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="inside_outside_meeting表对象", description="内外部会议")
@TableName("inside_outside_meeting")
public class InsideOutSideMeeting extends BaseEntity {
private static final long serialVersionUID = 1L;
@ApiModelProperty(value = "主键")
@TableId("ID")
@TableId(value = "ID", type = IdType.ID_WORKER_STR)
private String id;
@ApiModelProperty(value = "会议名称")
@@ -72,6 +76,7 @@ public class InsideOutSideMeeting extends BaseEntity {
private String secondMeetingType;
@ApiModelProperty(value = "会议议题")
@TableField(exist = false)
private List<MeetingTopic> meetingTopicList;
@ApiModelProperty(value = "逻辑删除,0可用,1不可用")
@@ -1,8 +1,10 @@
package com.adc.da.slrs.InsideOntSideMeeting.entity;
import com.adc.da.base.entity.BaseEntity;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
@@ -21,10 +23,11 @@ import java.util.Date;
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@ApiModel(value="meeting_topic表对象", description="会议议题表")
@TableName("meeting_topic")
public class MeetingTopic extends BaseEntity {
@ApiModelProperty(value = "主键")
@TableId("ID")
@TableId(value = "ID", type = IdType.ID_WORKER_STR)
private String id;
@ApiModelProperty(value = "内外部会议ID")
@@ -19,5 +19,7 @@ public interface InsideOutsideMeetingService extends IService<InsideOutSideMeeti
InsideOutSideMeeting getMeetingInfo(String meetingId);
Integer deleteMeetingById(String meetingId);
Boolean deleteMeetingById(String meetingId);
Boolean updateMeetingInfo(InsideOutSideMeeting insideOutSideMeeting);
}
@@ -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> {
}
@@ -1,12 +1,14 @@
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.MeetingTopicDao;
import com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutSideMeeting;
import com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutsideMeetingVO;
import com.adc.da.slrs.InsideOntSideMeeting.entity.MeetingTopic;
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.update.LambdaUpdateWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
@@ -26,7 +28,7 @@ import java.util.List;
public class InsideOutsideMeetingServiceImpl extends ServiceImpl<InsideOutsideMeetingDao, InsideOutSideMeeting> implements InsideOutsideMeetingService {
@Resource
private MeetingTopicDao meetingTopicDao;
private MeetingTopicService meetingTopicService;
@Override
public InsideOutSideMeeting getMeetingInfo(String meetingId){
@@ -34,7 +36,7 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl<InsideOutsideMe
if (insideOutSideMeeting != null) {
LambdaQueryWrapper<MeetingTopic> wrapper = new LambdaQueryWrapper<>();
wrapper.eq(MeetingTopic::getMeetingId, meetingId);
List<MeetingTopic> meetingTopicList = meetingTopicDao.selectList(wrapper);
List<MeetingTopic> meetingTopicList = meetingTopicService.list(wrapper);
insideOutSideMeeting.setMeetingTopicList(meetingTopicList);
}
return insideOutSideMeeting;
@@ -42,12 +44,35 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl<InsideOutsideMe
@Transactional
@Override
public Integer deleteMeetingById(String meetingId) {
int deleteById = this.baseMapper.deleteById(meetingId);
if (deleteById > 0) {
meetingTopicDao.deleteById(meetingId);
public Boolean deleteMeetingById(String meetingId) {
LambdaUpdateWrapper<InsideOutSideMeeting> wrapper = new LambdaUpdateWrapper<>();
wrapper.eq(InsideOutSideMeeting::getId, 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
@@ -59,10 +84,11 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl<InsideOutsideMe
int insert = this.baseMapper.insert(insideOutSideMeeting);
if (!insideOutSideMeeting.getMeetingTopicList().isEmpty()) {
for (MeetingTopic meetingTopic : insideOutSideMeeting.getMeetingTopicList()) {
meetingTopic.setMeetingId(insideOutSideMeeting.getId());
meetingTopic.setCreateTime(new Date());
meetingTopic.setModifyTime(new Date());
meetingTopic.setValidFlag(0);
meetingTopicDao.insert(meetingTopic);
meetingTopicService.save(meetingTopic);
}
}
return insert;
@@ -75,6 +101,7 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl<InsideOutsideMe
}
Integer rowCount = this.baseMapper.queryByPageCount(page);
page.getPager().setRowCount(rowCount);
page.setPage(page.getPage()-1);
return this.baseMapper.queryByPage(page);
}
}
@@ -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 {
}
@@ -104,6 +104,4 @@
order by iom.ID
limit #{page},#{pageSize}
</select>
</mapper>