add: 内外部会议模块增删改查修改
This commit is contained in:
+11
-9
@@ -1,14 +1,16 @@
|
||||
package com.adc.da.slrs.InsideOntSideMeeting.controller;
|
||||
|
||||
import com.adc.da.base.web.BaseController;
|
||||
import com.adc.da.http.PageInfo;
|
||||
import com.adc.da.http.ResponseMessage;
|
||||
import com.adc.da.http.Result;
|
||||
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.service.InsideOutsideMeetingService;
|
||||
import io.swagger.annotations.ApiOperation;
|
||||
import org.apache.commons.lang3.ObjectUtils;
|
||||
import org.apache.commons.lang3.StringUtils;
|
||||
import org.springframework.beans.BeanUtils;
|
||||
import org.springframework.web.bind.annotation.*;
|
||||
|
||||
import javax.annotation.Resource;
|
||||
@@ -21,31 +23,31 @@ import java.util.List;
|
||||
*/
|
||||
@RestController
|
||||
@RequestMapping("/${restPath}/lawss/insideOutsideMeeting")
|
||||
public class InsideOutSideMeetingController extends BaseController<InsideOutSideMeeting> {
|
||||
public class InsideOutSideMeetingController extends BaseController<InsideOutsideMeetingVO> {
|
||||
|
||||
@Resource
|
||||
private InsideOutsideMeetingService meetingService;
|
||||
|
||||
@ApiOperation(value = "根据会议ID查询会议信息")
|
||||
@GetMapping("/getMeetingInfo")
|
||||
public ResponseMessage<InsideOutSideMeeting> getMeetingInfo(String meetingId){
|
||||
public ResponseMessage<InsideOutsideMeeting> getMeetingInfo(String meetingId){
|
||||
if (StringUtils.isBlank(meetingId)) {
|
||||
return Result.error("会议ID为空!");
|
||||
}
|
||||
InsideOutSideMeeting meetingInfo = meetingService.getMeetingInfo(meetingId);
|
||||
InsideOutsideMeeting meetingInfo = meetingService.getMeetingInfo(meetingId);
|
||||
return Result.success(meetingInfo);
|
||||
}
|
||||
|
||||
@ApiOperation(value = "分页查询")
|
||||
@GetMapping("/page")
|
||||
public ResponseMessage<List<InsideOutSideMeeting>> page(InsideOutsideMeetingVO insideOutsideMeetingVO) {
|
||||
List<InsideOutSideMeeting> rows = meetingService.queryByPage(insideOutsideMeetingVO);
|
||||
return Result.success(rows);
|
||||
public ResponseMessage<PageInfo<InsideOutsideMeetingVO>> page(InsideOutsideMeetingVO insideOutsideMeetingVO) {
|
||||
List<InsideOutsideMeetingVO> rows = meetingService.queryByPage(insideOutsideMeetingVO);
|
||||
return Result.success(getPageInfo(insideOutsideMeetingVO.getPager(), rows));
|
||||
}
|
||||
|
||||
@ApiOperation(value = "新增内外部会议")
|
||||
@PostMapping(value = "/addMeetingInfo", consumes = "application/json;charset=UTF-8")
|
||||
public ResponseMessage<?> create(@RequestBody InsideOutSideMeeting insideOutSideMeeting) throws Exception {
|
||||
public ResponseMessage<?> create(@RequestBody InsideOutsideMeeting insideOutSideMeeting) throws Exception {
|
||||
meetingService.addMeetingInfo(insideOutSideMeeting);
|
||||
return Result.success();
|
||||
}
|
||||
@@ -62,7 +64,7 @@ public class InsideOutSideMeetingController extends BaseController<InsideOutSide
|
||||
|
||||
@ApiOperation("根据会议ID修改会议信息")
|
||||
@PutMapping("/updateMeetingInfo")
|
||||
public ResponseMessage<?> updateMeetingInfo(@RequestBody InsideOutSideMeeting insideOutSideMeeting) {
|
||||
public ResponseMessage<?> updateMeetingInfo(@RequestBody InsideOutsideMeeting insideOutSideMeeting) {
|
||||
if (ObjectUtils.isEmpty(insideOutSideMeeting)) {
|
||||
return Result.error("更新失败,会议信息不存在");
|
||||
}
|
||||
|
||||
+3
-5
@@ -1,13 +1,11 @@
|
||||
package com.adc.da.slrs.InsideOntSideMeeting.dao;
|
||||
|
||||
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.baomidou.mybatisplus.core.mapper.BaseMapper;
|
||||
import org.apache.ibatis.annotations.Mapper;
|
||||
import org.apache.ibatis.annotations.Param;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Map;
|
||||
|
||||
/**
|
||||
* @author tjzdw
|
||||
@@ -15,10 +13,10 @@ import java.util.Map;
|
||||
* @date 2023/10/10
|
||||
*/
|
||||
@Mapper
|
||||
public interface InsideOutsideMeetingDao extends BaseMapper<InsideOutSideMeeting> {
|
||||
public interface InsideOutsideMeetingDao extends BaseMapper<InsideOutsideMeeting> {
|
||||
|
||||
Integer queryByPageCount(InsideOutsideMeetingVO page);
|
||||
|
||||
List<InsideOutSideMeeting> queryByPage(InsideOutsideMeetingVO page);
|
||||
List<InsideOutsideMeetingVO> queryByPage(InsideOutsideMeetingVO page);
|
||||
|
||||
}
|
||||
|
||||
+1
-1
@@ -26,7 +26,7 @@ import java.util.Objects;
|
||||
@Accessors(chain = true)
|
||||
@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;
|
||||
|
||||
+2
@@ -4,6 +4,7 @@ import com.adc.da.base.page.BasePage;
|
||||
import com.fasterxml.jackson.annotation.JsonFormat;
|
||||
import lombok.Data;
|
||||
import lombok.EqualsAndHashCode;
|
||||
import lombok.experimental.Accessors;
|
||||
|
||||
import java.util.Date;
|
||||
import java.util.List;
|
||||
@@ -14,6 +15,7 @@ import java.util.List;
|
||||
* @date 2023/10/12
|
||||
*/
|
||||
@EqualsAndHashCode(callSuper = true)
|
||||
@Accessors(chain = true)
|
||||
@Data
|
||||
public class InsideOutsideMeetingVO extends BasePage {
|
||||
|
||||
|
||||
+6
-6
@@ -1,6 +1,6 @@
|
||||
package com.adc.da.slrs.InsideOntSideMeeting.service;
|
||||
|
||||
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.baomidou.mybatisplus.extension.service.IService;
|
||||
|
||||
@@ -11,15 +11,15 @@ import java.util.List;
|
||||
* @description
|
||||
* @date 2023/10/10
|
||||
*/
|
||||
public interface InsideOutsideMeetingService extends IService<InsideOutSideMeeting> {
|
||||
public interface InsideOutsideMeetingService extends IService<InsideOutsideMeeting> {
|
||||
|
||||
Integer addMeetingInfo(InsideOutSideMeeting insideOutSideMeeting);
|
||||
Integer addMeetingInfo(InsideOutsideMeeting insideOutSideMeeting);
|
||||
|
||||
List<InsideOutSideMeeting> queryByPage(InsideOutsideMeetingVO page);
|
||||
List<InsideOutsideMeetingVO> queryByPage(InsideOutsideMeetingVO page);
|
||||
|
||||
InsideOutSideMeeting getMeetingInfo(String meetingId);
|
||||
InsideOutsideMeeting getMeetingInfo(String meetingId);
|
||||
|
||||
Boolean deleteMeetingById(String meetingId);
|
||||
|
||||
Boolean updateMeetingInfo(InsideOutSideMeeting insideOutSideMeeting);
|
||||
Boolean updateMeetingInfo(InsideOutsideMeeting insideOutSideMeeting);
|
||||
}
|
||||
|
||||
+10
-12
@@ -1,8 +1,7 @@
|
||||
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.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.MeetingTopic;
|
||||
import com.adc.da.slrs.InsideOntSideMeeting.service.InsideOutsideMeetingService;
|
||||
@@ -25,14 +24,14 @@ import java.util.List;
|
||||
* @date 2023/10/10
|
||||
*/
|
||||
@Service
|
||||
public class InsideOutsideMeetingServiceImpl extends ServiceImpl<InsideOutsideMeetingDao, InsideOutSideMeeting> implements InsideOutsideMeetingService {
|
||||
public class InsideOutsideMeetingServiceImpl extends ServiceImpl<InsideOutsideMeetingDao, InsideOutsideMeeting> implements InsideOutsideMeetingService {
|
||||
|
||||
@Resource
|
||||
private MeetingTopicService meetingTopicService;
|
||||
|
||||
@Override
|
||||
public InsideOutSideMeeting getMeetingInfo(String meetingId){
|
||||
InsideOutSideMeeting insideOutSideMeeting = this.baseMapper.selectById(meetingId);
|
||||
public InsideOutsideMeeting getMeetingInfo(String meetingId){
|
||||
InsideOutsideMeeting insideOutSideMeeting = this.baseMapper.selectById(meetingId);
|
||||
if (insideOutSideMeeting != null) {
|
||||
LambdaQueryWrapper<MeetingTopic> wrapper = new LambdaQueryWrapper<>();
|
||||
wrapper.eq(MeetingTopic::getMeetingId, meetingId);
|
||||
@@ -45,9 +44,9 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl<InsideOutsideMe
|
||||
@Transactional
|
||||
@Override
|
||||
public Boolean deleteMeetingById(String meetingId) {
|
||||
LambdaUpdateWrapper<InsideOutSideMeeting> wrapper = new LambdaUpdateWrapper<>();
|
||||
wrapper.eq(InsideOutSideMeeting::getId, meetingId);
|
||||
wrapper.set(InsideOutSideMeeting::getValidFlag,1);
|
||||
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<>();
|
||||
@@ -60,7 +59,7 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl<InsideOutsideMe
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public Boolean updateMeetingInfo(InsideOutSideMeeting insideOutSideMeeting) {
|
||||
public Boolean updateMeetingInfo(InsideOutsideMeeting insideOutSideMeeting) {
|
||||
if (StringUtils.isBlank(insideOutSideMeeting.getId())) {
|
||||
return false;
|
||||
}
|
||||
@@ -77,7 +76,7 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl<InsideOutsideMe
|
||||
|
||||
@Transactional
|
||||
@Override
|
||||
public Integer addMeetingInfo(InsideOutSideMeeting insideOutSideMeeting) {
|
||||
public Integer addMeetingInfo(InsideOutsideMeeting insideOutSideMeeting) {
|
||||
insideOutSideMeeting.setCreateTime(new Date());
|
||||
insideOutSideMeeting.setModifyTime(new Date());
|
||||
insideOutSideMeeting.setValidFlag(0);
|
||||
@@ -95,13 +94,12 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl<InsideOutsideMe
|
||||
}
|
||||
|
||||
@Override
|
||||
public List<InsideOutSideMeeting> queryByPage(InsideOutsideMeetingVO page){
|
||||
public List<InsideOutsideMeetingVO> queryByPage(InsideOutsideMeetingVO page){
|
||||
if (StringUtils.isNotBlank(page.getParticipants())) {
|
||||
page.setParticipantsList(Arrays.asList(page.getParticipants().split(",")));
|
||||
}
|
||||
Integer rowCount = this.baseMapper.queryByPageCount(page);
|
||||
page.getPager().setRowCount(rowCount);
|
||||
page.setPage(page.getPage()-1);
|
||||
return this.baseMapper.queryByPage(page);
|
||||
}
|
||||
}
|
||||
|
||||
+6
-5
@@ -3,7 +3,7 @@
|
||||
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
|
||||
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
|
||||
<mapper namespace="com.adc.da.slrs.InsideOntSideMeeting.dao.InsideOutsideMeetingDao">
|
||||
<resultMap id="BaseResultMap" type="com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutSideMeeting" >
|
||||
<resultMap id="BaseResultMap" type="com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutsideMeeting" >
|
||||
<id column="id" property="id" />
|
||||
<result column="MEETING_NAME" property="meetingName" />
|
||||
<result column="TOPIC_NAME" property="topicName" />
|
||||
@@ -91,17 +91,18 @@
|
||||
</if>
|
||||
</sql>
|
||||
<select id="queryByPageCount" resultType="java.lang.Integer">
|
||||
select count(1) from inside_outside_meeting
|
||||
where VALID_FLAG = 0
|
||||
select count(1) from inside_outside_meeting iom join meeting_topic mt on iom.ID = mt.MEETING_ID
|
||||
where iom.VALID_FLAG = 0
|
||||
<include refid="Base_Where_Clause"/>
|
||||
<include refid="MeetingTopic_where" />
|
||||
</select>
|
||||
<select id="queryByPage" resultMap="BaseResultMap">
|
||||
<select id="queryByPage" resultMap="BaseResultMap" parameterType="com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutsideMeetingVO">
|
||||
select <include refid="Base_Column_Join_MeetingTopic_List" />
|
||||
from inside_outside_meeting iom join meeting_topic mt on iom.ID = mt.MEETING_ID
|
||||
where iom.VALID_FLAG = 0
|
||||
<include refid="Base_Where_Clause" />
|
||||
<include refid="MeetingTopic_where" />
|
||||
order by iom.ID
|
||||
limit #{page},#{pageSize}
|
||||
limit ${pager.startIndex-1},${pageSize}
|
||||
</select>
|
||||
</mapper>
|
||||
Reference in New Issue
Block a user