add: 政策课题模块增删改查

This commit is contained in:
wxyclub
2023-10-18 14:23:15 +08:00
parent 5d8bed9af2
commit 4621286ca5
19 changed files with 1258 additions and 0 deletions
@@ -0,0 +1,39 @@
package com.adc.da.workFlow.controller;
import com.adc.da.http.ResponseMessage;
import com.adc.da.http.Result;
import com.adc.da.workFlow.service.ActSarItemMeetingEOService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import javax.annotation.Resource;
/**
* @author tjzdw
* @description
* @date 2023/10/16
*/
@RestController
@RequestMapping("/${restPath}/lawss/meeting")
@Api(description = "|InsideOutsideMeeting|")
public class ActSarItemMeetingEOController {
@Resource
private ActSarItemMeetingEOService meetingEOService;
@ApiOperation(value = "|SarLawsStandInfo|内外部会议入库")
@PostMapping("/processCreateMeeting")
public ResponseMessage<String> processCreateMeeting(String infoJson) throws Exception {
if (StringUtils.isBlank(infoJson)) {
return Result.error("传入数据json不能为空");
}
meetingEOService.processCreateMeeting(infoJson);
return Result.success("入库成功");
}
}
@@ -0,0 +1,42 @@
package com.adc.da.workFlow.service;
import com.adc.da.exception.AdcDaBaseException;
import com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutsideMeeting;
import com.adc.da.slrs.InsideOntSideMeeting.service.InsideOutsideMeetingService;
import com.alibaba.fastjson.JSONObject;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.*;
/**
* @author tjzdw
* @description
* @date 2023/10/16
*/
@Service
@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class)
public class ActSarItemMeetingEOService {
@Resource
private InsideOutsideMeetingService meetingService;
private static final Logger logger = LoggerFactory.getLogger(ActSarItemMeetingEOService.class);
public void processCreateMeeting(String meetingInfo) throws Exception{
Map<String,Object> standMap = new HashMap<>();
standMap = JSONObject.parseObject(meetingInfo);
if (standMap == null || standMap.isEmpty()) {
throw new AdcDaBaseException("入库失败,会议信息出错");
}
String prcNum = String.valueOf(standMap.get("prcNum"));
String meetingName = String.valueOf(standMap.get("meetingName"));
InsideOutsideMeeting insideOutsideMeeting = JSONObject.parseObject(meetingInfo, InsideOutsideMeeting.class);
System.out.println(insideOutsideMeeting);
meetingService.addMeetingInfo(insideOutsideMeeting);
}
}
@@ -0,0 +1,75 @@
package com.adc.da.slrs.sarLawsTopic.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.sarLawsTopic.entity.SarLawsTopic;
import com.adc.da.slrs.sarLawsTopic.entity.SarLawsTopicVO;
import com.adc.da.slrs.sarLawsTopic.service.SarLawsTopicService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
import org.springframework.web.bind.annotation.*;
import javax.annotation.Resource;
import java.util.List;
/**
* @author tjzdw
* @description
* @date 2023/10/17
*/
@Api("政策课题模块")
@RestController
@RequestMapping("/${restPath}/lawss/sarLawsTopic")
public class SarLawsTopicController extends BaseController<SarLawsTopicVO> {
@Resource
private SarLawsTopicService lawsTopicService;
@ApiOperation(value = "根据政策课题ID查询会议信息")
@GetMapping("/getLawsTopicInfo")
public ResponseMessage<SarLawsTopic> getLawsTopicInfo(String lawsTopicId){
if (StringUtils.isBlank(lawsTopicId)) {
return Result.error("会议ID为空!");
}
SarLawsTopic sarLawsTopic = lawsTopicService.getLawsTopicInfo(lawsTopicId);
return Result.success(sarLawsTopic);
}
@ApiOperation(value = "分页查询")
@GetMapping("/page")
public ResponseMessage<PageInfo<SarLawsTopicVO>> page(SarLawsTopicVO sarLawsTopicVO) {
List<SarLawsTopicVO> rows = lawsTopicService.queryByPage(sarLawsTopicVO);
return Result.success(getPageInfo(sarLawsTopicVO.getPager(), rows));
}
@ApiOperation(value = "新增政策课题")
@PostMapping(value = "/addLawsTopic", consumes = "application/json;charset=UTF-8")
public ResponseMessage<?> create(@RequestBody SarLawsTopic lawsTopic) throws Exception {
lawsTopicService.addLawsTopicInfo(lawsTopic);
return Result.success();
}
@ApiOperation("根据会议ID删除会议")
@DeleteMapping("/deleteLawsTopicById")
public ResponseMessage<?> deleteMeeting(String lawsTopicId) {
if (StringUtils.isBlank(lawsTopicId)) {
return Result.error("删除失败,政策课题ID为空");
}
lawsTopicService.deleteLawsTopicInfo(lawsTopicId);
return Result.success();
}
@ApiOperation("根据会议ID修改会议信息")
@PutMapping("/updateLawsTopicInfo")
public ResponseMessage<?> updateMeetingInfo(@RequestBody SarLawsTopic lawsTopic) {
if (ObjectUtils.isEmpty(lawsTopic)) {
return Result.error("更新失败,政策课题信息不存在");
}
Boolean updateResult = lawsTopicService.updateLawsTopicInfo(lawsTopic);
return updateResult ? Result.success() : Result.error("更新失败");
}
}
@@ -0,0 +1,20 @@
package com.adc.da.slrs.sarLawsTopic.dao;
import com.adc.da.slrs.sarLawsTopic.entity.SarLawsContactInformation;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* @author tjzdw
* @description 针对表【sar_laws_contact_information(政策课题组联系方式)】的数据库操作Mapper
* @createDate 2023-10-17 15:41:32
* @Entity com.adc.da.slrs.sarLawsTopic.entity.SarLawsContactInformation
*/
@Mapper
public interface SarLawsContactInformationMapper extends BaseMapper<SarLawsContactInformation> {
}
@@ -0,0 +1,26 @@
package com.adc.da.slrs.sarLawsTopic.dao;
import com.adc.da.slrs.sarLawsTopic.entity.SarLawsTopic;
import com.adc.da.slrs.sarLawsTopic.entity.SarLawsTopicVO;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
import java.util.List;
/**
* @author tjzdw
* @description 针对表【sar_laws_topic(政策课题)】的数据库操作Mapper
* @createDate 2023-10-17 15:17:33
* @Entity com.adc.da.slrs.sarLawsTopic.entity.SarLawsTopic
*/
@Mapper
public interface SarLawsTopicMapper extends BaseMapper<SarLawsTopic> {
Integer queryByPageCount(SarLawsTopicVO page);
List<SarLawsTopicVO> queryByPage(SarLawsTopicVO page);
}
@@ -0,0 +1,20 @@
package com.adc.da.slrs.sarLawsTopic.dao;
import com.adc.da.slrs.sarLawsTopic.entity.SarLawsTopicMeeting;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Mapper;
/**
* @author tjzdw
* @description 针对表【sar_laws_topic_meeting(政策课题组会议)】的数据库操作Mapper
* @createDate 2023-10-17 15:20:27
* @Entity com.adc.da.slrs.sarLawsTopic.entity.SarLawsTopicMeeting
*/
@Mapper
public interface SarLawsTopicMeetingMapper extends BaseMapper<SarLawsTopicMeeting> {
}
@@ -0,0 +1,67 @@
package com.adc.da.slrs.sarLawsTopic.entity;
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 java.io.Serializable;
import lombok.Data;
/**
* 政策课题组联系方式
* @TableName sar_laws_contact_information
*/
@TableName(value ="sar_laws_contact_information")
@Data
public class SarLawsContactInformation implements Serializable {
/**
* 主键
*/
@TableId(value = "ID", type = IdType.ID_WORKER_STR)
private String id;
/**
* 政策课题ID
*/
@TableField(value = "LAWS_TOPIC_ID")
private String lawsTopicId;
/**
* 所属组别
*/
@TableField(value = "GROUP_TYPE")
private String groupType;
/**
* 姓名
*/
@TableField(value = "NAME")
private String name;
/**
* 单位
*/
@TableField(value = "DEPARTMENT")
private String department;
/**
* 电话
*/
@TableField(value = "PHONE")
private String phone;
/**
* 邮箱
*/
@TableField(value = "EMAIL")
private String email;
/**
* 身份
*/
@TableField(value = "IDENTITY")
private String identity;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
}
@@ -0,0 +1,177 @@
package com.adc.da.slrs.sarLawsTopic.entity;
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 java.io.Serializable;
import java.util.Date;
import java.util.List;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
/**
* 政策课题
* @TableName sar_laws_topic
*/
@TableName(value ="sar_laws_topic")
@Data
public class SarLawsTopic implements Serializable {
/**
* 主键
*/
@TableId(value = "ID", type = IdType.ID_WORKER_STR)
private String id;
/**
* 课题名称
*/
@TableField(value = "TOPIC_NAME")
private String topicName;
/**
* 课题承办单位
*/
@TableField(value = "ORGANIZER")
private String organizer;
/**
* 课题指导单位
*/
@TableField(value = "GUIDANCE_UNIT")
private String guidanceUnit;
/**
* 课题参与单位
*/
@TableField(value = "PARTICIPATING_UNIT")
private String participatingUnit;
/**
* 开始时间
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@TableField(value = "START_TIME")
private Date startTime;
/**
* 结题时间
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@TableField(value = "CLOSE_TIME")
private Date closeTime;
/**
* 课题状态
*/
@TableField(value = "TOPIC_STATUS")
private String topicStatus;
/**
* 课题费用(万元)
*/
@TableField(value = "TOPIC_COST")
private String topicCost;
/**
* 协议
*/
@TableField(value = "AGREEMENT")
private String agreement;
/**
* 课题组会议列表
*/
@TableField(exist = false)
private List<SarLawsTopicMeeting> meetingList;
/**
* 课题组研究方案
*/
@TableField(value = "RESEARCH_PLAN")
private String researchPlan;
/**
* 课题组研究成果
*/
@TableField(value = "RESEARCH_FINDINGS")
private String researchFindings;
/**
* 课题组其他
*/
@TableField(value = "RESEARCH_GROUP_OTHER")
private String researchGroupOther;
/**
* 课题组会议资料
*/
@TableField(value = "CONFERENCE_MATERIALS")
private String conferenceMaterials;
/**
* 课题组联系方式
*/
@TableField(exist = false)
private List<SarLawsContactInformation> topicContactInformationList;
/**
* 内部资料立项报告
*/
@TableField(value = "INSIDE_PROJECT_PROPOSAL_REPORT")
private String insideProjectProposalRepost;
/**
* 内部资料研究方案
*/
@TableField(value = "INSIDE_RESEARCH_PLAN")
private String insideResearchPlan;
/**
* 内部资料会议资料
*/
@TableField(value = "INSIDE_CONFERENCE_MATERIALS")
private String insideConferenceMaterials;
/**
* 内部会议研究成果
*/
@TableField(value = "INSIDE_RESEARCH_FINDINGS")
private String insideResearchFindings;
/**
* 内部会议其他
*/
@TableField(value = "INSIDE_OTHER")
private String insideOther;
/**
* 内部联系方式
*/
@TableField(exist = false)
private List<SarLawsContactInformation> insideContactInformationList;
/**
* 逻辑删除,0可用,1不可用
*/
@TableField(value = "VALID_FLAG")
private Integer validFlag;
/**
* 创建时间
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@TableField(value = "CREATE_TIME")
private Date createTime;
/**
* 修改时间
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@TableField(value = "MODIFY_TIME")
private Date modifyTime;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
}
@@ -0,0 +1,65 @@
package com.adc.da.slrs.sarLawsTopic.entity;
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 java.io.Serializable;
import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import lombok.Data;
/**
* 政策课题组会议
* @TableName sar_laws_topic_meeting
*/
@TableName(value ="sar_laws_topic_meeting")
@Data
public class SarLawsTopicMeeting implements Serializable {
/**
* 主键
*/
@TableId(value = "ID", type = IdType.ID_WORKER_STR)
private String id;
/**
* 政策课题ID
*/
@TableField(value = "LAWS_TOPIC_ID")
private String lawsTopicId;
/**
* 会议名称
*/
@TableField(value = "MEETING_NAME")
private String meetingName;
/**
* 会议时间
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
@TableField(value = "MEETING_TIME")
private Date meetingTime;
/**
* 会议地点
*/
@TableField(value = "MEETING_ADDRESS")
private String meetingAddress;
/**
* 参会人员(内部)
*/
@TableField(value = "PARTICIPANTS")
private String participants;
/**
* 会议主要内容
*/
@TableField(value = "MEETING_CONTENT")
private String meetingContent;
@TableField(exist = false)
private static final long serialVersionUID = 1L;
}
@@ -0,0 +1,207 @@
package com.adc.da.slrs.sarLawsTopic.entity;
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;
/**
* @author tjzdw
* @description
* @date 2023/10/17
*/
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@Data
public class SarLawsTopicVO extends BasePage {
/**
* 主键
*/
private String id;
/**
* 课题名称
*/
private String topicName;
/**
* 课题承办单位
*/
private String organizer;
/**
* 课题指导单位
*/
private String guidanceUnit;
/**
* 课题参与单位
*/
private String participatingUnit;
/**
* 开始时间
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date startTime;
/**
* 结题时间
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date closeTime;
/**
* 课题状态
*/
private String topicStatus;
/**
* 课题费用(万元)
*/
private String topicCost;
/**
* 协议
*/
private String agreement;
/**
* 课题组会议列表
*/
private List<SarLawsTopicMeeting> meetingList;
/**
* 会议名称
*/
private String meetingName;
/**
* 会议时间
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date meetingTime;
/**
* 会议地点
*/
private String meetingAddress;
/**
* 参会人员(内部)
*/
private String participants;
// 参会人员列表
private List<String> participantsList;
/**
* 会议主要内容
*/
private String meetingContent;
/**
* 课题组研究方案
*/
private String researchPlan;
/**
* 课题组研究成果
*/
private String researchFindings;
/**
* 课题组其他
*/
private String researchGroupOther;
/**
* 课题组会议资料
*/
private String conferenceMaterials;
/**
* 课题组联系方式
*/
private List<SarLawsContactInformation> topicContactInformationList;
// 课题组用户名称
private String topicGroupName;
// 课题组部门
private String topicGroupDepartment;
// 课题组电话
private String topicGroupPhone;
// 课题组用户邮箱
private String topicGroupEmail;
// 课题组用户身份
private String topicGroupIdentity;
/**
* 内部资料立项报告
*/
private String insideProjectProposalRepost;
/**
* 内部资料研究方案
*/
private String insideResearchPlan;
/**
* 内部资料会议资料
*/
private String insideConferenceMaterials;
/**
* 内部会议研究成果
*/
private String insideResearchFindings;
/**
* 内部会议其他
*/
private String insideOther;
/**
* 内部联系方式
*/
private List<SarLawsContactInformation> insideContactInformationList;
// 内部人员名称
private String insideName;
// 内部人员部门
private String insideDepartment;
// 内部人员电话
private String insidePhone;
// 内部人员邮箱
private String insideEmail;
// 内部人员身份
private String insideIdentity;
/**
* 逻辑删除,0可用,1不可用
*/
private Integer validFlag;
/**
* 创建时间
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date createTime;
/**
* 修改时间
*/
@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
private Date modifyTime;
private String sortField = "ID";
private String sortMode = "asc";
private String startTimeOperator = "=";
private String closeTimeOperator = "=";
}
@@ -0,0 +1,13 @@
package com.adc.da.slrs.sarLawsTopic.service;
import com.adc.da.slrs.sarLawsTopic.entity.SarLawsContactInformation;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @author tjzdw
* @description 针对表【sar_laws_contact_information(政策课题组联系方式)】的数据库操作Service
* @createDate 2023-10-17 15:41:32
*/
public interface SarLawsContactInformationService extends IService<SarLawsContactInformation> {
}
@@ -0,0 +1,13 @@
package com.adc.da.slrs.sarLawsTopic.service;
import com.adc.da.slrs.sarLawsTopic.entity.SarLawsTopicMeeting;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* @author tjzdw
* @description 针对表【sar_laws_topic_meeting(政策课题组会议)】的数据库操作Service
* @createDate 2023-10-17 15:20:27
*/
public interface SarLawsTopicMeetingService extends IService<SarLawsTopicMeeting> {
}
@@ -0,0 +1,25 @@
package com.adc.da.slrs.sarLawsTopic.service;
import com.adc.da.slrs.sarLawsTopic.entity.SarLawsTopic;
import com.adc.da.slrs.sarLawsTopic.entity.SarLawsTopicVO;
import com.baomidou.mybatisplus.extension.service.IService;
import java.util.List;
/**
* @author tjzdw
* @description 针对表【sar_laws_topic(政策课题)】的数据库操作Service
* @createDate 2023-10-17 15:17:33
*/
public interface SarLawsTopicService extends IService<SarLawsTopic> {
SarLawsTopic getLawsTopicInfo(String lawsTopicId);
Integer addLawsTopicInfo(SarLawsTopic lawsTopic);
Boolean deleteLawsTopicInfo(String lawsTopicId);
Boolean updateLawsTopicInfo(SarLawsTopic lawsTopic);
List<SarLawsTopicVO> queryByPage(SarLawsTopicVO sarLawsTopicVO);
}
@@ -0,0 +1,22 @@
package com.adc.da.slrs.sarLawsTopic.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.adc.da.slrs.sarLawsTopic.entity.SarLawsContactInformation;
import com.adc.da.slrs.sarLawsTopic.service.SarLawsContactInformationService;
import com.adc.da.slrs.sarLawsTopic.dao.SarLawsContactInformationMapper;
import org.springframework.stereotype.Service;
/**
* @author tjzdw
* @description 针对表【sar_laws_contact_information(政策课题组联系方式)】的数据库操作Service实现
* @createDate 2023-10-17 15:41:32
*/
@Service
public class SarLawsContactInformationServiceImpl extends ServiceImpl<SarLawsContactInformationMapper, SarLawsContactInformation>
implements SarLawsContactInformationService{
}
@@ -0,0 +1,22 @@
package com.adc.da.slrs.sarLawsTopic.service.impl;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.adc.da.slrs.sarLawsTopic.entity.SarLawsTopicMeeting;
import com.adc.da.slrs.sarLawsTopic.service.SarLawsTopicMeetingService;
import com.adc.da.slrs.sarLawsTopic.dao.SarLawsTopicMeetingMapper;
import org.springframework.stereotype.Service;
/**
* @author tjzdw
* @description 针对表【sar_laws_topic_meeting(政策课题组会议)】的数据库操作Service实现
* @createDate 2023-10-17 15:20:27
*/
@Service
public class SarLawsTopicMeetingServiceImpl extends ServiceImpl<SarLawsTopicMeetingMapper, SarLawsTopicMeeting>
implements SarLawsTopicMeetingService{
}
@@ -0,0 +1,172 @@
package com.adc.da.slrs.sarLawsTopic.service.impl;
import com.adc.da.slrs.sarLawsTopic.entity.SarLawsContactInformation;
import com.adc.da.slrs.sarLawsTopic.entity.SarLawsTopicMeeting;
import com.adc.da.slrs.sarLawsTopic.entity.SarLawsTopicVO;
import com.adc.da.slrs.sarLawsTopic.service.SarLawsContactInformationService;
import com.adc.da.slrs.sarLawsTopic.service.SarLawsTopicMeetingService;
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.adc.da.slrs.sarLawsTopic.entity.SarLawsTopic;
import com.adc.da.slrs.sarLawsTopic.service.SarLawsTopicService;
import com.adc.da.slrs.sarLawsTopic.dao.SarLawsTopicMapper;
import org.apache.commons.lang3.StringUtils;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
import javax.annotation.Resource;
import java.util.Arrays;
import java.util.Date;
import java.util.List;
/**
* @author tjzdw
* @description 针对表【sar_laws_topic(政策课题)】的数据库操作Service实现
* @createDate 2023-10-17 15:17:33
*/
@Service
public class SarLawsTopicServiceImpl extends ServiceImpl<SarLawsTopicMapper, SarLawsTopic>
implements SarLawsTopicService{
@Resource
private SarLawsTopicMeetingService meetingService;
@Resource
private SarLawsContactInformationService contactInformationService;
@Override
public SarLawsTopic getLawsTopicInfo(String lawsTopicId) {
SarLawsTopic sarLawsTopic = this.baseMapper.selectById(lawsTopicId);
if (sarLawsTopic != null) {
// 查询课题组会议
LambdaQueryWrapper<SarLawsTopicMeeting> meetingWrapper = new LambdaQueryWrapper<>();
meetingWrapper.eq(SarLawsTopicMeeting::getLawsTopicId, lawsTopicId);
List<SarLawsTopicMeeting> topicMeetingList = meetingService.list(meetingWrapper);
sarLawsTopic.setMeetingList(topicMeetingList);
// 查询课题组联系方式
LambdaQueryWrapper<SarLawsContactInformation> topicGroupWrapper = new LambdaQueryWrapper<>();
topicGroupWrapper.eq(SarLawsContactInformation::getLawsTopicId, lawsTopicId);
topicGroupWrapper.eq(SarLawsContactInformation::getGroupType,"lawsTopic");
List<SarLawsContactInformation> lawsTopicContactInformation = contactInformationService.list(topicGroupWrapper);
sarLawsTopic.setTopicContactInformationList(lawsTopicContactInformation);
// 查询内部联系房方式
LambdaQueryWrapper<SarLawsContactInformation> insideWrapper = new LambdaQueryWrapper<>();
topicGroupWrapper.eq(SarLawsContactInformation::getLawsTopicId, lawsTopicId);
topicGroupWrapper.eq(SarLawsContactInformation::getGroupType,"lawsTopic");
List<SarLawsContactInformation> insideContactInformation = contactInformationService.list(topicGroupWrapper);
sarLawsTopic.setInsideContactInformationList(insideContactInformation);
}
return sarLawsTopic;
}
@Transactional
@Override
public Integer addLawsTopicInfo(SarLawsTopic lawsTopic) {
lawsTopic.setCreateTime(new Date());
lawsTopic.setModifyTime(new Date());
lawsTopic.setValidFlag(0);
int insert = this.baseMapper.insert(lawsTopic);
if (lawsTopic.getMeetingList() != null && !lawsTopic.getMeetingList().isEmpty()) {
for (SarLawsTopicMeeting meeting : lawsTopic.getMeetingList()) {
meeting.setLawsTopicId(lawsTopic.getId());
meetingService.save(meeting);
}
}
if (lawsTopic.getTopicContactInformationList() != null && !lawsTopic.getTopicContactInformationList().isEmpty()) {
for (SarLawsContactInformation information : lawsTopic.getTopicContactInformationList()) {
information.setLawsTopicId(lawsTopic.getId());
information.setGroupType("topicGroup");
contactInformationService.save(information);
}
}
if (lawsTopic.getInsideContactInformationList() != null && !lawsTopic.getInsideContactInformationList().isEmpty()) {
for (SarLawsContactInformation information : lawsTopic.getInsideContactInformationList()) {
information.setLawsTopicId(lawsTopic.getId());
information.setGroupType("inside");
contactInformationService.save(information);
}
}
return insert;
}
@Transactional
@Override
public Boolean deleteLawsTopicInfo(String lawsTopicId) {
LambdaUpdateWrapper<SarLawsTopic> wrapper = new LambdaUpdateWrapper<>();
wrapper.eq(SarLawsTopic::getId, lawsTopicId);
wrapper.set(SarLawsTopic::getValidFlag,1);
wrapper.set(SarLawsTopic::getModifyTime,new Date());
boolean update = update(wrapper);
if (update) {
LambdaQueryWrapper<SarLawsTopicMeeting> lawsTopicWrapper = new LambdaQueryWrapper<>();
lawsTopicWrapper.eq(SarLawsTopicMeeting::getLawsTopicId, lawsTopicId);
meetingService.remove(lawsTopicWrapper);
LambdaQueryWrapper<SarLawsContactInformation> informationWrapper = new LambdaQueryWrapper<>();
informationWrapper.eq(SarLawsContactInformation::getLawsTopicId, lawsTopicId);
contactInformationService.remove(informationWrapper);
}
return update;
}
@Transactional
@Override
public Boolean updateLawsTopicInfo(SarLawsTopic lawsTopic) {
if (StringUtils.isBlank(lawsTopic.getId())) {
return false;
}
lawsTopic.setModifyTime(new Date());
int update = this.baseMapper.updateById(lawsTopic);
if (update <= 0) {
return true;
}
System.out.println(lawsTopic.getTopicContactInformationList());
System.out.println(lawsTopic.getInsideContactInformationList());
// 先删除关联信息
LambdaQueryWrapper<SarLawsTopicMeeting> topicWrapper = new LambdaQueryWrapper<>();
topicWrapper.eq(SarLawsTopicMeeting::getLawsTopicId,lawsTopic.getId());
meetingService.remove(topicWrapper);
LambdaQueryWrapper<SarLawsContactInformation> informationWrapper = new LambdaQueryWrapper<>();
informationWrapper.eq(SarLawsContactInformation::getLawsTopicId,lawsTopic.getId());
contactInformationService.remove(informationWrapper);
// 再添加关联信息
for (SarLawsTopicMeeting meeting : lawsTopic.getMeetingList()) {
meeting.setLawsTopicId(lawsTopic.getId());
meetingService.save(meeting);
}
for (SarLawsContactInformation information : lawsTopic.getTopicContactInformationList()) {
information.setGroupType("topicGroup");
information.setLawsTopicId(lawsTopic.getId());
contactInformationService.save(information);
}
for (SarLawsContactInformation information : lawsTopic.getInsideContactInformationList()) {
information.setGroupType("inside");
information.setLawsTopicId(lawsTopic.getId());
contactInformationService.save(information);
}
return true;
}
@Override
public List<SarLawsTopicVO> queryByPage(SarLawsTopicVO page){
if (StringUtils.isNotBlank(page.getParticipants())) {
page.setParticipantsList(Arrays.asList(page.getParticipants().split(",")));
}
// 设置排序字段
if (StringUtils.isNotBlank(page.getSortField())) {
String sortField = StringUtils.join(StringUtils.splitByCharacterTypeCamelCase(page.getSortField()),"_").toUpperCase();
page.setSortField(sortField);
} else {
page.setSortField("ID");
page.setSortMode("asc");
}
Integer rowCount = this.baseMapper.queryByPageCount(page);
page.getPager().setRowCount(rowCount);
return this.baseMapper.queryByPage(page);
}
}
@@ -0,0 +1,23 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.adc.da.slrs.sarLawsTopic.dao.SarLawsContactInformationMapper">
<resultMap id="BaseResultMap" type="com.adc.da.slrs.sarLawsTopic.entity.SarLawsContactInformation">
<result property="id" column="ID" jdbcType="VARCHAR"/>
<result property="lawsTopicId" column="LAWS_TOPIC_ID" jdbcType="VARCHAR"/>
<result property="groupType" column="GROUP_TYPE" jdbcType="VARCHAR"/>
<result property="name" column="NAME" jdbcType="VARCHAR"/>
<result property="department" column="DEPARTMENT" jdbcType="VARCHAR"/>
<result property="phone" column="PHONE" jdbcType="VARCHAR"/>
<result property="email" column="EMAIL" jdbcType="VARCHAR"/>
<result property="identity" column="IDENTITY" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
ID,LAWS_TOPIC_ID,GROUP_TYPE,
`NAME`,DEPARTMENT,PHONE,
EMAIL,IDENTITY
</sql>
</mapper>
@@ -0,0 +1,208 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.adc.da.slrs.sarLawsTopic.dao.SarLawsTopicMapper">
<resultMap id="BaseResultMap" type="com.adc.da.slrs.sarLawsTopic.entity.SarLawsTopic">
<id property="id" column="ID" jdbcType="VARCHAR"/>
<result property="topicName" column="TOPIC_NAME" jdbcType="VARCHAR"/>
<result property="organizer" column="ORGANIZER" jdbcType="VARCHAR"/>
<result property="guidanceUnit" column="GUIDANCE_UNIT" jdbcType="VARCHAR"/>
<result property="participatingUnit" column="PARTICIPATING_UNIT" jdbcType="VARCHAR"/>
<result property="startTime" column="START_TIME" jdbcType="TIMESTAMP"/>
<result property="closeTime" column="CLOSE_TIME" jdbcType="TIMESTAMP"/>
<result property="topicStatus" column="TOPIC_STATUS" jdbcType="VARCHAR"/>
<result property="topicCost" column="TOPIC_COST" jdbcType="VARCHAR"/>
<result property="agreement" column="AGREEMENT" jdbcType="VARCHAR"/>
<result property="researchPlan" column="RESEARCH_PLAN" jdbcType="VARCHAR"/>
<result property="researchFindings" column="RESEARCH_FINDINGS" jdbcType="VARCHAR"/>
<result property="researchGroupOther" column="RESEARCH_GROUP_OTHER" jdbcType="VARCHAR"/>
<result property="conferenceMaterials" column="CONFERENCE_MATERIALS" jdbcType="VARCHAR"/>
<result property="insideProjectProposalRepost" column="INSIDE_PROJECT_PROPOSAL_REPORT" jdbcType="VARCHAR"/>
<result property="insideResearchPlan" column="INSIDE_RESEARCH_PLAN" jdbcType="VARCHAR"/>
<result property="insideConferenceMaterials" column="INSIDE_CONFERENCE_MATERIALS" jdbcType="VARCHAR"/>
<result property="insideResearchFindings" column="INSIDE_RESEARCH_FINDINGS" jdbcType="VARCHAR"/>
<result property="insideOther" column="INSIDE_OTHER" jdbcType="VARCHAR"/>
<result property="validFlag" column="VALID_FLAG" jdbcType="TINYINT"/>
<result property="createTime" column="CREATE_TIME" jdbcType="TIMESTAMP"/>
<result property="modifyTime" column="MODIFY_TIME" jdbcType="TIMESTAMP"/>
<collection property="meetingList" ofType="com.adc.da.slrs.sarLawsTopic.entity.SarLawsTopicMeeting">
<id property="id" column="ID" jdbcType="VARCHAR"/>
<result property="lawsTopicId" column="LAWS_TOPIC_ID"/>
<result property="meetingName" column="MEETING_NAME"/>
<result property="meetingTime" column="MEETING_TIME"/>
<result property="meetingAddress" column="MEETING_ADDRESS"/>
<result property="participants" column="PARTICIPANTS"/>
<result property="meetingContent" column="MEETING_CONTENT"/>
</collection>
<collection property="topicContactInformationList" ofType="com.adc.da.slrs.sarLawsTopic.entity.SarLawsContactInformation">
<id property="id" column="slci1Id" jdbcType="VARCHAR"/>
<result property="lawsTopicId" column="slci1LawsTopicId"/>
<result property="groupType" column="slci1GroupType"/>
<result property="name" column="slci1Name"/>
<result property="department" column="slci1Department"/>
<result property="phone" column="slci1Phone"/>
<result property="email" column="slci1Email"/>
<result property="identity" column="slci1Identity" />
</collection>
<collection property="insideContactInformationList" ofType="com.adc.da.slrs.sarLawsTopic.entity.SarLawsContactInformation">
<id property="id" column="slci2Id" jdbcType="VARCHAR"/>
<result property="lawsTopicId" column="slci2LawsTopicId"/>
<result property="groupType" column="slci2GroupType"/>
<result property="name" column="slci2Name"/>
<result property="department" column="slci2Department"/>
<result property="phone" column="slci2Phone"/>
<result property="email" column="slci2Email"/>
<result property="identity" column="slci2Identity" />
</collection>
</resultMap>
<sql id="Base_Column_List">
ID,TOPIC_NAME,ORGANIZER,
GUIDANCE_UNIT,PARTICIPATING_UNIT,START_TIME,
CLOSE_TIME,TOPIC_STATUS,TOPIC_COST,AGREEMENT,
RESEARCH_PLAN,RESEARCH_FINDINGS,RESEARCH_GROUP_OTHER,
CONFERENCE_MATERIALS,INSIDE_PROJECT_PROPOSAL_REPORT,INSIDE_RESEARCH_PLAN,
INSIDE_CONFERENCE_MATERIALS,INSIDE_RESEARCH_FINDINGS,INSIDE_OTHER,
VALID_FLAG,CREATE_TIME,MODIFY_TIME
</sql>
<sql id="Base_Join_Column_List">
slt.ID,slt.TOPIC_NAME,slt.ORGANIZER,
slt.GUIDANCE_UNIT,slt.PARTICIPATING_UNIT,slt.START_TIME,
slt.CLOSE_TIME,slt.TOPIC_STATUS,slt.TOPIC_COST,slt.AGREEMENT,
sltm.ID,
sltm.LAWS_TOPIC_ID,
sltm.MEETING_NAME,
sltm.MEETING_TIME,
sltm.MEETING_ADDRESS,
sltm.PARTICIPANTS,
sltm.MEETING_CONTENT,
slt.RESEARCH_PLAN,slt.RESEARCH_FINDINGS,slt.RESEARCH_GROUP_OTHER,
slt.CONFERENCE_MATERIALS,
slci1.ID as slci1Id,
slci1.LAWS_TOPIC_ID as slci1LawsTopicId,
slci1.GROUP_TYPE slci1GroupType,
slci1.`NAME` as slci1Name,
slci1.DEPARTMENT as slci1Department,
slci1.PHONE as slci1Phone,
slci1.EMAIL as slci1Email,
slci1.IDENTITY as slci1Identity,
slci2.ID as slci2Id,
slci2.LAWS_TOPIC_ID as slci2LawsTopicId,
slci2.GROUP_TYPE as slci2GroupType,
slci2.`NAME` as slci2Name,
slci2.DEPARTMENT as slci2Department,
slci2.PHONE as slci2Phone,
slci2.EMAIL as slci2Email,
slci2.IDENTITY as slci2Identity,
slt.INSIDE_PROJECT_PROPOSAL_REPORT,slt.INSIDE_RESEARCH_PLAN,
slt.INSIDE_CONFERENCE_MATERIALS,slt.INSIDE_RESEARCH_FINDINGS,slt.INSIDE_OTHER,
slt.VALID_FLAG,slt.CREATE_TIME,slt.MODIFY_TIME
</sql>
<sql id="Base_Where_Clause">
<trim suffixOverrides="," >
<if test="topicName != null and topicName !=''">
and TOPIC_NAME like concat('%',#{topicName},'%')
</if>
<if test="organizer != null and organizer !=''">
and ORGANIZER like concat('%',#{organizer},'%')
</if>
<if test="guidanceUnit != null and guidanceUnit != ''" >
and GUIDANCE_UNIT like concat('%',#{guidanceUnit},'%')
</if>
<if test="participatingUnit != null and participatingUnit != ''" >
and PARTICIPATING_UNIT like concat('%',#{participatingUnit},'%')
</if>
<if test="startTime != null and startTime !=''">
and START_TIME ${startTimeOperator} #{startTime}
</if>
<if test="closeTime != null and closeTime !=''">
and CLOSE_TIME ${startTimeOperator} #{closeTime}
</if>
<if test="topicStatus != null and topicStatus != ''" >
and TOPIC_STATUS = #{topicStatus}
</if>
<if test="topicCost != null and topicCost != ''" >
and TOPIC_COST like concat('%',#{topicCost},'%')
</if>
</trim>
</sql>
<sql id="TopicMeeting_where">
<if test="meetingName != null and meetingName != ''">
and sltm.MEETING_NAME like concat('%',#{meetingName},'%')
</if>
<if test="meetingTime != null and meetingTime != ''">
and sltm.MEETING_TIME like concat('%',#{meetingTime},'%')
</if>
<if test="meetingAddress != null and meetingAddress != ''">
and sltm.MEETING_ADDRESS like concat('%',#{meetingAddress},'%')
</if>
<!-- <if test="participantsList != null and participantsList.size() > 0" >-->
<!-- and PARTICIPANTS in-->
<!-- <foreach collection="participantsList" separator="," open="(" close=")" item="participant">-->
<!-- #{participant}-->
<!-- </foreach>-->
<!-- </if>-->
<if test="participants != null and participants != ''">
and sltm.PARTICIPANTS like concat('%',#{participants},'%')
</if>
<if test="meetingContent != null and meetingContent != ''">
and sltm.MEETING_CONTENT like concat('%',#{meetingContent},'%')
</if>
</sql>
<sql id="ContactInformation_where">
<if test="topicGroupName != null and topicGroupName !=''">
and slci1.NAME like concat('%',#{topicGroupName},'%')
</if>
<if test="topicGroupDepartment != null and topicGroupDepartment != ''">
and slci1.DEPARTMENT like concat('%',#{topicGroupDepartment},'%')
</if>
<if test="topicGroupPhone != null and topicGroupPhone != ''">
and slci1.PHONE like concat('%',#{topicGroupPhone},'%')
</if>
<if test="topicGroupEmail != null and topicGroupEmail != ''">
and slci1.EMAIL like concat('%',#{topicGroupEmail},'%')
</if>
<if test="topicGroupIdentity != null and topicGroupIdentity != ''">
and slci1.IDENTITY like concat('%',#{topicGroupIdentity},'%')
</if>
<if test="insideName != null and insideName !=''">
and slci2.NAME like concat('%',#{insideName},'%')
</if>
<if test="insideDepartment != null and insideDepartment != ''">
and slci2.DEPARTMENT like concat('%',#{insideDepartment},'%')
</if>
<if test="insidePhone != null and insidePhone != ''">
and slci2.PHONE like concat('%',#{insidePhone},'%')
</if>
<if test="insideEmail != null and insideEmail != ''">
and slci2.EMAIL like concat('%',#{insideEmail},'%')
</if>
<if test="insideIdentity != null and insideIdentity != ''">
and slci2.IDENTITY like concat('%',#{insideIdentity},'%')
</if>
</sql>
<select id="queryByPageCount" resultType="java.lang.Integer">
select count(1) from sar_laws_topic slt left join sar_laws_topic_meeting sltm on slt.ID = sltm.LAWS_TOPIC_ID
left join sar_laws_contact_information slci1 on slt.ID = slci1.LAWS_TOPIC_ID and slci1.GROUP_TYPE = 'topicGroup'
left join sar_laws_contact_information slci2 on slt.ID = slci2.LAWS_TOPIC_ID and slci2.GROUP_TYPE = 'inside'
where slt.VALID_FLAG = 0
<include refid="Base_Where_Clause"/>
<include refid="TopicMeeting_where" />
<include refid="ContactInformation_where" />
</select>
<select id="queryByPage" resultMap="BaseResultMap">
select <include refid="Base_Join_Column_List" />
from sar_laws_topic slt left join sar_laws_topic_meeting sltm on slt.ID = sltm.LAWS_TOPIC_ID
left join sar_laws_contact_information slci1 on slt.ID = slci1.LAWS_TOPIC_ID and slci1.GROUP_TYPE = 'topicGroup'
left join sar_laws_contact_information slci2 on slt.ID = slci2.LAWS_TOPIC_ID and slci2.GROUP_TYPE = 'inside'
where slt.VALID_FLAG = 0
<include refid="Base_Where_Clause"/>
<include refid="TopicMeeting_where" />
<include refid="ContactInformation_where" />
order by slt.${sortField} ${sortMode}
limit ${pager.startIndex-1},${pageSize}
</select>
</mapper>
@@ -0,0 +1,22 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE mapper
PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
<mapper namespace="com.adc.da.slrs.sarLawsTopic.dao.SarLawsTopicMeetingMapper">
<resultMap id="BaseResultMap" type="com.adc.da.slrs.sarLawsTopic.entity.SarLawsTopicMeeting">
<id property="id" column="ID" jdbcType="VARCHAR"/>
<result property="lawsTopicId" column="LAWS_TOPIC_ID" jdbcType="VARCHAR"/>
<result property="meetingName" column="MEETING_NAME" jdbcType="VARCHAR"/>
<result property="meetingTime" column="MEETING_TIME" jdbcType="TIMESTAMP"/>
<result property="meetingAddress" column="MEETING_ADDRESS" jdbcType="VARCHAR"/>
<result property="participants" column="PARTICIPANTS" jdbcType="VARCHAR"/>
<result property="meetingContent" column="MEETING_CONTENT" jdbcType="VARCHAR"/>
</resultMap>
<sql id="Base_Column_List">
ID,LAWS_TOPIC_ID,MEETING_NAME,
MEETING_TIME,MEETING_ADDRESS,PARTICIPANTS,
MEETING_CONTENT
</sql>
</mapper>