add: 政策课题模块增删改查
This commit is contained in:
+75
@@ -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("更新失败");
|
||||
}
|
||||
}
|
||||
+20
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
+20
@@ -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> {
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
+67
@@ -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;
|
||||
}
|
||||
+65
@@ -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 = "=";
|
||||
}
|
||||
+13
@@ -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> {
|
||||
|
||||
}
|
||||
+13
@@ -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> {
|
||||
|
||||
}
|
||||
+25
@@ -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);
|
||||
}
|
||||
+22
@@ -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{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
+22
@@ -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{
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
+172
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user