From 5cb5921142efc0568dc730b5cef6a9f9ecd78e58 Mon Sep 17 00:00:00 2001 From: wxyclub Date: Fri, 13 Oct 2023 15:34:17 +0800 Subject: [PATCH 01/31] =?UTF-8?q?add:=20=E5=86=85=E5=A4=96=E9=83=A8?= =?UTF-8?q?=E4=BC=9A=E8=AE=AE=E6=A8=A1=E5=9D=97=E5=A2=9E=E5=88=A0=E6=94=B9?= =?UTF-8?q?=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InsideOutSideMeetingController.java | 61 ++++++++++ .../dao/InsideOutsideMeetingDao.java | 24 ++++ .../dao/MeetingTopicDao.java | 16 +++ .../entity/InsideOutSideMeeting.java | 90 +++++++++++++++ .../entity/InsideOutsideMeetingVO.java | 69 +++++++++++ .../entity/MeetingTopic.java | 67 +++++++++++ .../service/InsideOutsideMeetingService.java | 23 ++++ .../impl/InsideOutsideMeetingServiceImpl.java | 80 +++++++++++++ .../InsideOntSideMeeting.xml | 109 ++++++++++++++++++ 9 files changed, 539 insertions(+) create mode 100644 adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/controller/InsideOutSideMeetingController.java create mode 100644 adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/dao/InsideOutsideMeetingDao.java create mode 100644 adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/dao/MeetingTopicDao.java create mode 100644 adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutSideMeeting.java create mode 100644 adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutsideMeetingVO.java create mode 100644 adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/MeetingTopic.java create mode 100644 adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/InsideOutsideMeetingService.java create mode 100644 adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/impl/InsideOutsideMeetingServiceImpl.java create mode 100644 adc-da-slrs/src/main/resources/mybatis/mapper/InsideOntSideMeeting/InsideOntSideMeeting.xml diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/controller/InsideOutSideMeetingController.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/controller/InsideOutSideMeetingController.java new file mode 100644 index 00000000..c97cb5bd --- /dev/null +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/controller/InsideOutSideMeetingController.java @@ -0,0 +1,61 @@ +package com.adc.da.slrs.InsideOntSideMeeting.controller; + +import com.adc.da.base.web.BaseController; +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.InsideOutsideMeetingVO; +import com.adc.da.slrs.InsideOntSideMeeting.service.InsideOutsideMeetingService; +import io.swagger.annotations.ApiOperation; +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/10 + */ +@RestController +@RequestMapping("/${restPath}/lawss/insideOutsideMeeting") +public class InsideOutSideMeetingController extends BaseController { + + @Resource + private InsideOutsideMeetingService meetingService; + + @ApiOperation(value = "根据会议ID查询会议信息") + @GetMapping("/getMeetingInfo") + public ResponseMessage getMeetingInfo(String meetingId){ + if (StringUtils.isBlank(meetingId)) { + return Result.error("会议ID为空!"); + } + InsideOutSideMeeting meetingInfo = meetingService.getMeetingInfo(meetingId); + return Result.success(meetingInfo); + } + + @ApiOperation(value = "分页查询") + @GetMapping("/page") + public ResponseMessage> page(InsideOutsideMeetingVO insideOutsideMeetingVO) { + List rows = meetingService.queryByPage(insideOutsideMeetingVO); + return Result.success(rows); + } + + @ApiOperation(value = "新增内外部会议") + @PostMapping(value = "/addMeetingInfo", consumes = "application/json;charset=UTF-8") + public ResponseMessage create(@RequestBody InsideOutSideMeeting insideOutSideMeeting) throws Exception { + meetingService.addMeetingInfo(insideOutSideMeeting); + return Result.success(); + } + + @ApiOperation("根据会议ID删除会议") + @DeleteMapping("/deleteMeetingInfo") + public ResponseMessage deleteMeeting(String meetingId) { + if (StringUtils.isBlank(meetingId)) { + return Result.error("删除失败,会议ID为空"); + } + meetingService.deleteMeetingById(meetingId); + return Result.success(); + } +} diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/dao/InsideOutsideMeetingDao.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/dao/InsideOutsideMeetingDao.java new file mode 100644 index 00000000..11a4693f --- /dev/null +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/dao/InsideOutsideMeetingDao.java @@ -0,0 +1,24 @@ +package com.adc.da.slrs.InsideOntSideMeeting.dao; + +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 + * @description + * @date 2023/10/10 + */ +@Mapper +public interface InsideOutsideMeetingDao extends BaseMapper { + + Integer queryByPageCount(InsideOutsideMeetingVO page); + + List queryByPage(InsideOutsideMeetingVO page); + +} diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/dao/MeetingTopicDao.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/dao/MeetingTopicDao.java new file mode 100644 index 00000000..ecae466a --- /dev/null +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/dao/MeetingTopicDao.java @@ -0,0 +1,16 @@ +package com.adc.da.slrs.InsideOntSideMeeting.dao; + +import com.adc.da.slrs.InsideOntSideMeeting.entity.MeetingTopic; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +/** + * @author tjzdw + * @description + * @date 2023/10/13 + */ +@Mapper +public interface MeetingTopicDao extends BaseMapper { + + +} diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutSideMeeting.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutSideMeeting.java new file mode 100644 index 00000000..d093567a --- /dev/null +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutSideMeeting.java @@ -0,0 +1,90 @@ +package com.adc.da.slrs.InsideOntSideMeeting.entity; + +import com.adc.da.base.entity.BaseEntity; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.util.Date; +import java.util.List; + +/** + * @author tjzdw + * @description + * @date 2023/10/10 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@Accessors(chain = true) +@ApiModel(value="inside_outside_meeting表对象", description="内外部会议") +public class InsideOutSideMeeting extends BaseEntity { + + private static final long serialVersionUID = 1L; + + @ApiModelProperty(value = "主键") + @TableId("ID") + private String id; + + @ApiModelProperty(value = "会议名称") + @TableField("MEETING_NAME") + private String meetingName; + + @ApiModelProperty(value = "课题名称,可通过调取功能从政策课题模块中获取") + @TableField("TOPIC_NAME") + private String topicName; + + @ApiModelProperty(value = "会议主办单位") + @TableField("MEETING_ORGANIZER") + private String meetingOrganizer; + + @ApiModelProperty(value = "会议时间") + @TableField("MEETING_TIME") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") + private Date meetingTime; + + @ApiModelProperty(value = "会议地点") + @TableField("MEETING_ADDRESS") + private String meetingAddress; + + @ApiModelProperty(value = "参会人员") + @TableField("PARTICIPANTS") + private String participants; + + @ApiModelProperty(value = "会议纪要") + @TableField("MEETING_MINUTES") + private String meetingMinutes; + + @ApiModelProperty(value = "会议主要内容") + @TableField("MEETING_CONTENT") + private String meetingContent; + + @ApiModelProperty(value = "1级会议类别") + @TableField("FIRST_MEETING_TYPE") + private String firstMeetingType; + + @ApiModelProperty(value = "2级会议类别") + @TableField("SECOND_MEETING_TYPE") + private String secondMeetingType; + + @ApiModelProperty(value = "会议议题") + private List meetingTopicList; + + @ApiModelProperty(value = "逻辑删除,0可用,1不可用") + @TableField("VALID_FLAG") + private Integer validFlag; + + @ApiModelProperty(value = "创建时间") + @TableField("CREATE_TIME") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @ApiModelProperty(value = "修改时间") + @TableField("MODIFY_TIME") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + private Date modifyTime; +} diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutsideMeetingVO.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutsideMeetingVO.java new file mode 100644 index 00000000..c9c781c4 --- /dev/null +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutsideMeetingVO.java @@ -0,0 +1,69 @@ +package com.adc.da.slrs.InsideOntSideMeeting.entity; + +import com.adc.da.base.page.BasePage; +import com.fasterxml.jackson.annotation.JsonFormat; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; +import java.util.List; + +/** + * @author tjzdw + * @description + * @date 2023/10/12 + */ +@EqualsAndHashCode(callSuper = true) +@Data +public class InsideOutsideMeetingVO extends BasePage { + + private String id; + + private String meetingName; + + private String topicName; + + private String meetingOrganizer; + + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") + private Date meetingTime; + + private String meetingAddress; + + private String participants; + private List participantsList; + + private String meetingMinutes; + + private String meetingContent; + + private String firstMeetingType; + + private String secondMeetingType; + + private List meetingTopicList; + + private String agendaName; + + private String agendaMaterials; + + private String reporter; + + private String reportingUnit; + + private String agendaContent; + + private Integer validFlag; + + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + private Date creationTime; + + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + private Date modifyTime; + + private String sortField; + + private String sortMode; + + private String meetingTimeOperator = "="; +} diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/MeetingTopic.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/MeetingTopic.java new file mode 100644 index 00000000..ff382dab --- /dev/null +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/MeetingTopic.java @@ -0,0 +1,67 @@ +package com.adc.da.slrs.InsideOntSideMeeting.entity; + +import com.adc.da.base.entity.BaseEntity; +import com.baomidou.mybatisplus.annotation.TableField; +import com.baomidou.mybatisplus.annotation.TableId; +import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModel; +import io.swagger.annotations.ApiModelProperty; +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; + +import java.util.Date; + +/** + * @author tjzdw + * @description + * @date 2023/10/12 + */ +@Data +@EqualsAndHashCode(callSuper = true) +@Accessors(chain = true) +@ApiModel(value="meeting_topic表对象", description="会议议题表") +public class MeetingTopic extends BaseEntity { + + @ApiModelProperty(value = "主键") + @TableId("ID") + private String id; + + @ApiModelProperty(value = "内外部会议ID") + @TableField("MEETING_ID") + private String meetingId; + + @ApiModelProperty(value = "议题名称") + @TableField("AGENDA_NAME") + private String agendaName; + + @ApiModelProperty(value = "议题材料") + @TableField("AGENDA_MATERIALS") + private String agendaMaterials; + + @ApiModelProperty(value = "汇报人") + @TableField("REPORTER") + private String reporter; + + @ApiModelProperty(value = "汇报单位") + @TableField("REPORTING_UNIT") + private String reportingUnit; + + @ApiModelProperty(value = "议题主要内容") + @TableField("AGENDA_CONTENT") + private String agendaContent; + + @ApiModelProperty(value = "逻辑删除,0可用,1不可用") + @TableField("VALID_FLAG") + private Integer validFlag; + + @ApiModelProperty(value = "创建时间") + @TableField("CREATE_TIME") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + private Date createTime; + + @ApiModelProperty(value = "修改时间") + @TableField("MODIFY_TIME") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + private Date modifyTime; +} diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/InsideOutsideMeetingService.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/InsideOutsideMeetingService.java new file mode 100644 index 00000000..a71a2544 --- /dev/null +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/InsideOutsideMeetingService.java @@ -0,0 +1,23 @@ +package com.adc.da.slrs.InsideOntSideMeeting.service; + +import com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutSideMeeting; +import com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutsideMeetingVO; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +/** + * @author tjzdw + * @description + * @date 2023/10/10 + */ +public interface InsideOutsideMeetingService extends IService { + + Integer addMeetingInfo(InsideOutSideMeeting insideOutSideMeeting); + + List queryByPage(InsideOutsideMeetingVO page); + + InsideOutSideMeeting getMeetingInfo(String meetingId); + + Integer deleteMeetingById(String meetingId); +} diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/impl/InsideOutsideMeetingServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/impl/InsideOutsideMeetingServiceImpl.java new file mode 100644 index 00000000..b927919d --- /dev/null +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/impl/InsideOutsideMeetingServiceImpl.java @@ -0,0 +1,80 @@ +package com.adc.da.slrs.InsideOntSideMeeting.service.impl; + +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.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +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 + * @date 2023/10/10 + */ +@Service +public class InsideOutsideMeetingServiceImpl extends ServiceImpl implements InsideOutsideMeetingService { + + @Resource + private MeetingTopicDao meetingTopicDao; + + @Override + public InsideOutSideMeeting getMeetingInfo(String meetingId){ + InsideOutSideMeeting insideOutSideMeeting = this.baseMapper.selectById(meetingId); + if (insideOutSideMeeting != null) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(MeetingTopic::getMeetingId, meetingId); + List meetingTopicList = meetingTopicDao.selectList(wrapper); + insideOutSideMeeting.setMeetingTopicList(meetingTopicList); + } + return insideOutSideMeeting; + } + + @Transactional + @Override + public Integer deleteMeetingById(String meetingId) { + int deleteById = this.baseMapper.deleteById(meetingId); + if (deleteById > 0) { + meetingTopicDao.deleteById(meetingId); + } + return deleteById; + } + + @Transactional + @Override + public Integer addMeetingInfo(InsideOutSideMeeting insideOutSideMeeting) { + insideOutSideMeeting.setCreateTime(new Date()); + insideOutSideMeeting.setModifyTime(new Date()); + insideOutSideMeeting.setValidFlag(0); + int insert = this.baseMapper.insert(insideOutSideMeeting); + if (!insideOutSideMeeting.getMeetingTopicList().isEmpty()) { + for (MeetingTopic meetingTopic : insideOutSideMeeting.getMeetingTopicList()) { + meetingTopic.setCreateTime(new Date()); + meetingTopic.setModifyTime(new Date()); + meetingTopic.setValidFlag(0); + meetingTopicDao.insert(meetingTopic); + } + } + return insert; + } + + @Override + public List 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); + return this.baseMapper.queryByPage(page); + } +} diff --git a/adc-da-slrs/src/main/resources/mybatis/mapper/InsideOntSideMeeting/InsideOntSideMeeting.xml b/adc-da-slrs/src/main/resources/mybatis/mapper/InsideOntSideMeeting/InsideOntSideMeeting.xml new file mode 100644 index 00000000..f8d8cf57 --- /dev/null +++ b/adc-da-slrs/src/main/resources/mybatis/mapper/InsideOntSideMeeting/InsideOntSideMeeting.xml @@ -0,0 +1,109 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + ID,MEETING_NAME,TOPIC_NAME,MEETING_ORGANIZER,MEETING_TIME,MEETING_ADDRESS, + PARTICIPANTS,MEETING_MINUTES,MEETING_CONTENT,FIRST_MEETING_TYPE,SECOND_MEETING_TYPE,VALID_FLAG,CREATE_TIME,MODIFY_TIME + + + iom.ID,iom.MEETING_NAME,iom.TOPIC_NAME,iom.MEETING_ORGANIZER,iom.MEETING_TIME,iom.MEETING_ADDRESS, + iom.PARTICIPANTS,iom.MEETING_MINUTES,iom.MEETING_CONTENT,iom.FIRST_MEETING_TYPE,iom.SECOND_MEETING_TYPE, + mt.ID,mt.MEETING_ID,mt.AGENDA_NAME,mt.AGENDA_MATERIALS,mt.REPORTER,mt.REPORTING_UNIT, + mt.AGENDA_CONTENT,mt.VALID_FLAG,mt.CREATE_TIME,mt.MODIFY_TIME, + iom.VALID_FLAG,iom.CREATE_TIME,iom.MODIFY_TIME + + + + + and MEETING_NAME like concat('%',#{meetingName},'%') + + + and TOPIC_NAME = #{topicName} + + + and MEETING_ORGANIZER like concat('%',#{meetingOrganizer},'%') + + + and MEETING_TIME ${meetingTimeOperator} #{meetingTime} + + + and MEETING_ADDRESS like concat('%',#{meetingAddress},'%') + + + and PARTICIPANTS in + + #{participant} + + + + and MEETING_CONTENT like concat('%',#{meetingContent},'%') + + + and FIRST_MEETING_TYPE = #{firstMeetingType} + + + and SECOND_MEETING_TYPE = #{secondMeetingType} + + + + + + and mt.AGENDA_NAME like concat('%',#{agendaName},'%') + + + and mt.REPORTER like concat('%',#{reporter},'%') + + + and mt.REPORTING_UNIT like concat('%',#{reportingUnit},'%') + + + and mt.AGENDA_CONTENT like concat('%',#{agendaContent},'%') + + + + + + + \ No newline at end of file From 01bf8b376feaea8cfcd33fede3f806c700a0c27e Mon Sep 17 00:00:00 2001 From: wxyclub Date: Mon, 16 Oct 2023 09:22:15 +0800 Subject: [PATCH 02/31] =?UTF-8?q?add:=20=E5=86=85=E5=A4=96=E9=83=A8?= =?UTF-8?q?=E4=BC=9A=E8=AE=AE=E6=A8=A1=E5=9D=97=E5=A2=9E=E5=88=A0=E6=94=B9?= =?UTF-8?q?=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InsideOutSideMeetingController.java | 11 +++++ .../entity/InsideOutSideMeeting.java | 7 ++- .../entity/MeetingTopic.java | 5 ++- .../service/InsideOutsideMeetingService.java | 4 +- .../service/MeetingTopicService.java | 12 +++++ .../impl/InsideOutsideMeetingServiceImpl.java | 45 +++++++++++++++---- .../service/impl/MeetingTopicServiceImpl.java | 16 +++++++ .../InsideOntSideMeeting.xml | 2 - 8 files changed, 88 insertions(+), 14 deletions(-) create mode 100644 adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/MeetingTopicService.java create mode 100644 adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/impl/MeetingTopicServiceImpl.java diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/controller/InsideOutSideMeetingController.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/controller/InsideOutSideMeetingController.java index c97cb5bd..1306d27d 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/controller/InsideOutSideMeetingController.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/controller/InsideOutSideMeetingController.java @@ -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 updateMeetingInfo(@RequestBody InsideOutSideMeeting insideOutSideMeeting) { + if (ObjectUtils.isEmpty(insideOutSideMeeting)) { + return Result.error("更新失败,会议信息不存在"); + } + Boolean updateResult = meetingService.updateMeetingInfo(insideOutSideMeeting); + return updateResult ? Result.success() : Result.error("更新失败"); + } } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutSideMeeting.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutSideMeeting.java index d093567a..21632907 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutSideMeeting.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutSideMeeting.java @@ -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 meetingTopicList; @ApiModelProperty(value = "逻辑删除,0可用,1不可用") diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/MeetingTopic.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/MeetingTopic.java index ff382dab..f030a1bc 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/MeetingTopic.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/MeetingTopic.java @@ -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") diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/InsideOutsideMeetingService.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/InsideOutsideMeetingService.java index a71a2544..b9f1c3e6 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/InsideOutsideMeetingService.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/InsideOutsideMeetingService.java @@ -19,5 +19,7 @@ public interface InsideOutsideMeetingService extends IService { +} diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/impl/InsideOutsideMeetingServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/impl/InsideOutsideMeetingServiceImpl.java index b927919d..6d7158ce 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/impl/InsideOutsideMeetingServiceImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/impl/InsideOutsideMeetingServiceImpl.java @@ -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 implements InsideOutsideMeetingService { @Resource - private MeetingTopicDao meetingTopicDao; + private MeetingTopicService meetingTopicService; @Override public InsideOutSideMeeting getMeetingInfo(String meetingId){ @@ -34,7 +36,7 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl wrapper = new LambdaQueryWrapper<>(); wrapper.eq(MeetingTopic::getMeetingId, meetingId); - List meetingTopicList = meetingTopicDao.selectList(wrapper); + List meetingTopicList = meetingTopicService.list(wrapper); insideOutSideMeeting.setMeetingTopicList(meetingTopicList); } return insideOutSideMeeting; @@ -42,12 +44,35 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl 0) { - meetingTopicDao.deleteById(meetingId); + public Boolean deleteMeetingById(String meetingId) { + LambdaUpdateWrapper wrapper = new LambdaUpdateWrapper<>(); + wrapper.eq(InsideOutSideMeeting::getId, meetingId); + wrapper.set(InsideOutSideMeeting::getValidFlag,1); + boolean update = update(wrapper); + if (update) { + LambdaUpdateWrapper 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 implements MeetingTopicService { +} diff --git a/adc-da-slrs/src/main/resources/mybatis/mapper/InsideOntSideMeeting/InsideOntSideMeeting.xml b/adc-da-slrs/src/main/resources/mybatis/mapper/InsideOntSideMeeting/InsideOntSideMeeting.xml index f8d8cf57..9a513913 100644 --- a/adc-da-slrs/src/main/resources/mybatis/mapper/InsideOntSideMeeting/InsideOntSideMeeting.xml +++ b/adc-da-slrs/src/main/resources/mybatis/mapper/InsideOntSideMeeting/InsideOntSideMeeting.xml @@ -104,6 +104,4 @@ order by iom.ID limit #{page},#{pageSize} - - \ No newline at end of file From 26202db6cc4c82b311d6afbb20348c6675bdfef0 Mon Sep 17 00:00:00 2001 From: wxyclub Date: Mon, 16 Oct 2023 10:28:45 +0800 Subject: [PATCH 03/31] =?UTF-8?q?add:=20=E5=86=85=E5=A4=96=E9=83=A8?= =?UTF-8?q?=E4=BC=9A=E8=AE=AE=E6=A8=A1=E5=9D=97=E5=A2=9E=E5=88=A0=E6=94=B9?= =?UTF-8?q?=E6=9F=A5=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InsideOutSideMeetingController.java | 20 +++++++++-------- .../dao/InsideOutsideMeetingDao.java | 8 +++---- ...Meeting.java => InsideOutsideMeeting.java} | 2 +- .../entity/InsideOutsideMeetingVO.java | 2 ++ .../service/InsideOutsideMeetingService.java | 12 +++++----- .../impl/InsideOutsideMeetingServiceImpl.java | 22 +++++++++---------- .../InsideOntSideMeeting.xml | 11 +++++----- 7 files changed, 39 insertions(+), 38 deletions(-) rename adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/{InsideOutSideMeeting.java => InsideOutsideMeeting.java} (98%) diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/controller/InsideOutSideMeetingController.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/controller/InsideOutSideMeetingController.java index 1306d27d..9123c3df 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/controller/InsideOutSideMeetingController.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/controller/InsideOutSideMeetingController.java @@ -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 { +public class InsideOutSideMeetingController extends BaseController { @Resource private InsideOutsideMeetingService meetingService; @ApiOperation(value = "根据会议ID查询会议信息") @GetMapping("/getMeetingInfo") - public ResponseMessage getMeetingInfo(String meetingId){ + public ResponseMessage 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> page(InsideOutsideMeetingVO insideOutsideMeetingVO) { - List rows = meetingService.queryByPage(insideOutsideMeetingVO); - return Result.success(rows); + public ResponseMessage> page(InsideOutsideMeetingVO insideOutsideMeetingVO) { + List 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 updateMeetingInfo(@RequestBody InsideOutSideMeeting insideOutSideMeeting) { + public ResponseMessage updateMeetingInfo(@RequestBody InsideOutsideMeeting insideOutSideMeeting) { if (ObjectUtils.isEmpty(insideOutSideMeeting)) { return Result.error("更新失败,会议信息不存在"); } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/dao/InsideOutsideMeetingDao.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/dao/InsideOutsideMeetingDao.java index 11a4693f..74487b9c 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/dao/InsideOutsideMeetingDao.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/dao/InsideOutsideMeetingDao.java @@ -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 { +public interface InsideOutsideMeetingDao extends BaseMapper { Integer queryByPageCount(InsideOutsideMeetingVO page); - List queryByPage(InsideOutsideMeetingVO page); + List queryByPage(InsideOutsideMeetingVO page); } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutSideMeeting.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutsideMeeting.java similarity index 98% rename from adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutSideMeeting.java rename to adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutsideMeeting.java index 21632907..8f783abc 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutSideMeeting.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutsideMeeting.java @@ -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; diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutsideMeetingVO.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutsideMeetingVO.java index c9c781c4..4195217c 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutsideMeetingVO.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutsideMeetingVO.java @@ -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 { diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/InsideOutsideMeetingService.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/InsideOutsideMeetingService.java index b9f1c3e6..0c88446b 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/InsideOutsideMeetingService.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/InsideOutsideMeetingService.java @@ -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 { +public interface InsideOutsideMeetingService extends IService { - Integer addMeetingInfo(InsideOutSideMeeting insideOutSideMeeting); + Integer addMeetingInfo(InsideOutsideMeeting insideOutSideMeeting); - List queryByPage(InsideOutsideMeetingVO page); + List queryByPage(InsideOutsideMeetingVO page); - InsideOutSideMeeting getMeetingInfo(String meetingId); + InsideOutsideMeeting getMeetingInfo(String meetingId); Boolean deleteMeetingById(String meetingId); - Boolean updateMeetingInfo(InsideOutSideMeeting insideOutSideMeeting); + Boolean updateMeetingInfo(InsideOutsideMeeting insideOutSideMeeting); } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/impl/InsideOutsideMeetingServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/impl/InsideOutsideMeetingServiceImpl.java index 6d7158ce..257b504e 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/impl/InsideOutsideMeetingServiceImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/impl/InsideOutsideMeetingServiceImpl.java @@ -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 implements InsideOutsideMeetingService { +public class InsideOutsideMeetingServiceImpl extends ServiceImpl 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 wrapper = new LambdaQueryWrapper<>(); wrapper.eq(MeetingTopic::getMeetingId, meetingId); @@ -45,9 +44,9 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl wrapper = new LambdaUpdateWrapper<>(); - wrapper.eq(InsideOutSideMeeting::getId, meetingId); - wrapper.set(InsideOutSideMeeting::getValidFlag,1); + LambdaUpdateWrapper wrapper = new LambdaUpdateWrapper<>(); + wrapper.eq(InsideOutsideMeeting::getId, meetingId); + wrapper.set(InsideOutsideMeeting::getValidFlag,1); boolean update = update(wrapper); if (update) { LambdaUpdateWrapper topicWrapper = new LambdaUpdateWrapper<>(); @@ -60,7 +59,7 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl queryByPage(InsideOutsideMeetingVO page){ + public List 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); } } diff --git a/adc-da-slrs/src/main/resources/mybatis/mapper/InsideOntSideMeeting/InsideOntSideMeeting.xml b/adc-da-slrs/src/main/resources/mybatis/mapper/InsideOntSideMeeting/InsideOntSideMeeting.xml index 9a513913..dc8b2981 100644 --- a/adc-da-slrs/src/main/resources/mybatis/mapper/InsideOntSideMeeting/InsideOntSideMeeting.xml +++ b/adc-da-slrs/src/main/resources/mybatis/mapper/InsideOntSideMeeting/InsideOntSideMeeting.xml @@ -3,7 +3,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -91,17 +91,18 @@ - select from inside_outside_meeting iom join meeting_topic mt on iom.ID = mt.MEETING_ID where iom.VALID_FLAG = 0 order by iom.ID - limit #{page},#{pageSize} + limit ${pager.startIndex-1},${pageSize} \ No newline at end of file From ccb9b67121d5ed9849ba0246d1cbfa170f0f98ae Mon Sep 17 00:00:00 2001 From: wxyclub Date: Mon, 16 Oct 2023 11:40:03 +0800 Subject: [PATCH 04/31] =?UTF-8?q?add:=20=E5=86=85=E5=A4=96=E9=83=A8?= =?UTF-8?q?=E4=BC=9A=E8=AE=AE=E6=A8=A1=E5=9D=97=E4=BF=AE=E6=94=B9=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/InsideOutsideMeetingServiceImpl.java | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/impl/InsideOutsideMeetingServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/impl/InsideOutsideMeetingServiceImpl.java index 257b504e..4a55507d 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/impl/InsideOutsideMeetingServiceImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/impl/InsideOutsideMeetingServiceImpl.java @@ -66,9 +66,17 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl 0) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(MeetingTopic::getMeetingId,insideOutSideMeeting.getId()); + // 先删除会议信息 + meetingTopicService.remove(wrapper); + // 再添加会议信息 for (MeetingTopic meetingTopic : insideOutSideMeeting.getMeetingTopicList()) { + meetingTopic.setCreateTime(new Date()); meetingTopic.setModifyTime(new Date()); - meetingTopicService.updateById(meetingTopic); + meetingTopic.setValidFlag(0); + meetingTopic.setMeetingId(insideOutSideMeeting.getId()); + meetingTopicService.save(meetingTopic); } } return true; From fc088d1e6a89aed55c978eb70a1833c1737226b4 Mon Sep 17 00:00:00 2001 From: wxyclub Date: Wed, 18 Oct 2023 09:59:30 +0800 Subject: [PATCH 05/31] =?UTF-8?q?add:=20=E5=86=85=E5=A4=96=E9=83=A8?= =?UTF-8?q?=E4=BC=9A=E8=AE=AE=E6=A8=A1=E5=9D=97=E6=8E=92=E5=BA=8F=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../mapper/InsideOntSideMeeting/InsideOntSideMeeting.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adc-da-slrs/src/main/resources/mybatis/mapper/InsideOntSideMeeting/InsideOntSideMeeting.xml b/adc-da-slrs/src/main/resources/mybatis/mapper/InsideOntSideMeeting/InsideOntSideMeeting.xml index dc8b2981..42f3fbec 100644 --- a/adc-da-slrs/src/main/resources/mybatis/mapper/InsideOntSideMeeting/InsideOntSideMeeting.xml +++ b/adc-da-slrs/src/main/resources/mybatis/mapper/InsideOntSideMeeting/InsideOntSideMeeting.xml @@ -102,7 +102,7 @@ where iom.VALID_FLAG = 0 - order by iom.ID + order by #{sortField} #{sortMode} limit ${pager.startIndex-1},${pageSize} \ No newline at end of file From 5d8bed9af2a26ba23ed4eb7fa461e55b9fc0f420 Mon Sep 17 00:00:00 2001 From: wxyclub Date: Wed, 18 Oct 2023 11:56:19 +0800 Subject: [PATCH 06/31] =?UTF-8?q?add:=20=E5=86=85=E5=A4=96=E9=83=A8?= =?UTF-8?q?=E4=BC=9A=E8=AE=AE=E6=A8=A1=E5=9D=97=E6=8E=92=E5=BA=8F=E5=8A=9F?= =?UTF-8?q?=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/InsideOutsideMeetingVO.java | 4 ++-- .../service/impl/InsideOutsideMeetingServiceImpl.java | 10 ++++++++++ .../InsideOntSideMeeting/InsideOntSideMeeting.xml | 10 +++++++++- 3 files changed, 21 insertions(+), 3 deletions(-) diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutsideMeetingVO.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutsideMeetingVO.java index 4195217c..7db87388 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutsideMeetingVO.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutsideMeetingVO.java @@ -63,9 +63,9 @@ public class InsideOutsideMeetingVO extends BasePage { @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") private Date modifyTime; - private String sortField; + private String sortField = "ID"; - private String sortMode; + private String sortMode = "asc"; private String meetingTimeOperator = "="; } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/impl/InsideOutsideMeetingServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/impl/InsideOutsideMeetingServiceImpl.java index 4a55507d..473cb233 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/impl/InsideOutsideMeetingServiceImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/impl/InsideOutsideMeetingServiceImpl.java @@ -9,6 +9,7 @@ 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.lang.WordUtils; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -106,6 +107,15 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl - order by #{sortField} #{sortMode} + order by + + + mt.${sortField} ${sortMode} + + + iom.${sortField} ${sortMode} + + limit ${pager.startIndex-1},${pageSize} \ No newline at end of file From 4621286ca537bd0c2073eb5dd170b2c860e65073 Mon Sep 17 00:00:00 2001 From: wxyclub Date: Wed, 18 Oct 2023 14:23:15 +0800 Subject: [PATCH 07/31] =?UTF-8?q?add:=20=E6=94=BF=E7=AD=96=E8=AF=BE?= =?UTF-8?q?=E9=A2=98=E6=A8=A1=E5=9D=97=E5=A2=9E=E5=88=A0=E6=94=B9=E6=9F=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ActSarItemMeetingEOController.java | 39 ++++ .../service/ActSarItemMeetingEOService.java | 42 ++++ .../controller/SarLawsTopicController.java | 75 +++++++ .../dao/SarLawsContactInformationMapper.java | 20 ++ .../sarLawsTopic/dao/SarLawsTopicMapper.java | 26 +++ .../dao/SarLawsTopicMeetingMapper.java | 20 ++ .../entity/SarLawsContactInformation.java | 67 ++++++ .../sarLawsTopic/entity/SarLawsTopic.java | 177 +++++++++++++++ .../entity/SarLawsTopicMeeting.java | 65 ++++++ .../sarLawsTopic/entity/SarLawsTopicVO.java | 207 +++++++++++++++++ .../SarLawsContactInformationService.java | 13 ++ .../service/SarLawsTopicMeetingService.java | 13 ++ .../service/SarLawsTopicService.java | 25 +++ .../SarLawsContactInformationServiceImpl.java | 22 ++ .../impl/SarLawsTopicMeetingServiceImpl.java | 22 ++ .../service/impl/SarLawsTopicServiceImpl.java | 172 +++++++++++++++ .../SarLawsContactInformationMapper.xml | 23 ++ .../sarLawsTopic/SarLawsTopicMapper.xml | 208 ++++++++++++++++++ .../SarLawsTopicMeetingMapper.xml | 22 ++ 19 files changed, 1258 insertions(+) create mode 100644 adc-da-activiti/src/main/java/com/adc/da/workFlow/controller/ActSarItemMeetingEOController.java create mode 100644 adc-da-activiti/src/main/java/com/adc/da/workFlow/service/ActSarItemMeetingEOService.java create mode 100644 adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/controller/SarLawsTopicController.java create mode 100644 adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/dao/SarLawsContactInformationMapper.java create mode 100644 adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/dao/SarLawsTopicMapper.java create mode 100644 adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/dao/SarLawsTopicMeetingMapper.java create mode 100644 adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsContactInformation.java create mode 100644 adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsTopic.java create mode 100644 adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsTopicMeeting.java create mode 100644 adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsTopicVO.java create mode 100644 adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/SarLawsContactInformationService.java create mode 100644 adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/SarLawsTopicMeetingService.java create mode 100644 adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/SarLawsTopicService.java create mode 100644 adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/impl/SarLawsContactInformationServiceImpl.java create mode 100644 adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/impl/SarLawsTopicMeetingServiceImpl.java create mode 100644 adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/impl/SarLawsTopicServiceImpl.java create mode 100644 adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsTopic/SarLawsContactInformationMapper.xml create mode 100644 adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsTopic/SarLawsTopicMapper.xml create mode 100644 adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsTopic/SarLawsTopicMeetingMapper.xml diff --git a/adc-da-activiti/src/main/java/com/adc/da/workFlow/controller/ActSarItemMeetingEOController.java b/adc-da-activiti/src/main/java/com/adc/da/workFlow/controller/ActSarItemMeetingEOController.java new file mode 100644 index 00000000..e0cfee9d --- /dev/null +++ b/adc-da-activiti/src/main/java/com/adc/da/workFlow/controller/ActSarItemMeetingEOController.java @@ -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 processCreateMeeting(String infoJson) throws Exception { + if (StringUtils.isBlank(infoJson)) { + return Result.error("传入数据json不能为空"); + } + meetingEOService.processCreateMeeting(infoJson); + return Result.success("入库成功"); + } +} diff --git a/adc-da-activiti/src/main/java/com/adc/da/workFlow/service/ActSarItemMeetingEOService.java b/adc-da-activiti/src/main/java/com/adc/da/workFlow/service/ActSarItemMeetingEOService.java new file mode 100644 index 00000000..b525df00 --- /dev/null +++ b/adc-da-activiti/src/main/java/com/adc/da/workFlow/service/ActSarItemMeetingEOService.java @@ -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 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); + } +} diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/controller/SarLawsTopicController.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/controller/SarLawsTopicController.java new file mode 100644 index 00000000..8e69b57a --- /dev/null +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/controller/SarLawsTopicController.java @@ -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 { + + @Resource + private SarLawsTopicService lawsTopicService; + + @ApiOperation(value = "根据政策课题ID查询会议信息") + @GetMapping("/getLawsTopicInfo") + public ResponseMessage 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> page(SarLawsTopicVO sarLawsTopicVO) { + List 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("更新失败"); + } +} diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/dao/SarLawsContactInformationMapper.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/dao/SarLawsContactInformationMapper.java new file mode 100644 index 00000000..83527477 --- /dev/null +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/dao/SarLawsContactInformationMapper.java @@ -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 { + +} + + + + diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/dao/SarLawsTopicMapper.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/dao/SarLawsTopicMapper.java new file mode 100644 index 00000000..506dd9ff --- /dev/null +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/dao/SarLawsTopicMapper.java @@ -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 { + + Integer queryByPageCount(SarLawsTopicVO page); + + List queryByPage(SarLawsTopicVO page); +} + + + + diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/dao/SarLawsTopicMeetingMapper.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/dao/SarLawsTopicMeetingMapper.java new file mode 100644 index 00000000..c91c3f54 --- /dev/null +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/dao/SarLawsTopicMeetingMapper.java @@ -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 { + +} + + + + diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsContactInformation.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsContactInformation.java new file mode 100644 index 00000000..6b0d4584 --- /dev/null +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsContactInformation.java @@ -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; +} \ No newline at end of file diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsTopic.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsTopic.java new file mode 100644 index 00000000..56652901 --- /dev/null +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsTopic.java @@ -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 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 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 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; +} \ No newline at end of file diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsTopicMeeting.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsTopicMeeting.java new file mode 100644 index 00000000..b6f86cef --- /dev/null +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsTopicMeeting.java @@ -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; +} \ No newline at end of file diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsTopicVO.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsTopicVO.java new file mode 100644 index 00000000..f9958fa6 --- /dev/null +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsTopicVO.java @@ -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 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 participantsList; + + /** + * 会议主要内容 + */ + private String meetingContent; + + /** + * 课题组研究方案 + */ + private String researchPlan; + + /** + * 课题组研究成果 + */ + private String researchFindings; + + /** + * 课题组其他 + */ + private String researchGroupOther; + + /** + * 课题组会议资料 + */ + private String conferenceMaterials; + + /** + * 课题组联系方式 + */ + private List 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 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 = "="; +} diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/SarLawsContactInformationService.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/SarLawsContactInformationService.java new file mode 100644 index 00000000..95580fe5 --- /dev/null +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/SarLawsContactInformationService.java @@ -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 { + +} diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/SarLawsTopicMeetingService.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/SarLawsTopicMeetingService.java new file mode 100644 index 00000000..0b79192f --- /dev/null +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/SarLawsTopicMeetingService.java @@ -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 { + +} diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/SarLawsTopicService.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/SarLawsTopicService.java new file mode 100644 index 00000000..2d59726e --- /dev/null +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/SarLawsTopicService.java @@ -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 getLawsTopicInfo(String lawsTopicId); + + Integer addLawsTopicInfo(SarLawsTopic lawsTopic); + + Boolean deleteLawsTopicInfo(String lawsTopicId); + + Boolean updateLawsTopicInfo(SarLawsTopic lawsTopic); + + List queryByPage(SarLawsTopicVO sarLawsTopicVO); +} diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/impl/SarLawsContactInformationServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/impl/SarLawsContactInformationServiceImpl.java new file mode 100644 index 00000000..40ec89f8 --- /dev/null +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/impl/SarLawsContactInformationServiceImpl.java @@ -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 + implements SarLawsContactInformationService{ + +} + + + + diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/impl/SarLawsTopicMeetingServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/impl/SarLawsTopicMeetingServiceImpl.java new file mode 100644 index 00000000..c694e6ba --- /dev/null +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/impl/SarLawsTopicMeetingServiceImpl.java @@ -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 + implements SarLawsTopicMeetingService{ + +} + + + + diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/impl/SarLawsTopicServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/impl/SarLawsTopicServiceImpl.java new file mode 100644 index 00000000..f989c69a --- /dev/null +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/impl/SarLawsTopicServiceImpl.java @@ -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 + 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 meetingWrapper = new LambdaQueryWrapper<>(); + meetingWrapper.eq(SarLawsTopicMeeting::getLawsTopicId, lawsTopicId); + List topicMeetingList = meetingService.list(meetingWrapper); + sarLawsTopic.setMeetingList(topicMeetingList); + // 查询课题组联系方式 + LambdaQueryWrapper topicGroupWrapper = new LambdaQueryWrapper<>(); + topicGroupWrapper.eq(SarLawsContactInformation::getLawsTopicId, lawsTopicId); + topicGroupWrapper.eq(SarLawsContactInformation::getGroupType,"lawsTopic"); + List lawsTopicContactInformation = contactInformationService.list(topicGroupWrapper); + sarLawsTopic.setTopicContactInformationList(lawsTopicContactInformation); + // 查询内部联系房方式 + LambdaQueryWrapper insideWrapper = new LambdaQueryWrapper<>(); + topicGroupWrapper.eq(SarLawsContactInformation::getLawsTopicId, lawsTopicId); + topicGroupWrapper.eq(SarLawsContactInformation::getGroupType,"lawsTopic"); + List 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 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 lawsTopicWrapper = new LambdaQueryWrapper<>(); + lawsTopicWrapper.eq(SarLawsTopicMeeting::getLawsTopicId, lawsTopicId); + meetingService.remove(lawsTopicWrapper); + LambdaQueryWrapper 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 topicWrapper = new LambdaQueryWrapper<>(); + topicWrapper.eq(SarLawsTopicMeeting::getLawsTopicId,lawsTopic.getId()); + meetingService.remove(topicWrapper); + LambdaQueryWrapper 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 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); + } +} + + + + diff --git a/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsTopic/SarLawsContactInformationMapper.xml b/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsTopic/SarLawsContactInformationMapper.xml new file mode 100644 index 00000000..0640d7ca --- /dev/null +++ b/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsTopic/SarLawsContactInformationMapper.xml @@ -0,0 +1,23 @@ + + + + + + + + + + + + + + + + + ID,LAWS_TOPIC_ID,GROUP_TYPE, + `NAME`,DEPARTMENT,PHONE, + EMAIL,IDENTITY + + diff --git a/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsTopic/SarLawsTopicMapper.xml b/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsTopic/SarLawsTopicMapper.xml new file mode 100644 index 00000000..68611183 --- /dev/null +++ b/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsTopic/SarLawsTopicMapper.xml @@ -0,0 +1,208 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 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 + + + 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 + + + + + and TOPIC_NAME like concat('%',#{topicName},'%') + + + and ORGANIZER like concat('%',#{organizer},'%') + + + and GUIDANCE_UNIT like concat('%',#{guidanceUnit},'%') + + + and PARTICIPATING_UNIT like concat('%',#{participatingUnit},'%') + + + and START_TIME ${startTimeOperator} #{startTime} + + + and CLOSE_TIME ${startTimeOperator} #{closeTime} + + + and TOPIC_STATUS = #{topicStatus} + + + and TOPIC_COST like concat('%',#{topicCost},'%') + + + + + + and sltm.MEETING_NAME like concat('%',#{meetingName},'%') + + + and sltm.MEETING_TIME like concat('%',#{meetingTime},'%') + + + and sltm.MEETING_ADDRESS like concat('%',#{meetingAddress},'%') + + + + + + + + + and sltm.PARTICIPANTS like concat('%',#{participants},'%') + + + and sltm.MEETING_CONTENT like concat('%',#{meetingContent},'%') + + + + + and slci1.NAME like concat('%',#{topicGroupName},'%') + + + and slci1.DEPARTMENT like concat('%',#{topicGroupDepartment},'%') + + + and slci1.PHONE like concat('%',#{topicGroupPhone},'%') + + + and slci1.EMAIL like concat('%',#{topicGroupEmail},'%') + + + and slci1.IDENTITY like concat('%',#{topicGroupIdentity},'%') + + + and slci2.NAME like concat('%',#{insideName},'%') + + + and slci2.DEPARTMENT like concat('%',#{insideDepartment},'%') + + + and slci2.PHONE like concat('%',#{insidePhone},'%') + + + and slci2.EMAIL like concat('%',#{insideEmail},'%') + + + and slci2.IDENTITY like concat('%',#{insideIdentity},'%') + + + + + + diff --git a/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsTopic/SarLawsTopicMeetingMapper.xml b/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsTopic/SarLawsTopicMeetingMapper.xml new file mode 100644 index 00000000..4dd92828 --- /dev/null +++ b/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsTopic/SarLawsTopicMeetingMapper.xml @@ -0,0 +1,22 @@ + + + + + + + + + + + + + + + + ID,LAWS_TOPIC_ID,MEETING_NAME, + MEETING_TIME,MEETING_ADDRESS,PARTICIPANTS, + MEETING_CONTENT + + From ffefa7fcdee0040cd6660bd8d4ef9578a8fc6522 Mon Sep 17 00:00:00 2001 From: wxyclub Date: Wed, 18 Oct 2023 15:15:10 +0800 Subject: [PATCH 08/31] =?UTF-8?q?add:=20=E6=94=BF=E7=AD=96=E8=AF=BE?= =?UTF-8?q?=E9=A2=98=E6=A8=A1=E5=9D=97=E5=A2=9E=E5=88=A0=E6=94=B9=E6=9F=A5?= =?UTF-8?q?=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../slrs/sarLawsTopic/entity/SarLawsTopic.java | 4 ++-- .../sarLawsTopic/entity/SarLawsTopicMeeting.java | 3 +-- .../slrs/sarLawsTopic/entity/SarLawsTopicVO.java | 10 ++++++---- .../mapper/sarLawsTopic/SarLawsTopicMapper.xml | 16 ++++++++-------- .../sarLawsTopic/SarLawsTopicMeetingMapper.xml | 2 +- 5 files changed, 18 insertions(+), 17 deletions(-) diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsTopic.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsTopic.java index 56652901..9423112d 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsTopic.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsTopic.java @@ -51,14 +51,14 @@ public class SarLawsTopic implements Serializable { /** * 开始时间 */ - @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") @TableField(value = "START_TIME") private Date startTime; /** * 结题时间 */ - @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") @TableField(value = "CLOSE_TIME") private Date closeTime; diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsTopicMeeting.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsTopicMeeting.java index b6f86cef..b0a749d5 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsTopicMeeting.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsTopicMeeting.java @@ -38,9 +38,8 @@ public class SarLawsTopicMeeting implements Serializable { /** * 会议时间 */ - @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") @TableField(value = "MEETING_TIME") - private Date meetingTime; + private String meetingTime; /** * 会议地点 diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsTopicVO.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsTopicVO.java index f9958fa6..553b40fa 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsTopicVO.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsTopicVO.java @@ -5,6 +5,7 @@ import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; +import org.springframework.format.annotation.DateTimeFormat; import java.util.Date; import java.util.List; @@ -46,13 +47,15 @@ public class SarLawsTopicVO extends BasePage { /** * 开始时间 */ - @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern = "yyyy-MM-dd") private Date startTime; /** * 结题时间 */ - @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern = "yyyy-MM-dd") private Date closeTime; /** @@ -83,8 +86,7 @@ public class SarLawsTopicVO extends BasePage { /** * 会议时间 */ - @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") - private Date meetingTime; + private String meetingTime; /** * 会议地点 diff --git a/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsTopic/SarLawsTopicMapper.xml b/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsTopic/SarLawsTopicMapper.xml index 68611183..8aa24169 100644 --- a/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsTopic/SarLawsTopicMapper.xml +++ b/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsTopic/SarLawsTopicMapper.xml @@ -10,8 +10,8 @@ - - + + @@ -28,8 +28,8 @@ - - + + @@ -71,8 +71,8 @@ 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.ID as sltmId, + sltm.LAWS_TOPIC_ID as sltmLawsTopicId, sltm.MEETING_NAME, sltm.MEETING_TIME, sltm.MEETING_ADDRESS, @@ -114,10 +114,10 @@ and PARTICIPATING_UNIT like concat('%',#{participatingUnit},'%') - + and START_TIME ${startTimeOperator} #{startTime} - + and CLOSE_TIME ${startTimeOperator} #{closeTime} diff --git a/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsTopic/SarLawsTopicMeetingMapper.xml b/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsTopic/SarLawsTopicMeetingMapper.xml index 4dd92828..b2dbba0f 100644 --- a/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsTopic/SarLawsTopicMeetingMapper.xml +++ b/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsTopic/SarLawsTopicMeetingMapper.xml @@ -8,7 +8,7 @@ - + From 984cdebda62762b4c111d6d58800111886d42a40 Mon Sep 17 00:00:00 2001 From: wxyclub Date: Wed, 18 Oct 2023 16:45:19 +0800 Subject: [PATCH 09/31] =?UTF-8?q?add:=20=E6=B7=BB=E5=8A=A0=E5=86=85?= =?UTF-8?q?=E5=A4=96=E9=83=A8=E4=BC=9A=E8=AE=AE=E6=B5=81=E7=A8=8B=E5=AE=9A?= =?UTF-8?q?=E4=B9=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/adc/da/common/ActDefineStartMap.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/adc-da-activiti/src/main/java/com/adc/da/common/ActDefineStartMap.java b/adc-da-activiti/src/main/java/com/adc/da/common/ActDefineStartMap.java index 9a11b8e6..ae96cef1 100644 --- a/adc-da-activiti/src/main/java/com/adc/da/common/ActDefineStartMap.java +++ b/adc-da-activiti/src/main/java/com/adc/da/common/ActDefineStartMap.java @@ -63,6 +63,8 @@ public class ActDefineStartMap { map.put("27","wdzxlc"); // 标准需求(翻译)申请流程 map.put("28","bzxqfy"); + // 内外部会议入库流程 + map.put("29","insideOutsideMeetingLibrary"); return map.get(type); } From ea2725ee42aaa1d036d5c5b1ef292a83013f83ed Mon Sep 17 00:00:00 2001 From: wxyclub Date: Fri, 20 Oct 2023 10:03:37 +0800 Subject: [PATCH 10/31] =?UTF-8?q?add:=20=E5=86=85=E5=A4=96=E9=83=A8?= =?UTF-8?q?=E4=BC=9A=E8=AE=AE=E5=85=A5=E5=BA=93?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../workFlow/service/ActSarItemMeetingEOService.java | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/adc-da-activiti/src/main/java/com/adc/da/workFlow/service/ActSarItemMeetingEOService.java b/adc-da-activiti/src/main/java/com/adc/da/workFlow/service/ActSarItemMeetingEOService.java index b525df00..52956a46 100644 --- a/adc-da-activiti/src/main/java/com/adc/da/workFlow/service/ActSarItemMeetingEOService.java +++ b/adc-da-activiti/src/main/java/com/adc/da/workFlow/service/ActSarItemMeetingEOService.java @@ -27,16 +27,12 @@ public class ActSarItemMeetingEOService { private static final Logger logger = LoggerFactory.getLogger(ActSarItemMeetingEOService.class); - public void processCreateMeeting(String meetingInfo) throws Exception{ - Map standMap = new HashMap<>(); - standMap = JSONObject.parseObject(meetingInfo); - if (standMap == null || standMap.isEmpty()) { + public void processCreateMeeting(String meetingInfo) { + InsideOutsideMeeting insideOutsideMeeting = JSONObject.parseObject(meetingInfo, InsideOutsideMeeting.class); + if (insideOutsideMeeting == null) { 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); + logger.info("内外部会议入库:" + insideOutsideMeeting); meetingService.addMeetingInfo(insideOutsideMeeting); } } From dc12095999fdf184c2935130fc95ded518aa9b07 Mon Sep 17 00:00:00 2001 From: wxyclub Date: Fri, 20 Oct 2023 10:04:21 +0800 Subject: [PATCH 11/31] =?UTF-8?q?bug=EF=BC=9A=E6=A0=87=E5=87=86=E6=8B=86?= =?UTF-8?q?=E5=88=86=E8=A1=A8=E6=A0=BC=E5=86=85=E5=AE=B9=E9=87=8D=E5=A4=8D?= =?UTF-8?q?=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SarFileSplitInfoEOServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/standardSplit/service/impl/SarFileSplitInfoEOServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/standardSplit/service/impl/SarFileSplitInfoEOServiceImpl.java index ffd826ef..3d7afe3e 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/standardSplit/service/impl/SarFileSplitInfoEOServiceImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/standardSplit/service/impl/SarFileSplitInfoEOServiceImpl.java @@ -686,7 +686,7 @@ public class SarFileSplitInfoEOServiceImpl implements SarFileSplitInfoEOService if (ObjectUtils.isNotEmpty(smalltext)) { switch (subscript) { case BASELINE: - xwrun.setText(smalltext); + xwrun.setText(smalltext,0); break; case SUBSCRIPT: xwrun.setText("" + smalltext + ""); From a0118d1bae2ccef78cc463b74055940f5b156642 Mon Sep 17 00:00:00 2001 From: wxyclub Date: Fri, 20 Oct 2023 17:47:24 +0800 Subject: [PATCH 12/31] =?UTF-8?q?add=EF=BC=9A=E6=94=BF=E7=AD=96=E8=AF=BE?= =?UTF-8?q?=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/SarLawsTopicController.java | 6 +- .../sarLawsTopic/entity/SarLawsTopic.java | 60 +++++++++++++++++++ .../service/SarLawsTopicService.java | 2 +- .../service/impl/SarLawsTopicServiceImpl.java | 37 +++++++++++- 4 files changed, 100 insertions(+), 5 deletions(-) diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/controller/SarLawsTopicController.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/controller/SarLawsTopicController.java index 8e69b57a..c09cfdc4 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/controller/SarLawsTopicController.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/controller/SarLawsTopicController.java @@ -31,11 +31,11 @@ public class SarLawsTopicController extends BaseController { @ApiOperation(value = "根据政策课题ID查询会议信息") @GetMapping("/getLawsTopicInfo") - public ResponseMessage getLawsTopicInfo(String lawsTopicId){ - if (StringUtils.isBlank(lawsTopicId)) { + public ResponseMessage getLawsTopicInfo(String id) throws Exception{ + if (StringUtils.isBlank(id)) { return Result.error("会议ID为空!"); } - SarLawsTopic sarLawsTopic = lawsTopicService.getLawsTopicInfo(lawsTopicId); + SarLawsTopic sarLawsTopic = lawsTopicService.getLawsTopicInfo(id); return Result.success(sarLawsTopic); } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsTopic.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsTopic.java index 9423112d..2da680e2 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsTopic.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsTopic.java @@ -80,6 +80,12 @@ public class SarLawsTopic implements Serializable { @TableField(value = "AGREEMENT") private String agreement; + /** + * 协议真实文件名 + */ + @TableField(exist = false) + private String agreementRealName; + /** * 课题组会议列表 */ @@ -92,24 +98,48 @@ public class SarLawsTopic implements Serializable { @TableField(value = "RESEARCH_PLAN") private String researchPlan; + /** + * 课题组研究方案真实文件名 + */ + @TableField(exist = false) + private String researchPlanRealName; + /** * 课题组研究成果 */ @TableField(value = "RESEARCH_FINDINGS") private String researchFindings; + /** + * 课题组研究成果真实文件名 + */ + @TableField(exist = false) + private String researchFindingsRealName; + /** * 课题组其他 */ @TableField(value = "RESEARCH_GROUP_OTHER") private String researchGroupOther; + /** + * 课题组其他真实文件名 + */ + @TableField(exist = false) + private String researchGroupOtherRealName; + /** * 课题组会议资料 */ @TableField(value = "CONFERENCE_MATERIALS") private String conferenceMaterials; + /** + * 课题组会议资料真实文件名 + */ + @TableField(exist = false) + private String conferenceMaterialsRealName; + /** * 课题组联系方式 */ @@ -122,30 +152,60 @@ public class SarLawsTopic implements Serializable { @TableField(value = "INSIDE_PROJECT_PROPOSAL_REPORT") private String insideProjectProposalRepost; + /** + * 内部资料立项报告真实文件名 + */ + @TableField(exist = false) + private String insideProjectProposalRepostRealName; + /** * 内部资料研究方案 */ @TableField(value = "INSIDE_RESEARCH_PLAN") private String insideResearchPlan; + /** + * 内部资料研究方案真实文件名 + */ + @TableField(exist = false) + private String insideResearchPlanRealName; + /** * 内部资料会议资料 */ @TableField(value = "INSIDE_CONFERENCE_MATERIALS") private String insideConferenceMaterials; + /** + * 内部资料会议资料真实文件名 + */ + @TableField(exist = false) + private String insideConferenceMaterialsRealName; + /** * 内部会议研究成果 */ @TableField(value = "INSIDE_RESEARCH_FINDINGS") private String insideResearchFindings; + /** + * 内部会议研究成果真实文件名 + */ + @TableField(exist = false) + private String insideResearchFindingsRealName; + /** * 内部会议其他 */ @TableField(value = "INSIDE_OTHER") private String insideOther; + /** + * 内部会议其他真实文件名 + */ + @TableField(exist = false) + private String insideOtherRealName; + /** * 内部联系方式 */ diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/SarLawsTopicService.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/SarLawsTopicService.java index 2d59726e..812a94e4 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/SarLawsTopicService.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/SarLawsTopicService.java @@ -13,7 +13,7 @@ import java.util.List; */ public interface SarLawsTopicService extends IService { - SarLawsTopic getLawsTopicInfo(String lawsTopicId); + SarLawsTopic getLawsTopicInfo(String lawsTopicId) throws Exception; Integer addLawsTopicInfo(SarLawsTopic lawsTopic); diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/impl/SarLawsTopicServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/impl/SarLawsTopicServiceImpl.java index f989c69a..2066a49c 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/impl/SarLawsTopicServiceImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/impl/SarLawsTopicServiceImpl.java @@ -1,5 +1,7 @@ package com.adc.da.slrs.sarLawsTopic.service.impl; +import com.adc.da.att.entity.AttFileEO; +import com.adc.da.att.service.impl.AttFileEOServiceImpl; import com.adc.da.slrs.sarLawsTopic.entity.SarLawsContactInformation; import com.adc.da.slrs.sarLawsTopic.entity.SarLawsTopicMeeting; import com.adc.da.slrs.sarLawsTopic.entity.SarLawsTopicVO; @@ -16,6 +18,8 @@ import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; import javax.annotation.Resource; +import java.lang.reflect.Method; +import java.util.ArrayList; import java.util.Arrays; import java.util.Date; import java.util.List; @@ -31,13 +35,44 @@ public class SarLawsTopicServiceImpl extends ServiceImpl aClass = sarLawsTopic.getClass(); + for (String fileField : fileFieldArray) { + fileField = fileField.substring(0,1).toUpperCase() + fileField.substring(1); + Method getMethod = aClass.getMethod("get" + fileField); + String attIds = (String) getMethod.invoke(sarLawsTopic, null); + if (StringUtils.isNotBlank(attIds)) { + String[] split = attIds.split(","); + List tempList = new ArrayList<>(); + for (String attId : split) { + AttFileEO fileInfo = attFileEOService.getFileInfo(attId); + tempList.add(fileInfo.getOldFileName()); + } + Method setMethod = aClass.getMethod("set" + fileField + "RealName", String.class); + String join = String.join(",", tempList); + System.out.println(fileField+":"+join); + setMethod.invoke(sarLawsTopic,join); + } + } + if (StringUtils.isNotBlank(sarLawsTopic.getAgreement())) { + String[] split = sarLawsTopic.getAgreement().split(","); + List tempList = new ArrayList<>(); + for (String attId : split) { + AttFileEO fileInfo = attFileEOService.getFileInfo(attId); + tempList.add(fileInfo.getOldFileName()); + } + sarLawsTopic.setAgreementRealName(StringUtils.join(tempList)); + } if (sarLawsTopic != null) { // 查询课题组会议 LambdaQueryWrapper meetingWrapper = new LambdaQueryWrapper<>(); From ec9504cc5223c3b3f07616a606c5e817c5be1ff0 Mon Sep 17 00:00:00 2001 From: wxyclub Date: Fri, 20 Oct 2023 17:48:52 +0800 Subject: [PATCH 13/31] =?UTF-8?q?add=EF=BC=9A=E5=86=85=E5=A4=96=E9=83=A8?= =?UTF-8?q?=E4=BC=9A=E8=AE=AE=E5=AF=BC=E5=87=BA=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InsideOutSideMeetingController.java | 59 +++++- .../dao/InsideOutsideMeetingDao.java | 4 + .../entity/InsideOutsideMeetingVO.java | 14 +- .../service/InsideOutsideMeetingService.java | 8 + .../impl/InsideOutsideMeetingServiceImpl.java | 137 +++++++++++++- .../adc/da/utils/util/FieldConvertUtil.java | 5 + .../util/InsideOutsideMeetingExportUtil.java | 173 ++++++++++++++++++ .../InsideOntSideMeeting.xml | 37 +++- 8 files changed, 421 insertions(+), 16 deletions(-) create mode 100644 adc-da-slrs/src/main/java/com/adc/da/utils/util/InsideOutsideMeetingExportUtil.java diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/controller/InsideOutSideMeetingController.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/controller/InsideOutSideMeetingController.java index 9123c3df..4e12d75a 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/controller/InsideOutSideMeetingController.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/controller/InsideOutSideMeetingController.java @@ -1,19 +1,33 @@ package com.adc.da.slrs.InsideOntSideMeeting.controller; +import cn.hutool.core.util.StrUtil; import com.adc.da.base.web.BaseController; +import com.adc.da.common.ReadExcel; +import com.adc.da.exception.AdcDaBaseException; 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.InsideOutsideMeetingVO; import com.adc.da.slrs.InsideOntSideMeeting.service.InsideOutsideMeetingService; +import com.adc.da.utils.util.InsideOutsideMeetingExportUtil; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.BeanUtils; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.util.IOUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.IOException; +import java.io.OutputStream; +import java.util.ArrayList; +import java.util.Arrays; import java.util.List; /** @@ -25,6 +39,8 @@ import java.util.List; @RequestMapping("/${restPath}/lawss/insideOutsideMeeting") public class InsideOutSideMeetingController extends BaseController { + private static final Logger logger = LoggerFactory.getLogger(InsideOutSideMeetingController.class); + @Resource private InsideOutsideMeetingService meetingService; @@ -71,4 +87,45 @@ public class InsideOutSideMeetingController extends BaseController exportMeetingInfo(InsideOutsideMeetingVO insideOutsideMeetingVO, HttpServletResponse response, + HttpServletRequest request) { + OutputStream os = null; + Workbook workbook = null; + List datas; + try { + if(StringUtils.isEmpty(insideOutsideMeetingVO.getExportName())||insideOutsideMeetingVO.getExportName().equals("null")){ + insideOutsideMeetingVO.setExportName("内外部会议信息"); + } + response.setHeader("Content-Disposition", + "attachment; filename=" + ReadExcel.encodeFileName(insideOutsideMeetingVO.getExportName()+".xlsx", + request)); + // 导出数据,若指定了值则使用ids字段条件导出,否则根据条件导出 + if (StrUtil.isNotBlank(insideOutsideMeetingVO.getExportIds())) { + List idList = Arrays.asList(insideOutsideMeetingVO.getExportIds().split(",")); + datas = meetingService.queryMeetingById(idList); + } else { + // 导出所有数据 + datas = meetingService.queryAllMeeting(insideOutsideMeetingVO); + } + workbook = InsideOutsideMeetingExportUtil.exportDatas(datas); + os = response.getOutputStream(); + workbook.write(os); + os.flush(); + } catch (IOException e) { + logger.error(e.getMessage(), e); + throw new AdcDaBaseException("下载文件失败,请重试"); + } finally { + IOUtils.closeQuietly(os); + } + return Result.success(); + } + + @ApiOperation("Excel文件导入内外部会议信息") + @PostMapping("/importMeetingInfo") + public ResponseMessage importMeetingInfo(@RequestParam(value = "file",required = false) MultipartFile file) { + return meetingService.importMeetingInfo(file); + } } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/dao/InsideOutsideMeetingDao.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/dao/InsideOutsideMeetingDao.java index 74487b9c..98537ae7 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/dao/InsideOutsideMeetingDao.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/dao/InsideOutsideMeetingDao.java @@ -4,6 +4,7 @@ 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; @@ -19,4 +20,7 @@ public interface InsideOutsideMeetingDao extends BaseMapper queryByPage(InsideOutsideMeetingVO page); + List queryMeetingById(@Param("exportIdList") List exportIdList); + + List queryAllMeeting(InsideOutsideMeetingVO insideOutsideMeetingVO); } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutsideMeetingVO.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutsideMeetingVO.java index 7db87388..5abc9a15 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutsideMeetingVO.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutsideMeetingVO.java @@ -1,7 +1,9 @@ package com.adc.da.slrs.InsideOntSideMeeting.entity; import com.adc.da.base.page.BasePage; +import com.baomidou.mybatisplus.annotation.TableField; import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; @@ -58,7 +60,7 @@ public class InsideOutsideMeetingVO extends BasePage { private Integer validFlag; @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") - private Date creationTime; + private Date createTime; @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") private Date modifyTime; @@ -68,4 +70,14 @@ public class InsideOutsideMeetingVO extends BasePage { private String sortMode = "asc"; private String meetingTimeOperator = "="; + + // 导出使用字段 + // 被前端选中的记录的ids + private String exportIds; + + // 从ids转换过来的id集合 + private List exportIdList; + + // 导出的文件名 + private String exportName; } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/InsideOutsideMeetingService.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/InsideOutsideMeetingService.java index 0c88446b..4235be26 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/InsideOutsideMeetingService.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/InsideOutsideMeetingService.java @@ -1,8 +1,10 @@ package com.adc.da.slrs.InsideOntSideMeeting.service; +import com.adc.da.http.ResponseMessage; import com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutsideMeeting; import com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutsideMeetingVO; import com.baomidou.mybatisplus.extension.service.IService; +import org.springframework.web.multipart.MultipartFile; import java.util.List; @@ -22,4 +24,10 @@ public interface InsideOutsideMeetingService extends IService queryAllMeeting(InsideOutsideMeetingVO insideOutsideMeetingVO); + + List queryMeetingById(List exportIdList); + + ResponseMessage importMeetingInfo(MultipartFile file); } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/impl/InsideOutsideMeetingServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/impl/InsideOutsideMeetingServiceImpl.java index 473cb233..f5b79b96 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/impl/InsideOutsideMeetingServiceImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/impl/InsideOutsideMeetingServiceImpl.java @@ -1,23 +1,34 @@ package com.adc.da.slrs.InsideOntSideMeeting.service.impl; +import com.adc.da.common.FileUnZip; +import com.adc.da.http.ResponseMessage; +import com.adc.da.http.Result; import com.adc.da.slrs.InsideOntSideMeeting.dao.InsideOutsideMeetingDao; 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.adc.da.utils.util.FieldConvertUtil; 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.lang.WordUtils; +import org.apache.commons.io.FileUtils; import org.apache.commons.lang3.StringUtils; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.ss.usermodel.WorkbookFactory; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; -import java.util.Arrays; -import java.util.Date; -import java.util.List; +import java.io.File; +import java.io.IOException; +import java.text.SimpleDateFormat; +import java.util.*; /** * @author tjzdw @@ -30,6 +41,9 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl queryAllMeeting(InsideOutsideMeetingVO insideOutsideMeetingVO) { + return this.baseMapper.queryAllMeeting(insideOutsideMeetingVO); + } + + @Override + public List queryMeetingById(List exportIdList) { + return this.baseMapper.queryMeetingById(exportIdList); + } + @Transactional @Override public Integer addMeetingInfo(InsideOutsideMeeting insideOutSideMeeting) { @@ -120,4 +144,109 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl importMeetingInfo(MultipartFile file) { + //给出头部信息 + String[] headerExcel = (FieldConvertUtil.exportFieldNamesInsideOutsideMeeting + "," + FieldConvertUtil.exportFieldNamesMeetingTopic).split(","); + //获取文件全称 + String fileNameStr = file.getOriginalFilename(); + //获取最后.的位置 + int pos = fileNameStr.lastIndexOf("."); + //获取压缩文件名称并以小写显示 + String fileStr = fileNameStr.substring(pos + 1).toLowerCase(); + //校验是否是zip文件 + if (!fileStr.equals("zip")) { + return Result.error("请上传zip格式的文件"); + } + //进行拼接获取文件名称 + String fileName = fileNameStr.substring(0, pos); + //获取路径和文件名称 + String path = filePath + "/" + fileName; + + File saveDirectory = new File(path); + //判断saveDirectory中是否是文件夹 + if (!saveDirectory.isDirectory()) { + saveDirectory.mkdir(); + } + //将文件写入到指定路径中 + try { + FileUtils.copyInputStreamToFile(file.getInputStream(), new File(path + "/" + fileNameStr)); + } catch (IOException e) { + return Result.error("文件存储失败!"); + } + int countSuccess = 0; + //解压缩 + String zipEntryName = null; + try { + zipEntryName = FileUnZip.unZipFiles(path + "/" + fileNameStr, path); + } catch (IOException e) { + return Result.error("文件解压失败"); + } + //获取文件信息 + List fileList = readImpExcelFile(zipEntryName); + //判断获取到的文件数量 + if (fileList.size() != 1) { + return Result.error("上传的文件只能有一个"); + } + File importFile = fileList.get(0); + if (!importFile.getName().contains(".xls") || !importFile.getName().contains(".xlsx")) { + return Result.error("文件必须是EXCEL文件"); + } + Workbook workbook = null; + try { + workbook = WorkbookFactory.create(importFile); + } catch (IOException e) { + FileUnZip.deleteDir(saveDirectory); + return Result.error("导入失败,需要导入的数据有问题或导入的企标标号和企标名称已存在"); + } + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + Sheet sheet = workbook.getSheetAt(0); + if (sheet == null) { + return Result.error("工作表为空"); + } + StringBuilder sb = new StringBuilder(); + // 获取excel表头 + Row headerRow = sheet.getRow(1); + for (int i = 0; i <= 25; i++) { + sb.append(headerRow.getCell(i).getStringCellValue()).append(","); + } + //获取总条数 + int rowNum = sheet.getPhysicalNumberOfRows(); + // 开始遍历表格行 + for (int rowIndex = 1; rowIndex < rowNum; rowIndex++) { + Row row = sheet.getRow(rowIndex); + String fields = StringUtils.join(headerExcel); + if (!fields.equals(FieldConvertUtil.exportFieldNamesInsideOutsideMeeting + "," + FieldConvertUtil.exportFieldNamesMeetingTopic)) { + try { + workbook.close(); + } catch (IOException e) { + return Result.error("文件关闭出错"); + } + //删除原上传文件 + FileUnZip.deleteDir(saveDirectory); + return Result.error("fail", "读取失败,请严格按照模板文件导入数据"); + } + Map rowList = new LinkedHashMap<>(); + // TODO 内外部会议导入 + } + return null; + } + + private static List readImpExcelFile(String path) { + File file = new File(path); + List resultlist = new ArrayList<>(); + if (file.isDirectory()) { + File[] files = file.listFiles(); + for (File fi : files) { + // 对文件进行过滤,读取所有文件 + String name = fi.getName(); + //文件不为空 添加 + if (name != null){ + resultlist.add(fi); + } + } + } + return resultlist; + } } diff --git a/adc-da-slrs/src/main/java/com/adc/da/utils/util/FieldConvertUtil.java b/adc-da-slrs/src/main/java/com/adc/da/utils/util/FieldConvertUtil.java index d19f602b..8aa7f09b 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/utils/util/FieldConvertUtil.java +++ b/adc-da-slrs/src/main/java/com/adc/da/utils/util/FieldConvertUtil.java @@ -58,6 +58,11 @@ public class FieldConvertUtil { // 企标计划 表头 public static String exportFieldNamesEsRevisePlan = "企标类别,企标编号,企标名称,计划状态,制修订类型,起草人,内部评审责任人,技术委员会评审负责人,计划标准初稿完成时间,计划标准发布时间,起草责任单位,实际标准发布时间,质量评分"; + // 内外部会议 表头 + public static String exportFieldNamesInsideOutsideMeeting = "会议名称,课题名称,会议主办单位,会议时间,会议地点,参会人员,会议主要内容,一级会议类别,二级会议类别"; + // 内外部会议关联表 表头 + public static String exportFieldNamesMeetingTopic = "议题名称,汇报人,汇报单位,议题主要内容"; + public static String exportBaseFieldNamesBussCode = "起草部门,废止日期,代替企标编号,复审日期,起草人,被代替企标编号,采用标准,文件上传人员,采标程度,引用标准,适用车型,能源类型,适用产品线,上传时间,体系类别,备案日期,关联模块-乘用车VPPS编码,关联模块--乘用车vpps中文名称,关联模块--卡车VPPS编码,关联模块--卡车vpps中文名称"; public static String exportAttrFieldNamesBuss = "SVPPS,规范性引用文件,废止日期,复审日期,密级,授权,相关部门," + diff --git a/adc-da-slrs/src/main/java/com/adc/da/utils/util/InsideOutsideMeetingExportUtil.java b/adc-da-slrs/src/main/java/com/adc/da/utils/util/InsideOutsideMeetingExportUtil.java new file mode 100644 index 00000000..cd5ad4dc --- /dev/null +++ b/adc-da-slrs/src/main/java/com/adc/da/utils/util/InsideOutsideMeetingExportUtil.java @@ -0,0 +1,173 @@ +package com.adc.da.utils.util; + +import com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutsideMeetingVO; +import com.adc.da.slrs.InsideOntSideMeeting.entity.MeetingTopic; +import org.apache.commons.lang.StringUtils; +import org.apache.poi.ss.usermodel.*; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +import java.text.SimpleDateFormat; +import java.util.List; + +/** + * @author tjzdw + * @description + * @date 2023/10/20 + */ +public class InsideOutsideMeetingExportUtil { + + private static final Logger logger = LoggerFactory.getLogger(InsideOutsideMeetingExportUtil.class); + + + public static Workbook exportDatas(List datas) { + Workbook workbook = new XSSFWorkbook(); + try { + //定义表头 + String header = FieldConvertUtil.exportFieldNamesInsideOutsideMeeting + "," + FieldConvertUtil.exportFieldNamesMeetingTopic; + //创建工作表对象 + Sheet sheet = workbook.createSheet(); + // 创建头部 + createHeader(workbook, sheet, header); + // 创建数据 + createDatas(workbook, sheet, datas, header); + } catch (Exception e) { + logger.error(e.getMessage(), e); + } + return workbook; + } + + public static void createHeader(Workbook workbook, Sheet sheet, String header) { + CellStyle cellStyle = workbook.createCellStyle();//初始化单元格格式对象 + cellStyle.setAlignment(HorizontalAlignment.CENTER); + Row rowHeader = sheet.createRow(0);//开始创建标题行 + if (StringUtils.isNotBlank(header)) { + String[] headerArr = header.split(","); + for (int i = 0; i < headerArr.length; i++) { + rowHeader.createCell(i).setCellValue(headerArr[i]); + } + } + } + + public static void createDatas(Workbook workbook, Sheet sheet, List datas, + String header) throws Exception { + String[] insideOutsideMeetingHeaderList = FieldConvertUtil.exportFieldNamesInsideOutsideMeeting.split(","); + String[] meetingTopicHeaderList = FieldConvertUtil.exportFieldNamesMeetingTopic.split(","); + CellStyle cellStyle = workbook.createCellStyle();//初始化单元格格式对象 + cellStyle.setAlignment(HorizontalAlignment.CENTER); + if (datas != null && !datas.isEmpty()) { + int rowIndex = 1; + for (InsideOutsideMeetingVO data : datas) { + String[] headerArr = header.split(","); + Row row = sheet.createRow(rowIndex); + int cellIndex = 0; + if (data.getMeetingTopicList().isEmpty()) { + for (String headerName : headerArr) { + String value = getValueByName(headerName, data); + if (StringUtils.isBlank(value) || "null".equals(value)) { + value = ""; + } + row.createCell(cellIndex).setCellValue(value); + cellIndex++; + } + } else { + for (String headerName : insideOutsideMeetingHeaderList) { + String value = getValueByName(headerName, data); + if (StringUtils.isBlank(value) || "null".equals(value)) { + value = ""; + } + row.createCell(cellIndex).setCellValue(value); + cellIndex++; + } + int newCellIndex = cellIndex; + for (String field : meetingTopicHeaderList) { + String topicValue = getMeetingTopicValueByName(field, data.getMeetingTopicList().get(0)); + if (StringUtils.isBlank(topicValue) || "null".equals(topicValue)) { + topicValue = ""; + } + row.createCell(cellIndex).setCellValue(topicValue); + cellIndex++; + } + rowIndex++; + for (int index = 1; index < data.getMeetingTopicList().size(); index++) { + Row newRow = sheet.createRow(rowIndex); + for (String field : meetingTopicHeaderList) { + String topicValue = getMeetingTopicValueByName(field, data.getMeetingTopicList().get(index)); + if (StringUtils.isBlank(topicValue) || "null".equals(topicValue)) { + topicValue = ""; + } + newRow.createCell(newCellIndex).setCellValue(topicValue); + newCellIndex++; + } + rowIndex++; + } + } + } + } + } + + // 根据表头返回相应值 + public static String getValueByName(String name, InsideOutsideMeetingVO insideOutsideMeeting) throws Exception{ + String value = ""; + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + switch (name) { + case "会议名称": + value = insideOutsideMeeting.getMeetingName(); + break; + case "课题名称": + value = insideOutsideMeeting.getTopicName(); + break; + case "会议主办单位": + value = insideOutsideMeeting.getMeetingOrganizer(); + break; + case "会议时间": + String meetingTime = null; + if (insideOutsideMeeting.getMeetingTime() != null){ + meetingTime = sdf.format(insideOutsideMeeting.getMeetingTime()); + } + value = meetingTime; + break; + case "会议地点": + value = insideOutsideMeeting.getMeetingAddress(); + break; + case "参会人员": + value = insideOutsideMeeting.getParticipants(); + break; + case "会议主要内容": + value = insideOutsideMeeting.getMeetingContent(); + break; + case "一级会议类别": + value = insideOutsideMeeting.getFirstMeetingType(); + break; + case "二级会议类别": + value = insideOutsideMeeting.getSecondMeetingType(); + break; + default: + value = null; + break; + } + return value; + } + public static String getMeetingTopicValueByName (String name, MeetingTopic meetingTopic) { + String value = ""; + switch (name) { + case "议题名称": + value = meetingTopic.getAgendaName(); + break; + case "汇报人": + value = meetingTopic.getReporter(); + break; + case "汇报单位": + value = meetingTopic.getReportingUnit(); + break; + case "议题主要内容": + value = meetingTopic.getAgendaContent(); + break; + default: + value = null; + break; + } + return value; + } +} diff --git a/adc-da-slrs/src/main/resources/mybatis/mapper/InsideOntSideMeeting/InsideOntSideMeeting.xml b/adc-da-slrs/src/main/resources/mybatis/mapper/InsideOntSideMeeting/InsideOntSideMeeting.xml index 890f9489..fe46192a 100644 --- a/adc-da-slrs/src/main/resources/mybatis/mapper/InsideOntSideMeeting/InsideOntSideMeeting.xml +++ b/adc-da-slrs/src/main/resources/mybatis/mapper/InsideOntSideMeeting/InsideOntSideMeeting.xml @@ -3,7 +3,7 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -19,7 +19,7 @@ - + @@ -38,7 +38,7 @@ iom.ID,iom.MEETING_NAME,iom.TOPIC_NAME,iom.MEETING_ORGANIZER,iom.MEETING_TIME,iom.MEETING_ADDRESS, iom.PARTICIPANTS,iom.MEETING_MINUTES,iom.MEETING_CONTENT,iom.FIRST_MEETING_TYPE,iom.SECOND_MEETING_TYPE, - mt.ID,mt.MEETING_ID,mt.AGENDA_NAME,mt.AGENDA_MATERIALS,mt.REPORTER,mt.REPORTING_UNIT, + mt.ID as mtId,mt.MEETING_ID,mt.AGENDA_NAME,mt.AGENDA_MATERIALS,mt.REPORTER,mt.REPORTING_UNIT, mt.AGENDA_CONTENT,mt.VALID_FLAG,mt.CREATE_TIME,mt.MODIFY_TIME, iom.VALID_FLAG,iom.CREATE_TIME,iom.MODIFY_TIME @@ -104,13 +104,30 @@ order by - - mt.${sortField} ${sortMode} - - - iom.${sortField} ${sortMode} - - + + mt.${sortField} ${sortMode} + + + iom.${sortField} ${sortMode} + + limit ${pager.startIndex-1},${pageSize} + + \ No newline at end of file From 8c5b776778e75ac08fceab9beb82651a0648b50c Mon Sep 17 00:00:00 2001 From: wxyclub Date: Mon, 23 Oct 2023 09:09:41 +0800 Subject: [PATCH 14/31] =?UTF-8?q?add=EF=BC=9A=E6=94=BF=E7=AD=96=E8=AF=BE?= =?UTF-8?q?=E9=A2=98=E6=9F=A5=E8=AF=A2=E5=8D=95=E4=B8=AA=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../sarLawsTopic/entity/SarLawsTopic.java | 20 ++++---- .../service/impl/SarLawsTopicServiceImpl.java | 47 +++++++------------ 2 files changed, 28 insertions(+), 39 deletions(-) diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsTopic.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsTopic.java index 2da680e2..14dc22c4 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsTopic.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsTopic.java @@ -84,7 +84,7 @@ public class SarLawsTopic implements Serializable { * 协议真实文件名 */ @TableField(exist = false) - private String agreementRealName; + private String agreementName; /** * 课题组会议列表 @@ -102,7 +102,7 @@ public class SarLawsTopic implements Serializable { * 课题组研究方案真实文件名 */ @TableField(exist = false) - private String researchPlanRealName; + private String researchPlanName; /** * 课题组研究成果 @@ -114,7 +114,7 @@ public class SarLawsTopic implements Serializable { * 课题组研究成果真实文件名 */ @TableField(exist = false) - private String researchFindingsRealName; + private String researchFindingsName; /** * 课题组其他 @@ -126,7 +126,7 @@ public class SarLawsTopic implements Serializable { * 课题组其他真实文件名 */ @TableField(exist = false) - private String researchGroupOtherRealName; + private String researchGroupOtherName; /** * 课题组会议资料 @@ -138,7 +138,7 @@ public class SarLawsTopic implements Serializable { * 课题组会议资料真实文件名 */ @TableField(exist = false) - private String conferenceMaterialsRealName; + private String conferenceMaterialsName; /** * 课题组联系方式 @@ -156,7 +156,7 @@ public class SarLawsTopic implements Serializable { * 内部资料立项报告真实文件名 */ @TableField(exist = false) - private String insideProjectProposalRepostRealName; + private String insideProjectProposalRepostName; /** * 内部资料研究方案 @@ -168,7 +168,7 @@ public class SarLawsTopic implements Serializable { * 内部资料研究方案真实文件名 */ @TableField(exist = false) - private String insideResearchPlanRealName; + private String insideResearchPlanName; /** * 内部资料会议资料 @@ -180,7 +180,7 @@ public class SarLawsTopic implements Serializable { * 内部资料会议资料真实文件名 */ @TableField(exist = false) - private String insideConferenceMaterialsRealName; + private String insideConferenceMaterialsName; /** * 内部会议研究成果 @@ -192,7 +192,7 @@ public class SarLawsTopic implements Serializable { * 内部会议研究成果真实文件名 */ @TableField(exist = false) - private String insideResearchFindingsRealName; + private String insideResearchFindingsName; /** * 内部会议其他 @@ -204,7 +204,7 @@ public class SarLawsTopic implements Serializable { * 内部会议其他真实文件名 */ @TableField(exist = false) - private String insideOtherRealName; + private String insideOtherName; /** * 内部联系方式 diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/impl/SarLawsTopicServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/impl/SarLawsTopicServiceImpl.java index 2066a49c..b83ad93f 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/impl/SarLawsTopicServiceImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/impl/SarLawsTopicServiceImpl.java @@ -58,40 +58,29 @@ public class SarLawsTopicServiceImpl extends ServiceImpl tempList = new ArrayList<>(); - for (String attId : split) { - AttFileEO fileInfo = attFileEOService.getFileInfo(attId); - tempList.add(fileInfo.getOldFileName()); - } - sarLawsTopic.setAgreementRealName(StringUtils.join(tempList)); - } - if (sarLawsTopic != null) { - // 查询课题组会议 - LambdaQueryWrapper meetingWrapper = new LambdaQueryWrapper<>(); - meetingWrapper.eq(SarLawsTopicMeeting::getLawsTopicId, lawsTopicId); - List topicMeetingList = meetingService.list(meetingWrapper); - sarLawsTopic.setMeetingList(topicMeetingList); - // 查询课题组联系方式 - LambdaQueryWrapper topicGroupWrapper = new LambdaQueryWrapper<>(); - topicGroupWrapper.eq(SarLawsContactInformation::getLawsTopicId, lawsTopicId); - topicGroupWrapper.eq(SarLawsContactInformation::getGroupType,"lawsTopic"); - List lawsTopicContactInformation = contactInformationService.list(topicGroupWrapper); - sarLawsTopic.setTopicContactInformationList(lawsTopicContactInformation); - // 查询内部联系房方式 - LambdaQueryWrapper insideWrapper = new LambdaQueryWrapper<>(); - topicGroupWrapper.eq(SarLawsContactInformation::getLawsTopicId, lawsTopicId); - topicGroupWrapper.eq(SarLawsContactInformation::getGroupType,"lawsTopic"); - List insideContactInformation = contactInformationService.list(topicGroupWrapper); - sarLawsTopic.setInsideContactInformationList(insideContactInformation); - } + // 查询课题组会议 + LambdaQueryWrapper meetingWrapper = new LambdaQueryWrapper<>(); + meetingWrapper.eq(SarLawsTopicMeeting::getLawsTopicId, lawsTopicId); + List topicMeetingList = meetingService.list(meetingWrapper); + sarLawsTopic.setMeetingList(topicMeetingList); + // 查询课题组联系方式 + LambdaQueryWrapper topicGroupWrapper = new LambdaQueryWrapper<>(); + topicGroupWrapper.eq(SarLawsContactInformation::getLawsTopicId, lawsTopicId); + topicGroupWrapper.eq(SarLawsContactInformation::getGroupType,"lawsTopic"); + List lawsTopicContactInformation = contactInformationService.list(topicGroupWrapper); + sarLawsTopic.setTopicContactInformationList(lawsTopicContactInformation); + // 查询内部联系房方式 + LambdaQueryWrapper insideWrapper = new LambdaQueryWrapper<>(); + topicGroupWrapper.eq(SarLawsContactInformation::getLawsTopicId, lawsTopicId); + topicGroupWrapper.eq(SarLawsContactInformation::getGroupType,"lawsTopic"); + List insideContactInformation = contactInformationService.list(topicGroupWrapper); + sarLawsTopic.setInsideContactInformationList(insideContactInformation); return sarLawsTopic; } From bdcf7fabceed05f8bf3aae4eca82202845337f98 Mon Sep 17 00:00:00 2001 From: wxyclub Date: Mon, 23 Oct 2023 16:26:33 +0800 Subject: [PATCH 15/31] =?UTF-8?q?add=EF=BC=9A=E6=94=BF=E7=AD=96=E8=B5=84?= =?UTF-8?q?=E6=96=99=E4=B8=AD=E5=BF=83=E6=A8=A1=E5=9D=97?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SarLawsInformationController.java | 72 ++++++++ .../dao/SarLawsInformationDao.java | 25 +++ .../entity/SarLawsInformation.java | 160 ++++++++++++++++++ .../service/SarLawsInformationService.java | 24 +++ .../impl/SarLawsInformationServiceImpl.java | 92 ++++++++++ ...arLawsInformationCenterTreeController.java | 56 ++++++ .../dao/SarLawsInformationCenterTreeDao.java | 18 ++ .../entity/SarLawsInformationCenterTree.java | 46 +++++ .../SarLawsInformationCenterTreeData.java | 40 +++++ .../SarLawsInformationCenterTreeService.java | 25 +++ ...rLawsInformationCenterTreeServiceImpl.java | 142 ++++++++++++++++ .../service/impl/SarLawsTopicServiceImpl.java | 2 - .../SarLawsInformationMapper.xml | 66 ++++++++ .../SarLawsInformationCenterTreeMapper.xml | 18 ++ 14 files changed, 784 insertions(+), 2 deletions(-) create mode 100644 adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/controller/SarLawsInformationController.java create mode 100644 adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/dao/SarLawsInformationDao.java create mode 100644 adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/entity/SarLawsInformation.java create mode 100644 adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/SarLawsInformationService.java create mode 100644 adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/impl/SarLawsInformationServiceImpl.java create mode 100644 adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformationCenterTree/controller/SarLawsInformationCenterTreeController.java create mode 100644 adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformationCenterTree/dao/SarLawsInformationCenterTreeDao.java create mode 100644 adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformationCenterTree/entity/SarLawsInformationCenterTree.java create mode 100644 adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformationCenterTree/entity/SarLawsInformationCenterTreeData.java create mode 100644 adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformationCenterTree/service/SarLawsInformationCenterTreeService.java create mode 100644 adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformationCenterTree/service/impl/SarLawsInformationCenterTreeServiceImpl.java create mode 100644 adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsInformation/SarLawsInformationMapper.xml create mode 100644 adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsInformationCenterTree/SarLawsInformationCenterTreeMapper.xml diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/controller/SarLawsInformationController.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/controller/SarLawsInformationController.java new file mode 100644 index 00000000..7ef30d82 --- /dev/null +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/controller/SarLawsInformationController.java @@ -0,0 +1,72 @@ +package com.adc.da.slrs.sarLawsInformation.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.sarLawsInformation.entity.SarLawsInformation; +import com.adc.da.slrs.sarLawsInformation.service.SarLawsInformationService; +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/23 + */ +@RestController +@RequestMapping("/${restPath}/lawss/sarLawsInformation") +public class SarLawsInformationController extends BaseController { + + @Resource + private SarLawsInformationService informationService; + + @ApiOperation(value = "根据政策资料ID查询资料信息") + @GetMapping("/getLawsInformationInfo") + public ResponseMessage getLawsInformationInfo(String id){ + if (StringUtils.isBlank(id)) { + return Result.error("会议ID为空!"); + } + SarLawsInformation sarLawsInformation = informationService.getLawsInformationInfo(id); + return Result.success(sarLawsInformation); + } + + @ApiOperation(value = "分页查询") + @GetMapping("/page") + public ResponseMessage> page(SarLawsInformation sarLawsInformation) { + List rows = informationService.queryByPage(sarLawsInformation); + return Result.success(getPageInfo(sarLawsInformation.getPager(), rows)); + } + + @ApiOperation(value = "新增政策资料") + @PostMapping(value = "/addLawsInformation", consumes = "application/json;charset=UTF-8") + public ResponseMessage create(@RequestBody SarLawsInformation sarLawsInformation) throws Exception { + informationService.addLawsInformation(sarLawsInformation); + return Result.success(); + } + + @ApiOperation("根据资料ID删除资料信息") + @DeleteMapping("/deleteLawsInformation") + public ResponseMessage deleteInformation(String id) { + if (StringUtils.isBlank(id)) { + return Result.error("删除失败,政策资料ID为空"); + } + informationService.deleteInformation(id); + return Result.success(); + } + + @ApiOperation("根据资料ID修改政策资料信息") + @PutMapping("/updateLawsInformationInfo") + public ResponseMessage updateLawsInformationInfo(@RequestBody SarLawsInformation lawsInformation) { + if (ObjectUtils.isEmpty(lawsInformation)) { + return Result.error("更新失败,政策资料信息不存在"); + } + Boolean updateResult = informationService.updateLawsInformationInfo(lawsInformation); + return updateResult ? Result.success() : Result.error("更新失败"); + } +} diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/dao/SarLawsInformationDao.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/dao/SarLawsInformationDao.java new file mode 100644 index 00000000..337149b8 --- /dev/null +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/dao/SarLawsInformationDao.java @@ -0,0 +1,25 @@ +package com.adc.da.slrs.sarLawsInformation.dao; + +import com.adc.da.slrs.sarLawsInformation.entity.SarLawsInformation; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.Mapper; + +import java.util.List; + +/** +* @author tjzdw +* @description 针对表【sar_laws_information】的数据库操作Mapper +* @createDate 2023-10-23 09:41:56 +* @Entity com.adc.da.slrs.sarLawsInformation.entity.SarLawsInformation +*/ +@Mapper +public interface SarLawsInformationDao extends BaseMapper { + + Integer queryByPageCount(SarLawsInformation page); + + List queryByPage(SarLawsInformation page); +} + + + + diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/entity/SarLawsInformation.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/entity/SarLawsInformation.java new file mode 100644 index 00000000..8c21cbc3 --- /dev/null +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/entity/SarLawsInformation.java @@ -0,0 +1,160 @@ +package com.adc.da.slrs.sarLawsInformation.entity; + +import com.adc.da.base.page.BasePage; +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; +import lombok.EqualsAndHashCode; +import lombok.experimental.Accessors; +import org.springframework.format.annotation.DateTimeFormat; + +/** + * + * @TableName sar_laws_information + */ +@TableName(value ="sar_laws_information") +@EqualsAndHashCode(callSuper = true) +@Accessors(chain = true) +@Data +public class SarLawsInformation extends BasePage implements Serializable { + /** + * 主键 + */ + @TableId(value = "ID", type = IdType.ID_WORKER_STR) + private String id; + + /** + * 一级资料类别 + */ + @TableField(value = "FIRST_TYPE") + private String firstType; + + /** + * 二级资料类别 + */ + @TableField(value = "SECOND_TYPE") + private String secondType; + + /** + * 三级资料类别 + */ + @TableField(value = "THIRD_TYPE") + private String thirdType; + + /** + * 四级资料类别 + */ + @TableField(value = "FOURTH_TYPE") + private String fourthType; + + /** + * 资料名称 + */ + @TableField(value = "NAME") + private String name; + + /** + * 资料归属部门 + */ + @TableField(value = "DEPARTMENT") + private String department; + + /** + * 作者 + */ + @TableField(value = "AUTHOR") + private String author; + + /** + * 上传时间 + */ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @TableField(value = "UPLOAD_TIME") + private Date uploadTime; + + /** + * 资料说明 + */ + @TableField(value = "DESCRIPTION") + private String description; + + /** + * 资料文件 + */ + @TableField(value = "INFORMATION_FILE") + private String informationFile; + + /** + * 资料文件名称 + */ + @TableField(exist = false) + private String informationFileName; + + /** + * 可查看者,若设置为空则仅有上传人和审批人可以查看,若设置人员后,仅有可查看者可查看文件信息。 + */ + @TableField(value = "VIEWABLE_BY") + private String viewableBy; + + /** + * 可下载者,若设置为空则所有用户均可下载,若设置人员后,仅有可下载者可以下载文件信息。 + */ + @TableField(value = "DOWNLOADABLE_BY") + private String downloadableBy; + + /** + * 树节点ID + */ + private String treeNodeId; + + /** + * 树节点名称 + */ + @TableField(exist = false) + private String treeNodeName; + + /** + * 逻辑删除,0可用,1不可用 + */ + @TableField(value = "VALID_FLAG") + private Integer validFlag; + + /** + * 创建时间 + */ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @TableField(value = "CREATE_TIME") + private Date createTime; + + /** + * 修改时间 + */ + @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") + @DateTimeFormat(pattern = "yyyy-MM-dd") + @TableField(value = "MODIFY_TIME") + private Date modifyTime; + + + /** + * 排序字段 + */ + @TableField(exist = false) + private String sortField = "ID"; + + /** + * 排序方式 + */ + @TableField(exist = false) + private String sortMode = "asc"; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/SarLawsInformationService.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/SarLawsInformationService.java new file mode 100644 index 00000000..e8797d2c --- /dev/null +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/SarLawsInformationService.java @@ -0,0 +1,24 @@ +package com.adc.da.slrs.sarLawsInformation.service; + +import com.adc.da.slrs.sarLawsInformation.entity.SarLawsInformation; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +/** +* @author tjzdw +* @description 针对表【sar_laws_information】的数据库操作Service +* @createDate 2023-10-23 09:41:56 +*/ +public interface SarLawsInformationService extends IService { + + SarLawsInformation getLawsInformationInfo(String id); + + List queryByPage(SarLawsInformation sarLawsInformation); + + Integer addLawsInformation(SarLawsInformation sarLawsInformation); + + Boolean deleteInformation(String id); + + Boolean updateLawsInformationInfo(SarLawsInformation lawsInformation); +} diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/impl/SarLawsInformationServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/impl/SarLawsInformationServiceImpl.java new file mode 100644 index 00000000..430dfb5f --- /dev/null +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/impl/SarLawsInformationServiceImpl.java @@ -0,0 +1,92 @@ +package com.adc.da.slrs.sarLawsInformation.service.impl; + +import com.adc.da.slrs.sarLawsInformationCenterTree.entity.SarLawsInformationCenterTree; +import com.adc.da.slrs.sarLawsInformationCenterTree.service.SarLawsInformationCenterTreeService; +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.sarLawsInformation.entity.SarLawsInformation; +import com.adc.da.slrs.sarLawsInformation.service.SarLawsInformationService; +import com.adc.da.slrs.sarLawsInformation.dao.SarLawsInformationDao; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.List; + +/** +* @author tjzdw +* @description 针对表【sar_laws_information】的数据库操作Service实现 +* @createDate 2023-10-23 09:41:56 +*/ +@Service +public class SarLawsInformationServiceImpl extends ServiceImpl + implements SarLawsInformationService{ + + @Resource + private SarLawsInformationCenterTreeService treeService; + + @Override + public SarLawsInformation getLawsInformationInfo(String id) { + SarLawsInformation sarLawsInformation = this.baseMapper.selectById(id); + if (StringUtils.isNotBlank(sarLawsInformation.getTreeNodeId())) { + SarLawsInformationCenterTree treeNode = treeService.getById(sarLawsInformation.getTreeNodeId()); + sarLawsInformation.setTreeNodeName(treeNode.getName()); + } + return sarLawsInformation; + } + + @Override + public List queryByPage(SarLawsInformation page) { + // 设置排序字段 + 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); + } + + @Override + public Integer addLawsInformation(SarLawsInformation sarLawsInformation) { + sarLawsInformation.setCreateTime(new Date()); + sarLawsInformation.setModifyTime(new Date()); + sarLawsInformation.setValidFlag(0); + // 若体系类别不存在,则默认属于根节点 + if (StringUtils.isBlank(sarLawsInformation.getTreeNodeId())) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.isNull(SarLawsInformationCenterTree::getPId); + SarLawsInformationCenterTree one = treeService.getOne(wrapper); + sarLawsInformation.setTreeNodeId(one.getId()); + } + return this.baseMapper.insert(sarLawsInformation); + } + + @Override + public Boolean deleteInformation(String id) { + LambdaUpdateWrapper wrapper = new LambdaUpdateWrapper<>(); + wrapper.eq(SarLawsInformation::getId, id); + wrapper.set(SarLawsInformation::getValidFlag,1); + wrapper.set(SarLawsInformation::getModifyTime,new Date()); + return update(wrapper); + } + + @Override + public Boolean updateLawsInformationInfo(SarLawsInformation lawsInformation) { + if (StringUtils.isBlank(lawsInformation.getId())) { + return false; + } + lawsInformation.setModifyTime(new Date()); + int update = this.baseMapper.updateById(lawsInformation); + return true; + } +} + + + + diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformationCenterTree/controller/SarLawsInformationCenterTreeController.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformationCenterTree/controller/SarLawsInformationCenterTreeController.java new file mode 100644 index 00000000..d6f62589 --- /dev/null +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformationCenterTree/controller/SarLawsInformationCenterTreeController.java @@ -0,0 +1,56 @@ +package com.adc.da.slrs.sarLawsInformationCenterTree.controller; + +import com.adc.da.base.web.BaseController; +import com.adc.da.http.ResponseMessage; +import com.adc.da.http.Result; +import com.adc.da.slrs.sarLawsInformationCenterTree.entity.SarLawsInformationCenterTree; +import com.adc.da.slrs.sarLawsInformationCenterTree.entity.SarLawsInformationCenterTreeData; +import com.adc.da.slrs.sarLawsInformationCenterTree.service.SarLawsInformationCenterTreeService; +import io.swagger.annotations.ApiOperation; +import org.springframework.web.bind.annotation.*; + +import javax.annotation.Resource; +import java.util.List; + +/** + * @author tjzdw + * @description + * @date 2023/10/23 + */ +@RestController +@RequestMapping("/${restPath}/lawss/sarLawsInformation/tree") +public class SarLawsInformationCenterTreeController extends BaseController { + + @Resource + private SarLawsInformationCenterTreeService informationCenterTreeService; + + @ApiOperation("新增资料中心左侧树节点") + @PostMapping("/addTreeNode") + public ResponseMessage addTreeNode(@RequestBody SarLawsInformationCenterTree informationCenterTree){ + informationCenterTreeService.addTreeNode(informationCenterTree); + return Result.success(); + } + + @ApiOperation("删除树节点") + @DeleteMapping("/deleteTreeNode") + public ResponseMessage deleteTreeNode(String id){ + Boolean aBoolean = informationCenterTreeService.deleteTreeNode(id); + return aBoolean ? Result.success("删除成功") : Result.error("节点下存在数据无法删除。"); + } + + + @ApiOperation("查询树结构") + @GetMapping("/getTree") + public ResponseMessage> getTree(){ + List informationCenterTreeList = informationCenterTreeService.getTree(); + return Result.success(informationCenterTreeList); + } + + @ApiOperation("修改树节点") + @PutMapping("/updateTreeNode") + public ResponseMessage updateTreeNode(@RequestBody SarLawsInformationCenterTree informationCenterTree){ + boolean b = informationCenterTreeService.updateTreeNode(informationCenterTree); + return Result.success("修改成功"); + } + +} diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformationCenterTree/dao/SarLawsInformationCenterTreeDao.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformationCenterTree/dao/SarLawsInformationCenterTreeDao.java new file mode 100644 index 00000000..38aaf162 --- /dev/null +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformationCenterTree/dao/SarLawsInformationCenterTreeDao.java @@ -0,0 +1,18 @@ +package com.adc.da.slrs.sarLawsInformationCenterTree.dao; + +import com.adc.da.slrs.sarLawsInformationCenterTree.entity.SarLawsInformationCenterTree; +import com.baomidou.mybatisplus.core.mapper.BaseMapper; + +/** +* @author tjzdw +* @description 针对表【sar_laws_information_center_tree】的数据库操作Mapper +* @createDate 2023-10-23 11:20:26 +* @Entity com.adc.da.slrs.sarLawsInformationCenterTree.entity.SarLawsInformationCenterTree +*/ +public interface SarLawsInformationCenterTreeDao extends BaseMapper { + +} + + + + diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformationCenterTree/entity/SarLawsInformationCenterTree.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformationCenterTree/entity/SarLawsInformationCenterTree.java new file mode 100644 index 00000000..e630d31b --- /dev/null +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformationCenterTree/entity/SarLawsInformationCenterTree.java @@ -0,0 +1,46 @@ +package com.adc.da.slrs.sarLawsInformationCenterTree.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 com.fasterxml.jackson.annotation.JsonProperty; +import lombok.Data; + +/** + * + * @TableName sar_laws_information_center_tree + */ +@TableName(value ="sar_laws_information_center_tree") +@Data +public class SarLawsInformationCenterTree implements Serializable { + /** + * 主键 + */ + @TableId(value = "id", type = IdType.ID_WORKER_STR) + private String id; + + /** + * 父ID + */ + @JsonProperty("pId") + @TableField(value = "p_id") + private String pId; + + /** + * 节点名称 + */ + @TableField(value = "name") + private String name; + + /** + * 排序字段 + */ + @TableField(value = "sort") + private Integer sort; + + @TableField(exist = false) + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformationCenterTree/entity/SarLawsInformationCenterTreeData.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformationCenterTree/entity/SarLawsInformationCenterTreeData.java new file mode 100644 index 00000000..2e417403 --- /dev/null +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformationCenterTree/entity/SarLawsInformationCenterTreeData.java @@ -0,0 +1,40 @@ +package com.adc.da.slrs.sarLawsInformationCenterTree.entity; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * + * @TableName sar_laws_information_center_tree + */ +@Data +public class SarLawsInformationCenterTreeData implements Serializable { + /** + * 主键 + */ + private String id; + + /** + * 父ID + */ + private String pId; + + /** + * 节点名称 + */ + private String name; + + /** + * 排序字段 + */ + private Integer sort; + + /** + * 子节点 + */ + private List children; + + private static final long serialVersionUID = 1L; +} \ No newline at end of file diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformationCenterTree/service/SarLawsInformationCenterTreeService.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformationCenterTree/service/SarLawsInformationCenterTreeService.java new file mode 100644 index 00000000..a511b834 --- /dev/null +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformationCenterTree/service/SarLawsInformationCenterTreeService.java @@ -0,0 +1,25 @@ +package com.adc.da.slrs.sarLawsInformationCenterTree.service; + +import com.adc.da.slrs.sarLawsInformationCenterTree.entity.SarLawsInformationCenterTree; +import com.adc.da.slrs.sarLawsInformationCenterTree.entity.SarLawsInformationCenterTreeData; +import com.baomidou.mybatisplus.extension.service.IService; + +import java.util.List; + +/** +* @author tjzdw +* @description 针对表【sar_laws_information_center_tree】的数据库操作Service +* @createDate 2023-10-23 11:20:26 +*/ +public interface SarLawsInformationCenterTreeService extends IService { + + void setResource(SarLawsInformationCenterTree informationCenterTree); + + void addTreeNode(SarLawsInformationCenterTree informationCenterTree); + + Boolean deleteTreeNode(String id); + + List getTree(); + + boolean updateTreeNode(SarLawsInformationCenterTree informationCenterTree); +} diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformationCenterTree/service/impl/SarLawsInformationCenterTreeServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformationCenterTree/service/impl/SarLawsInformationCenterTreeServiceImpl.java new file mode 100644 index 00000000..2a63a530 --- /dev/null +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformationCenterTree/service/impl/SarLawsInformationCenterTreeServiceImpl.java @@ -0,0 +1,142 @@ +package com.adc.da.slrs.sarLawsInformationCenterTree.service.impl; + +import com.adc.da.slrs.sarLawsInformation.entity.SarLawsInformation; +import com.adc.da.slrs.sarLawsInformation.service.SarLawsInformationService; +import com.adc.da.slrs.sarLawsInformationCenterTree.dao.SarLawsInformationCenterTreeDao; +import com.adc.da.slrs.sarLawsInformationCenterTree.entity.SarLawsInformationCenterTreeData; +import com.adc.da.slrs.sarRole.dao.TsRoleDao; +import com.adc.da.slrs.sarUser.service.ITsUserService; +import com.adc.da.slrs.tsRoleMeunData.dao.TsRoleMenuDataDao; +import com.adc.da.util.LoginUserUtil; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import com.adc.da.slrs.sarLawsInformationCenterTree.entity.SarLawsInformationCenterTree; +import com.adc.da.slrs.sarLawsInformationCenterTree.service.SarLawsInformationCenterTreeService; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.BeanUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import javax.annotation.Resource; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; + +/** +* @author tjzdw +* @description 针对表【sar_laws_information_center_tree】的数据库操作Service实现 +* @createDate 2023-10-23 11:20:26 +*/ +@Service +public class SarLawsInformationCenterTreeServiceImpl extends ServiceImpl + implements SarLawsInformationCenterTreeService{ + + @Resource + private TsRoleDao tsRoleDao; + @Resource + private TsRoleMenuDataDao tsRoleMenuDataDao; + @Resource + private ITsUserService tsUserService; + @Resource + private SarLawsInformationService sarLawsInformationService; + + @Transactional + @Override + public void addTreeNode(SarLawsInformationCenterTree informationCenterTree) { + int save = this.baseMapper.insert(informationCenterTree); + //新增后给所有角色配置权限 + setResource(informationCenterTree); + } + + @Override + public Boolean deleteTreeNode(String id) { + List idList = Arrays.asList(id.split(",")); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.in(SarLawsInformation::getTreeNodeId,idList); + int count = sarLawsInformationService.count(wrapper); + if (count > 0) { + return false; + } + int deleted = this.baseMapper.deleteBatchIds(idList); + return true; + } + + @Override + public List getTree() { + // 获取当前登录人 + String loginUserId = LoginUserUtil.getUserId(); + // 查询当前登录人的权限菜单 + List resourceIdList = tsUserService.getResourceUserId(loginUserId); + + List resList = new ArrayList<>(); + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.in(SarLawsInformationCenterTree::getId, resourceIdList); + wrapper.orderByAsc(SarLawsInformationCenterTree::getSort); + List list = this.list(wrapper); + List treeData = new ArrayList<>(); + //代码遍历生成树 + for (SarLawsInformationCenterTree informationCenterTree : list) { + if (StringUtils.isNotBlank(informationCenterTree.getPId())) { + SarLawsInformationCenterTreeData informationCenterTreeData = new SarLawsInformationCenterTreeData(); + BeanUtils.copyProperties(informationCenterTree, informationCenterTreeData); + treeData.add(informationCenterTreeData); + }else { + SarLawsInformationCenterTreeData res = new SarLawsInformationCenterTreeData(); + BeanUtils.copyProperties(informationCenterTree, res); + resList.add(res); + } + } + List treeData1 = new ArrayList<>(); + //递归生成树 + for (SarLawsInformationCenterTreeData data : resList) { + digui(data,treeData); + treeData1.add(data); + } + return treeData1; + } + + @Override + public boolean updateTreeNode(SarLawsInformationCenterTree informationCenterTree) { + int updated = this.baseMapper.updateById(informationCenterTree); + return updated > 0; + } + + @Transactional + @Override + public void setResource(SarLawsInformationCenterTree informationCenterTree) { + //获取pid + String pId = informationCenterTree.getPId(); + List roleIds = tsRoleDao.getResourceId(pId); + for (String roleId : roleIds){ + tsRoleDao.addResource(roleId,informationCenterTree.getId()); + tsRoleMenuDataDao.save(roleId,informationCenterTree.getId()); + } + } + + private void digui(SarLawsInformationCenterTreeData res,List treeData){ + for (SarLawsInformationCenterTreeData data : treeData) { + if (null==res.getChildren()) { + List data1=new ArrayList<>(); + res.setChildren(data1); + } + if (res.getId().equals(data.getPId())){ + if (null!=res.getChildren()){ + res.getChildren().add(data); + }else { + List data1 = new ArrayList<>(); + data1.add(data); + res.setChildren(data1); + } + } + } + if (null!=res.getChildren()){ + for (SarLawsInformationCenterTreeData treeData1:res.getChildren()) { + digui(treeData1,treeData); + } + } + } +} + + + + diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/impl/SarLawsTopicServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/impl/SarLawsTopicServiceImpl.java index b83ad93f..de7c04ed 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/impl/SarLawsTopicServiceImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/impl/SarLawsTopicServiceImpl.java @@ -144,8 +144,6 @@ public class SarLawsTopicServiceImpl extends ServiceImpl topicWrapper = new LambdaQueryWrapper<>(); topicWrapper.eq(SarLawsTopicMeeting::getLawsTopicId,lawsTopic.getId()); diff --git a/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsInformation/SarLawsInformationMapper.xml b/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsInformation/SarLawsInformationMapper.xml new file mode 100644 index 00000000..de045ca7 --- /dev/null +++ b/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsInformation/SarLawsInformationMapper.xml @@ -0,0 +1,66 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + ID,FIRST_TYPE,SECOND_TYPE, + THIRD_TYPE,FOURTH_TYPE,`NAME`, + DEPARTMENT,AUTHOR,UPLOAD_TIME, + `DESCRIPTION`,INFORMATION_FILE,VIEWABLE_BY, + DOWNLOADABLE_BY,VALID_FLAG,CREATE_TIME, + MODIFY_TIME + + + + and FIRST_TYPE = #{firstType} + + + and SECOND_TYPE = #{secondType} + + + and `NAME` like concat('%',#{name},'%') + + + and UPLOAD_TIME = #{uploadTime} + + + and TREE_NODE_ID = #{treeNodeId} + + + + + diff --git a/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsInformationCenterTree/SarLawsInformationCenterTreeMapper.xml b/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsInformationCenterTree/SarLawsInformationCenterTreeMapper.xml new file mode 100644 index 00000000..0b709092 --- /dev/null +++ b/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsInformationCenterTree/SarLawsInformationCenterTreeMapper.xml @@ -0,0 +1,18 @@ + + + + + + + + + + + + + id,p_id,`name`, + sort + + From b3acedf0e1b012484f6be120bbe89a1463e87c89 Mon Sep 17 00:00:00 2001 From: wxyclub Date: Mon, 23 Oct 2023 16:38:23 +0800 Subject: [PATCH 16/31] =?UTF-8?q?add=EF=BC=9A=E6=94=BF=E7=AD=96=E8=B5=84?= =?UTF-8?q?=E6=96=99=E4=B8=AD=E5=BF=83=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/SarLawsInformationController.java | 2 +- .../impl/SarLawsInformationServiceImpl.java | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 1 deletion(-) diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/controller/SarLawsInformationController.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/controller/SarLawsInformationController.java index 7ef30d82..ba9f4f7d 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/controller/SarLawsInformationController.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/controller/SarLawsInformationController.java @@ -16,7 +16,7 @@ import java.util.List; /** * @author tjzdw - * @description + * @description 政策资料中心 * @date 2023/10/23 */ @RestController diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/impl/SarLawsInformationServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/impl/SarLawsInformationServiceImpl.java index 430dfb5f..88357226 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/impl/SarLawsInformationServiceImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/impl/SarLawsInformationServiceImpl.java @@ -1,5 +1,7 @@ package com.adc.da.slrs.sarLawsInformation.service.impl; +import com.adc.da.att.entity.AttFileEO; +import com.adc.da.att.service.IAttFileEOService; import com.adc.da.slrs.sarLawsInformationCenterTree.entity.SarLawsInformationCenterTree; import com.adc.da.slrs.sarLawsInformationCenterTree.service.SarLawsInformationCenterTreeService; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; @@ -12,6 +14,7 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import javax.annotation.Resource; +import java.util.ArrayList; import java.util.Date; import java.util.List; @@ -26,10 +29,23 @@ public class SarLawsInformationServiceImpl extends ServiceImpl fileNameList = new ArrayList<>(); + for (String attId : split) { + AttFileEO fileInfo = attFileEOService.getFileInfo(attId); + fileNameList.add(fileInfo.getOldFileName()); + } + sarLawsInformation.setInformationFileName(String.join(",",fileNameList)); + } + // 查询体系节点信息 if (StringUtils.isNotBlank(sarLawsInformation.getTreeNodeId())) { SarLawsInformationCenterTree treeNode = treeService.getById(sarLawsInformation.getTreeNodeId()); sarLawsInformation.setTreeNodeName(treeNode.getName()); From 00d1714ca8dcd6ce0e5fae6ad13982599546fae0 Mon Sep 17 00:00:00 2001 From: wxyclub Date: Tue, 24 Oct 2023 11:08:02 +0800 Subject: [PATCH 17/31] =?UTF-8?q?add=EF=BC=9A=E6=94=BF=E7=AD=96=E8=B5=84?= =?UTF-8?q?=E6=96=99=E4=B8=AD=E5=BF=83=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SarLawsInformationServiceImpl.java | 2 +- .../entity/SarLawsInformationCenterTree.java | 5 ++--- .../entity/SarLawsInformationCenterTreeData.java | 2 +- .../impl/SarLawsInformationCenterTreeServiceImpl.java | 6 +++--- .../SarLawsInformationCenterTreeMapper.xml | 4 ++-- 5 files changed, 9 insertions(+), 10 deletions(-) diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/impl/SarLawsInformationServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/impl/SarLawsInformationServiceImpl.java index 88357226..a1fadf83 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/impl/SarLawsInformationServiceImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/impl/SarLawsInformationServiceImpl.java @@ -76,7 +76,7 @@ public class SarLawsInformationServiceImpl extends ServiceImpl wrapper = new LambdaQueryWrapper<>(); - wrapper.isNull(SarLawsInformationCenterTree::getPId); + wrapper.isNull(SarLawsInformationCenterTree::getParentId); SarLawsInformationCenterTree one = treeService.getOne(wrapper); sarLawsInformation.setTreeNodeId(one.getId()); } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformationCenterTree/entity/SarLawsInformationCenterTree.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformationCenterTree/entity/SarLawsInformationCenterTree.java index e630d31b..b497ee64 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformationCenterTree/entity/SarLawsInformationCenterTree.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformationCenterTree/entity/SarLawsInformationCenterTree.java @@ -25,9 +25,8 @@ public class SarLawsInformationCenterTree implements Serializable { /** * 父ID */ - @JsonProperty("pId") - @TableField(value = "p_id") - private String pId; + @TableField(value = "parent_id") + private String parentId; /** * 节点名称 diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformationCenterTree/entity/SarLawsInformationCenterTreeData.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformationCenterTree/entity/SarLawsInformationCenterTreeData.java index 2e417403..b8f144cf 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformationCenterTree/entity/SarLawsInformationCenterTreeData.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformationCenterTree/entity/SarLawsInformationCenterTreeData.java @@ -19,7 +19,7 @@ public class SarLawsInformationCenterTreeData implements Serializable { /** * 父ID */ - private String pId; + private String parentId; /** * 节点名称 diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformationCenterTree/service/impl/SarLawsInformationCenterTreeServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformationCenterTree/service/impl/SarLawsInformationCenterTreeServiceImpl.java index 2a63a530..016db49c 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformationCenterTree/service/impl/SarLawsInformationCenterTreeServiceImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformationCenterTree/service/impl/SarLawsInformationCenterTreeServiceImpl.java @@ -76,7 +76,7 @@ public class SarLawsInformationCenterTreeServiceImpl extends ServiceImpl treeData = new ArrayList<>(); //代码遍历生成树 for (SarLawsInformationCenterTree informationCenterTree : list) { - if (StringUtils.isNotBlank(informationCenterTree.getPId())) { + if (StringUtils.isNotBlank(informationCenterTree.getParentId())) { SarLawsInformationCenterTreeData informationCenterTreeData = new SarLawsInformationCenterTreeData(); BeanUtils.copyProperties(informationCenterTree, informationCenterTreeData); treeData.add(informationCenterTreeData); @@ -105,7 +105,7 @@ public class SarLawsInformationCenterTreeServiceImpl extends ServiceImpl roleIds = tsRoleDao.getResourceId(pId); for (String roleId : roleIds){ tsRoleDao.addResource(roleId,informationCenterTree.getId()); @@ -119,7 +119,7 @@ public class SarLawsInformationCenterTreeServiceImpl extends ServiceImpl data1=new ArrayList<>(); res.setChildren(data1); } - if (res.getId().equals(data.getPId())){ + if (res.getId().equals(data.getParentId())){ if (null!=res.getChildren()){ res.getChildren().add(data); }else { diff --git a/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsInformationCenterTree/SarLawsInformationCenterTreeMapper.xml b/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsInformationCenterTree/SarLawsInformationCenterTreeMapper.xml index 0b709092..715d7379 100644 --- a/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsInformationCenterTree/SarLawsInformationCenterTreeMapper.xml +++ b/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsInformationCenterTree/SarLawsInformationCenterTreeMapper.xml @@ -6,13 +6,13 @@ - + - id,p_id,`name`, + id,parent_id,`name`, sort From 72774d03afde659c5b58cc3362d25be51823caca Mon Sep 17 00:00:00 2001 From: wxyclub Date: Tue, 24 Oct 2023 14:26:27 +0800 Subject: [PATCH 18/31] =?UTF-8?q?add=EF=BC=9A=E5=86=85=E5=A4=96=E9=83=A8?= =?UTF-8?q?=E4=BC=9A=E8=AE=AEEXCEL=E5=AF=BC=E5=85=A5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../InsideOutSideMeetingController.java | 7 +- .../service/InsideOutsideMeetingService.java | 3 +- .../impl/InsideOutsideMeetingServiceImpl.java | 129 ++++++++++++++---- 3 files changed, 107 insertions(+), 32 deletions(-) diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/controller/InsideOutSideMeetingController.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/controller/InsideOutSideMeetingController.java index 4e12d75a..ba820d17 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/controller/InsideOutSideMeetingController.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/controller/InsideOutSideMeetingController.java @@ -26,7 +26,7 @@ import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.IOException; import java.io.OutputStream; -import java.util.ArrayList; +import java.text.ParseException; import java.util.Arrays; import java.util.List; @@ -125,7 +125,10 @@ public class InsideOutSideMeetingController extends BaseController importMeetingInfo(@RequestParam(value = "file",required = false) MultipartFile file) { + public ResponseMessage importMeetingInfo(@RequestParam(value = "file",required = false) MultipartFile file) throws ParseException { + if (file == null) { + return Result.error("文件为空,请重新上传"); + } return meetingService.importMeetingInfo(file); } } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/InsideOutsideMeetingService.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/InsideOutsideMeetingService.java index 4235be26..face3b6b 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/InsideOutsideMeetingService.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/InsideOutsideMeetingService.java @@ -6,6 +6,7 @@ import com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutsideMeetingVO; import com.baomidou.mybatisplus.extension.service.IService; import org.springframework.web.multipart.MultipartFile; +import java.text.ParseException; import java.util.List; /** @@ -29,5 +30,5 @@ public interface InsideOutsideMeetingService extends IService queryMeetingById(List exportIdList); - ResponseMessage importMeetingInfo(MultipartFile file); + ResponseMessage importMeetingInfo(MultipartFile file) throws ParseException; } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/impl/InsideOutsideMeetingServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/impl/InsideOutsideMeetingServiceImpl.java index f5b79b96..0dcee162 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/impl/InsideOutsideMeetingServiceImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/impl/InsideOutsideMeetingServiceImpl.java @@ -15,10 +15,8 @@ import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.apache.commons.io.FileUtils; import org.apache.commons.lang3.StringUtils; -import org.apache.poi.ss.usermodel.Row; -import org.apache.poi.ss.usermodel.Sheet; -import org.apache.poi.ss.usermodel.Workbook; -import org.apache.poi.ss.usermodel.WorkbookFactory; +import org.apache.poi.hssf.usermodel.HSSFDateUtil; +import org.apache.poi.ss.usermodel.*; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; @@ -27,6 +25,7 @@ import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import java.io.File; import java.io.IOException; +import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; @@ -146,12 +145,11 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl importMeetingInfo(MultipartFile file) { - //给出头部信息 - String[] headerExcel = (FieldConvertUtil.exportFieldNamesInsideOutsideMeeting + "," + FieldConvertUtil.exportFieldNamesMeetingTopic).split(","); + public ResponseMessage importMeetingInfo(MultipartFile file) throws ParseException { //获取文件全称 String fileNameStr = file.getOriginalFilename(); //获取最后.的位置 + assert fileNameStr != null; int pos = fileNameStr.lastIndexOf("."); //获取压缩文件名称并以小写显示 String fileStr = fileNameStr.substring(pos + 1).toLowerCase(); @@ -175,11 +173,11 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl headerList = new ArrayList<>(); // 获取excel表头 Row headerRow = sheet.getRow(1); - for (int i = 0; i <= 25; i++) { - sb.append(headerRow.getCell(i).getStringCellValue()).append(","); + for (int i = 0; i <= 12; i++) { + headerList.add(headerRow.getCell(i).getStringCellValue()); } - //获取总条数 - int rowNum = sheet.getPhysicalNumberOfRows(); - // 开始遍历表格行 - for (int rowIndex = 1; rowIndex < rowNum; rowIndex++) { - Row row = sheet.getRow(rowIndex); - String fields = StringUtils.join(headerExcel); - if (!fields.equals(FieldConvertUtil.exportFieldNamesInsideOutsideMeeting + "," + FieldConvertUtil.exportFieldNamesMeetingTopic)) { - try { - workbook.close(); - } catch (IOException e) { - return Result.error("文件关闭出错"); - } - //删除原上传文件 - FileUnZip.deleteDir(saveDirectory); - return Result.error("fail", "读取失败,请严格按照模板文件导入数据"); + + // 判断表头字段是否相同 + if (!String.join(",",headerList).equals(FieldConvertUtil.exportFieldNamesInsideOutsideMeeting + "," + FieldConvertUtil.exportFieldNamesMeetingTopic)) { + try { + workbook.close(); + } catch (IOException e) { + return Result.error("文件关闭出错"); } - Map rowList = new LinkedHashMap<>(); - // TODO 内外部会议导入 + //删除原上传文件 + FileUnZip.deleteDir(saveDirectory); + return Result.error("fail", "读取失败,请严格按照模板文件导入数据"); } - return null; + // 获取总行数 + int rowNum = sheet.getPhysicalNumberOfRows(); + List> importDataList = new ArrayList<>(); + // 开始遍历表格行 + for (int rowIndex = 2; rowIndex < rowNum; rowIndex++) { + // 获取每一行 + Row row = sheet.getRow(rowIndex); + // 用于存储每行的键值对数据,对应一条数据 + Map rowMap = new LinkedHashMap<>(); + // 总列数 + int columnNum = 13; + // 遍历每个单元格 + for (int columnIndex = 0; columnIndex < columnNum; columnIndex++) { + // 获取单元格 + Cell cell = row.getCell(columnIndex); + // 获取表头单元格 + Cell headerCell = headerRow.getCell(columnIndex); + if (cell != null) { + if (CellType.NUMERIC == cell.getCellType() && HSSFDateUtil.isCellDateFormatted(cell)) { + Date d = cell.getDateCellValue(); + if (d.before(sdf.parse("1900-01-01")) || d.after(sdf.parse("2500-01-01"))) { + return Result.error("输入的日期异常,请按照实际日期填写"); + } + // 将单元格数据存入Map中 + rowMap.put(headerCell.getStringCellValue(), sdf.format(d)); + } else { + cell.setCellType(CellType.STRING); + rowMap.put(headerCell.getStringCellValue(), cell.getStringCellValue()); + } + } else { + rowMap.put(headerCell.getStringCellValue(), ""); + } + } + importDataList.add(rowMap); + } + for (Map stringStringMap : importDataList) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(InsideOutsideMeeting::getMeetingName, stringStringMap.get("会议名称")); + List insideOutsideMeetingList = this.baseMapper.selectList(wrapper); + if (insideOutsideMeetingList.size() > 0) { + InsideOutsideMeeting insideOutsideMeeting = insideOutsideMeetingList.get(0); + MeetingTopic meetingTopic = new MeetingTopic(); + meetingTopic.setAgendaName(stringStringMap.get("议题名称")); + meetingTopic.setReporter("汇报人"); + meetingTopic.setReportingUnit("汇报单位"); + meetingTopic.setAgendaContent("议题主要内容"); + meetingTopic.setValidFlag(0); + meetingTopic.setMeetingId(insideOutsideMeeting.getId()); + meetingTopic.setCreateTime(new Date()); + meetingTopic.setModifyTime(new Date()); + meetingTopicService.save(meetingTopic); + } else { + InsideOutsideMeeting insideOutsideMeeting = new InsideOutsideMeeting(); + insideOutsideMeeting.setMeetingTopicList(new ArrayList<>()); + insideOutsideMeeting.setMeetingName(stringStringMap.get("会议名称")); + insideOutsideMeeting.setTopicName(stringStringMap.get("课题名称")); + insideOutsideMeeting.setMeetingOrganizer(stringStringMap.get("会议主办单位")); + insideOutsideMeeting.setMeetingTime(sdf.parse(stringStringMap.get("会议时间"))); + insideOutsideMeeting.setMeetingAddress(stringStringMap.get("会议地点")); + insideOutsideMeeting.setParticipants(stringStringMap.get("参会人员")); + insideOutsideMeeting.setMeetingContent(stringStringMap.get("会议主要内容")); + insideOutsideMeeting.setFirstMeetingType(stringStringMap.get("一级会议类别")); + insideOutsideMeeting.setSecondMeetingType(stringStringMap.get("二级会议类别")); + insideOutsideMeeting.setValidFlag(0); + insideOutsideMeeting.setCreateTime(new Date()); + insideOutsideMeeting.setModifyTime(new Date()); + this.baseMapper.insert(insideOutsideMeeting); + MeetingTopic meetingTopic = new MeetingTopic(); + meetingTopic.setAgendaName(stringStringMap.get("议题名称")); + meetingTopic.setReporter("汇报人"); + meetingTopic.setReportingUnit("汇报单位"); + meetingTopic.setAgendaContent("议题主要内容"); + meetingTopic.setValidFlag(0); + meetingTopic.setMeetingId(insideOutsideMeeting.getId()); + meetingTopic.setCreateTime(new Date()); + meetingTopic.setModifyTime(new Date()); + meetingTopicService.save(meetingTopic); + } + } + return Result.success("导入完成"); } private static List readImpExcelFile(String path) { From 2d3c16e396e4314f5e206c48a12f39fa8d059def Mon Sep 17 00:00:00 2001 From: wxyclub Date: Tue, 24 Oct 2023 16:41:35 +0800 Subject: [PATCH 19/31] =?UTF-8?q?add=EF=BC=9A=E6=94=BF=E7=AD=96=E8=AF=BE?= =?UTF-8?q?=E9=A2=98=E5=85=A5=E4=BC=9A=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/adc/da/common/ActDefineStartMap.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/adc-da-activiti/src/main/java/com/adc/da/common/ActDefineStartMap.java b/adc-da-activiti/src/main/java/com/adc/da/common/ActDefineStartMap.java index ae96cef1..1bb5c6e2 100644 --- a/adc-da-activiti/src/main/java/com/adc/da/common/ActDefineStartMap.java +++ b/adc-da-activiti/src/main/java/com/adc/da/common/ActDefineStartMap.java @@ -65,6 +65,8 @@ public class ActDefineStartMap { map.put("28","bzxqfy"); // 内外部会议入库流程 map.put("29","insideOutsideMeetingLibrary"); + // 政策课题入会流程 + map.put("30","policyResearchGroupEnrollment"); return map.get(type); } From af2e36dd77240afeb549e53807a614637b0b0423 Mon Sep 17 00:00:00 2001 From: wxyclub Date: Tue, 24 Oct 2023 22:48:53 +0800 Subject: [PATCH 20/31] =?UTF-8?q?add=EF=BC=9A=E4=BC=81=E6=A0=87=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E7=A8=BF=E6=96=87=E4=BB=B6=E5=87=BA=E7=8E=B0=E6=96=87?= =?UTF-8?q?=E4=BB=B6=E9=87=8D=E5=A4=8D=EF=BC=8C=E7=BC=96=E5=86=99=E5=8E=BB?= =?UTF-8?q?=E9=87=8D=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../SarBussStandFileController.java | 8 +++ .../service/ISarBussStandFileService.java | 2 + .../impl/SarBussStandFileServiceImpl.java | 55 +++++++++++++++++++ 3 files changed, 65 insertions(+) diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussStandFile/controller/SarBussStandFileController.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussStandFile/controller/SarBussStandFileController.java index 5984cd8e..d9e266bf 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussStandFile/controller/SarBussStandFileController.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussStandFile/controller/SarBussStandFileController.java @@ -83,4 +83,12 @@ public class SarBussStandFileController extends BaseController //非在线编辑文件可转换pdf return sarBussStandFileEOService.batchUpdateSarBussFileMQ(); } + + + @ApiOperation(value = "企标发布稿重复问题,去重处理") + @GetMapping("/batchUpdateSarBussFileRepeat") + public ResponseMessage batchUpdateSarBussFileRepeat() throws Exception { + String result = sarBussStandFileEOService.batchUpdateSarBussFileRepeat(); + return Result.success(result); + } } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussStandFile/service/ISarBussStandFileService.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussStandFile/service/ISarBussStandFileService.java index 56c2d4f9..9225ee69 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussStandFile/service/ISarBussStandFileService.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussStandFile/service/ISarBussStandFileService.java @@ -21,4 +21,6 @@ public interface ISarBussStandFileService extends IService { ResponseMessage> batchUpdateSarBussFile(); ResponseMessage> batchUpdateSarBussFileMQ(); + + String batchUpdateSarBussFileRepeat(); } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussStandFile/service/impl/SarBussStandFileServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussStandFile/service/impl/SarBussStandFileServiceImpl.java index 339249e0..bc40f93a 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussStandFile/service/impl/SarBussStandFileServiceImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarBussStandFile/service/impl/SarBussStandFileServiceImpl.java @@ -7,11 +7,15 @@ import com.adc.da.common.UseModuleEnum; import com.adc.da.http.ResponseMessage; import com.adc.da.http.Result; import com.adc.da.mq.CreateOnlineEditingFileMQService; +import com.adc.da.slrs.sarBussStandAttrInfo.entity.SarBussStandAttrInfo; +import com.adc.da.slrs.sarBussStandAttrInfo.service.ISarBussStandAttrInfoService; import com.adc.da.slrs.sarBussStandFile.entity.SarBussStandFile; import com.adc.da.slrs.sarBussStandFile.dao.SarBussStandFileDao; import com.adc.da.slrs.sarBussStandFile.service.ISarBussStandFileService; import com.adc.da.slrs.sarBussionessStand.service.impl.SarBussionessStandServiceImpl; +import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import org.apache.commons.lang.StringUtils; import org.slf4j.Logger; @@ -20,7 +24,12 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; +import javax.annotation.Resource; import java.util.*; +import java.util.concurrent.ConcurrentHashMap; +import java.util.function.Function; +import java.util.function.Predicate; +import java.util.stream.Collectors; /** *

@@ -47,6 +56,9 @@ public class SarBussStandFileServiceImpl extends ServiceImpl selectFileByAttId(String attId) throws Exception{ return sarStandFileEODao.selectFileByAttId(attId); @@ -140,4 +152,47 @@ public class SarBussStandFileServiceImpl extends ServiceImpl wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(SarBussStandAttrInfo::getValidFlag,"0"); + wrapper.isNotNull(SarBussStandAttrInfo::getFbgbuss); + wrapper.ne(SarBussStandAttrInfo::getFbgbuss,""); + wrapper.select(SarBussStandAttrInfo::getStandId,SarBussStandAttrInfo::getFbgbuss); + List allStand = standAttrInfoService.list(wrapper); + // 转换为Map + Map fbBussMap = new HashMap<>(); + allStand.forEach(each -> fbBussMap.put(each.getStandId(),each.getFbgbuss())); + // 循环每条数据 + for (Map.Entry entry : fbBussMap.entrySet()) { + // 把发布告文件做分割 + List attIdList = Arrays.asList(entry.getValue().split(",")); + // 根据发布稿文件查询发布告的具体信息,获取原文件名 + LambdaQueryWrapper wrapper1 = new LambdaQueryWrapper<>(); + wrapper1.eq(SarBussStandFile::getValidFlag,"0"); + wrapper1.in(SarBussStandFile::getAttId, attIdList); + List sarBussStandFileList = sarStandFileEODao.selectList(wrapper1); + // 对文件名做去重 + List collect = sarBussStandFileList.stream() + .filter(distinctByKey(SarBussStandFile::getFileName)) +// .sorted(Comparator.comparing(SarBussStandFile::getCreationTime)) + .collect(Collectors.toList()); + // 如果长度不相等,说明执行了去重,需要修改,重新放回企标详情表中 + String fbgbuss = collect.stream().map(SarBussStandFile::getAttId).collect(Collectors.joining(",")); + if (fbgbuss.length() != entry.getValue().length()) { + LambdaUpdateWrapper wrapper2 = new LambdaUpdateWrapper<>(); + wrapper2.eq(SarBussStandAttrInfo::getStandId,entry.getKey()); + wrapper2.set(SarBussStandAttrInfo::getFbgbuss,fbgbuss); + standAttrInfoService.update(wrapper2); + logger.info("出现重复的企标:"+ entry.getKey() + ",去重后发布稿包含:" + fbgbuss + "---去重前发布稿包含:" + entry.getValue()); + } + } + return "去重成功"; + } + public static Predicate distinctByKey(Function keyExtractor) { + Set seen = ConcurrentHashMap.newKeySet(); + return t -> seen.add(keyExtractor.apply(t)); + } } From f4fcf8038256bed30b2477420d862af857585e47 Mon Sep 17 00:00:00 2001 From: wxyclub Date: Wed, 25 Oct 2023 10:35:49 +0800 Subject: [PATCH 21/31] =?UTF-8?q?add=EF=BC=9A=E6=94=BF=E7=AD=96=E8=B5=84?= =?UTF-8?q?=E6=96=99=E6=9F=A5=E8=AF=A2=E6=B7=BB=E5=8A=A0=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/SarLawsInformation.java | 24 +++++++++++++++++++ .../impl/SarLawsInformationServiceImpl.java | 17 +++++++++++++ .../tsDictionaryType/dao/TsDicTypeDao.java | 2 ++ .../service/ITsDicTypeService.java | 7 ++++++ .../service/impl/TsDicTypeServiceImpl.java | 5 ++++ .../SarLawsInformationMapper.xml | 16 +++++++++++-- .../tsDictionaryType/TsDicTypeMapper.xml | 3 +++ 7 files changed, 72 insertions(+), 2 deletions(-) diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/entity/SarLawsInformation.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/entity/SarLawsInformation.java index 8c21cbc3..f18b8cec 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/entity/SarLawsInformation.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/entity/SarLawsInformation.java @@ -35,24 +35,48 @@ public class SarLawsInformation extends BasePage implements Serializable { @TableField(value = "FIRST_TYPE") private String firstType; + /** + * 一级资料类别名称 + */ + @TableField(exist = false) + private String firstTypeName; + /** * 二级资料类别 */ @TableField(value = "SECOND_TYPE") private String secondType; + /** + * 二级资料类别名称 + */ + @TableField(exist = false) + private String secondTypeName; + /** * 三级资料类别 */ @TableField(value = "THIRD_TYPE") private String thirdType; + /** + * 三级资料类别名称 + */ + @TableField(exist = false) + private String thirdTypeName; + /** * 四级资料类别 */ @TableField(value = "FOURTH_TYPE") private String fourthType; + /** + * 四级资料类别名称 + */ + @TableField(exist = false) + private String fourthTypeName; + /** * 资料名称 */ diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/impl/SarLawsInformationServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/impl/SarLawsInformationServiceImpl.java index a1fadf83..8eb3d9d3 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/impl/SarLawsInformationServiceImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/impl/SarLawsInformationServiceImpl.java @@ -4,6 +4,7 @@ import com.adc.da.att.entity.AttFileEO; import com.adc.da.att.service.IAttFileEOService; import com.adc.da.slrs.sarLawsInformationCenterTree.entity.SarLawsInformationCenterTree; import com.adc.da.slrs.sarLawsInformationCenterTree.service.SarLawsInformationCenterTreeService; +import com.adc.da.slrs.tsDictionaryType.service.ITsDicTypeService; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -31,10 +32,25 @@ public class SarLawsInformationServiceImpl extends ServiceImpl { public List getSearchMenu(); + + String selectDicTypeNameByDicCode(String typeCode); } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/tsDictionaryType/service/ITsDicTypeService.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/tsDictionaryType/service/ITsDicTypeService.java index 31e5f3d3..ac04a9fe 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/tsDictionaryType/service/ITsDicTypeService.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/tsDictionaryType/service/ITsDicTypeService.java @@ -18,4 +18,11 @@ public interface ITsDicTypeService extends IService { public List getSearchMenu(); + /** + * 根据数据字典编码查询字典值 + * @param typeCode 字典编码 + * @return 字典值 + */ + public String getDicTypeNameByDicCode(String typeCode); + } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/tsDictionaryType/service/impl/TsDicTypeServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/tsDictionaryType/service/impl/TsDicTypeServiceImpl.java index c55fb826..cc94a502 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/tsDictionaryType/service/impl/TsDicTypeServiceImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/tsDictionaryType/service/impl/TsDicTypeServiceImpl.java @@ -25,4 +25,9 @@ public class TsDicTypeServiceImpl extends ServiceImpl i public List getSearchMenu() { return getBaseMapper().getSearchMenu(); } + + @Override + public String getDicTypeNameByDicCode(String typeCode) { + return this.baseMapper.selectDicTypeNameByDicCode(typeCode); + } } diff --git a/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsInformation/SarLawsInformationMapper.xml b/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsInformation/SarLawsInformationMapper.xml index de045ca7..6cc59f52 100644 --- a/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsInformation/SarLawsInformationMapper.xml +++ b/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsInformation/SarLawsInformationMapper.xml @@ -7,9 +7,13 @@ + + + + @@ -25,8 +29,16 @@ - ID,FIRST_TYPE,SECOND_TYPE, - THIRD_TYPE,FOURTH_TYPE,`NAME`, + ID, + FIRST_TYPE, + (select DIC_TYPE_NAME from ts_dictype where DIC_ID = (SELECT ID FROM `ts_dictionary` where DICTIONARY_CODE = "firstMaterialType") and DIC_TYPE_CODE = FIRST_TYPE) firstTypeName, + SECOND_TYPE, + (select DIC_TYPE_NAME from ts_dictype where DIC_ID = (SELECT ID FROM `ts_dictionary` where DICTIONARY_CODE = "secondMaterialType") and DIC_TYPE_CODE = SECOND_TYPE) secondTypeName, + THIRD_TYPE, + (select DIC_TYPE_NAME from ts_dictype where DIC_ID = (SELECT ID FROM `ts_dictionary` where DICTIONARY_CODE = "thirdMaterialType") and DIC_TYPE_CODE = THIRD_TYPE) thirdTypeName, + FOURTH_TYPE, + (select DIC_TYPE_NAME from ts_dictype where DIC_ID = (SELECT ID FROM `ts_dictionary` where DICTIONARY_CODE = "fourthMaterialType") and DIC_TYPE_CODE = FOURTH_TYPE) fourthTypeName, + `NAME`, DEPARTMENT,AUTHOR,UPLOAD_TIME, `DESCRIPTION`,INFORMATION_FILE,VIEWABLE_BY, DOWNLOADABLE_BY,VALID_FLAG,CREATE_TIME, diff --git a/adc-da-slrs/src/main/resources/mybatis/mapper/tsDictionaryType/TsDicTypeMapper.xml b/adc-da-slrs/src/main/resources/mybatis/mapper/tsDictionaryType/TsDicTypeMapper.xml index 558feffe..3e637c31 100644 --- a/adc-da-slrs/src/main/resources/mybatis/mapper/tsDictionaryType/TsDicTypeMapper.xml +++ b/adc-da-slrs/src/main/resources/mybatis/mapper/tsDictionaryType/TsDicTypeMapper.xml @@ -28,4 +28,7 @@ t_d_t.DIC_TYPE_NAME is not null and t_d.DICTIONARY_NAME is not null + From 5b04a8ac44a05e20a48b654ead38a911b9c47d8a Mon Sep 17 00:00:00 2001 From: wxyclub Date: Wed, 25 Oct 2023 14:57:03 +0800 Subject: [PATCH 22/31] =?UTF-8?q?add=EF=BC=9A=E6=94=BF=E7=AD=96=E8=AF=BE?= =?UTF-8?q?=E9=A2=98=E5=85=A5=E4=BC=9A=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ActSarLawsTopicEOController.java | 48 +++++++++++++++++++ .../service/ActSarLawsTopicEOService.java | 41 ++++++++++++++++ 2 files changed, 89 insertions(+) create mode 100644 adc-da-activiti/src/main/java/com/adc/da/workFlow/controller/ActSarLawsTopicEOController.java create mode 100644 adc-da-activiti/src/main/java/com/adc/da/workFlow/service/ActSarLawsTopicEOService.java diff --git a/adc-da-activiti/src/main/java/com/adc/da/workFlow/controller/ActSarLawsTopicEOController.java b/adc-da-activiti/src/main/java/com/adc/da/workFlow/controller/ActSarLawsTopicEOController.java new file mode 100644 index 00000000..1365d7cb --- /dev/null +++ b/adc-da-activiti/src/main/java/com/adc/da/workFlow/controller/ActSarLawsTopicEOController.java @@ -0,0 +1,48 @@ +package com.adc.da.workFlow.controller; + +import com.adc.da.http.ResponseMessage; +import com.adc.da.http.Result; +import com.adc.da.workFlow.service.ActSarLawsTopicEOService; +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/25 + */ + +@Api("政策课题") +@RestController +@RequestMapping("/${restPath}/lawss/sarLawsTopic") +public class ActSarLawsTopicEOController { + + @Resource + private ActSarLawsTopicEOService lawsTopicEOService; + + @ApiOperation("政策课题入会") + @PostMapping("/processLawsTopicMembership") + public ResponseMessage processLawsTopicMembership(String infoJson){ + if (StringUtils.isBlank(infoJson)) { + return Result.error("传入数据json不能为空"); + } + lawsTopicEOService.processLawsTopicMembership(infoJson); + return Result.success("入会成功"); + } + + @ApiOperation("政策课题参会") + @PostMapping("/processLawsTopicParticipation") + public ResponseMessage processLawsTopicParticipation(String infoJson){ + if (StringUtils.isBlank(infoJson)) { + return Result.error("传入数据json不能为空"); + } + lawsTopicEOService.processLawsTopicParticipation(infoJson); + return Result.success("参会成功"); + } +} diff --git a/adc-da-activiti/src/main/java/com/adc/da/workFlow/service/ActSarLawsTopicEOService.java b/adc-da-activiti/src/main/java/com/adc/da/workFlow/service/ActSarLawsTopicEOService.java new file mode 100644 index 00000000..483548f3 --- /dev/null +++ b/adc-da-activiti/src/main/java/com/adc/da/workFlow/service/ActSarLawsTopicEOService.java @@ -0,0 +1,41 @@ +package com.adc.da.workFlow.service; + +import com.adc.da.exception.AdcDaBaseException; +import com.adc.da.slrs.sarLawsTopic.entity.SarLawsTopic; +import com.adc.da.slrs.sarLawsTopic.service.SarLawsTopicService; +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; + +/** + * @author tjzdw + * @description + * @date 2023/10/25 + */ +@Service +@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class) +public class ActSarLawsTopicEOService { + + @Resource + private SarLawsTopicService lawsTopicService; + + private static final Logger logger = LoggerFactory.getLogger(ActSarLawsTopicEOService.class); + + public void processLawsTopicMembership(String lawsTopicInfo) { + SarLawsTopic sarLawsTopic = JSONObject.parseObject(lawsTopicInfo, SarLawsTopic.class); + if (sarLawsTopic == null) { + throw new AdcDaBaseException("入库失败,政策课题信息出错"); + } + logger.info("政策课题入会:" + sarLawsTopic); + lawsTopicService.addLawsTopicInfo(sarLawsTopic); + } + + public void processLawsTopicParticipation(String infoJson) { + + } +} From 58b20a75b38d2cae0fedecacd672a6726d120e86 Mon Sep 17 00:00:00 2001 From: wxyclub Date: Thu, 26 Oct 2023 13:57:50 +0800 Subject: [PATCH 23/31] =?UTF-8?q?add=EF=BC=9A=E6=94=BF=E7=AD=96=E8=B5=84?= =?UTF-8?q?=E6=96=99=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/SarLawsInformation.java | 16 +- .../impl/SarLawsInformationServiceImpl.java | 159 ++++++++++++++++-- .../SarLawsInformationMapper.xml | 8 +- 3 files changed, 157 insertions(+), 26 deletions(-) diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/entity/SarLawsInformation.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/entity/SarLawsInformation.java index f18b8cec..edd27b26 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/entity/SarLawsInformation.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/entity/SarLawsInformation.java @@ -122,17 +122,23 @@ public class SarLawsInformation extends BasePage implements Serializable { private String informationFileName; /** - * 可查看者,若设置为空则仅有上传人和审批人可以查看,若设置人员后,仅有可查看者可查看文件信息。 + * 可查看者,若设置为空则所有用户均可查看,若设置人员后,仅有可查看者可以查看文件信息。 */ @TableField(value = "VIEWABLE_BY") private String viewableBy; /** - * 可下载者,若设置为空则所有用户均可下载,若设置人员后,仅有可下载者可以下载文件信息。 + * 可下载者,若设置为空则仅有上传人和审批人可以查看,若设置人员后,仅有可下载者可下载文件信息。 */ @TableField(value = "DOWNLOADABLE_BY") private String downloadableBy; + /** + * 创建人和审批人 + */ + @TableField + private String createAndApproveBy; + /** * 树节点ID */ @@ -179,6 +185,12 @@ public class SarLawsInformation extends BasePage implements Serializable { @TableField(exist = false) private String sortMode = "asc"; + /** + * 收藏ID + */ + @TableField(exist = false) + private String collectId; + @TableField(exist = false) private static final long serialVersionUID = 1L; } \ No newline at end of file diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/impl/SarLawsInformationServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/impl/SarLawsInformationServiceImpl.java index 8eb3d9d3..92207144 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/impl/SarLawsInformationServiceImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/impl/SarLawsInformationServiceImpl.java @@ -2,9 +2,15 @@ package com.adc.da.slrs.sarLawsInformation.service.impl; import com.adc.da.att.entity.AttFileEO; import com.adc.da.att.service.IAttFileEOService; +import com.adc.da.person.entity.TsPersonCollect; +import com.adc.da.person.service.IPersonCollectEOService; import com.adc.da.slrs.sarLawsInformationCenterTree.entity.SarLawsInformationCenterTree; import com.adc.da.slrs.sarLawsInformationCenterTree.service.SarLawsInformationCenterTreeService; +import com.adc.da.slrs.sarUpdLog.entity.SarUpdLog; +import com.adc.da.slrs.sarUpdLog.service.ISarUpdLogService; import com.adc.da.slrs.tsDictionaryType.service.ITsDicTypeService; +import com.adc.da.util.LoginUserUtil; +import com.adc.da.util.UUIDUtils; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; @@ -15,9 +21,10 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; import javax.annotation.Resource; -import java.util.ArrayList; -import java.util.Date; -import java.util.List; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.*; /** * @author tjzdw @@ -34,23 +41,16 @@ public class SarLawsInformationServiceImpl extends ServiceImpl wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(TsPersonCollect::getCollectResId, sarLawsInformation.getId()); + wrapper.eq(TsPersonCollect::getValidFlag, 0); + List list = collectEOService.list(); + if (list.size() > 0) { + sarLawsInformation.setCollectId(list.get(0).getId()); + } return sarLawsInformation; } @@ -81,7 +89,12 @@ public class SarLawsInformationServiceImpl extends ServiceImpl sarLawsInformationList = this.baseMapper.queryByPage(page); + for (SarLawsInformation sarLawsInformation : sarLawsInformationList) { + convertCodeToName(sarLawsInformation); + } + return sarLawsInformationList; } @Override @@ -114,10 +127,120 @@ public class SarLawsInformationServiceImpl extends ServiceImpl compareResult = compareSarLawsInformation(oldLawsInformation, lawsInformation); + if (compareResult.size() > 0) { + int update = this.baseMapper.updateById(lawsInformation); + // 添加修改记录 + SarUpdLog sarUpdLogEO = new SarUpdLog(); + sarUpdLogEO.setId(UUIDUtils.randomUUID20()); + sarUpdLogEO.setSarId(oldLawsInformation.getId()); + sarUpdLogEO.setSarType("LAWS_INFORMATION"); + sarUpdLogEO.setCreationTime(new Date()); + sarUpdLogEO.setCreationUser(LoginUserUtil.getUserId()); + sarUpdLogEO.setContent(oldLawsInformation.getName() + "," + String.join(",",compareResult)); + updLogService.save(sarUpdLogEO); + } return true; } + + public void convertCodeToName(SarLawsInformation sarLawsInformation) { + List firstTypeList = new ArrayList<>(); + for (String type : sarLawsInformation.getFirstType().split(",")) { + if (StringUtils.isNotBlank(type)) { + firstTypeList.add(dicTypeService.getDicTypeNameByDicCode(type)); + } + } + sarLawsInformation.setFirstTypeName(String.join(",",firstTypeList)); + List secondTypeList = new ArrayList<>(); + for (String type : sarLawsInformation.getSecondType().split(",")) { + if (StringUtils.isNotBlank(type)) { + secondTypeList.add(dicTypeService.getDicTypeNameByDicCode(type)); + } + } + sarLawsInformation.setSecondTypeName(String.join(",",secondTypeList)); + List thirdTypeList = new ArrayList<>(); + for (String type : sarLawsInformation.getThirdType().split(",")) { + if (StringUtils.isNotBlank(type)) { + thirdTypeList.add(dicTypeService.getDicTypeNameByDicCode(type)); + } + } + sarLawsInformation.setThirdTypeName(String.join(",",thirdTypeList)); + List fourthTypeList = new ArrayList<>(); + for (String type : sarLawsInformation.getFourthType().split(",")) { + if (StringUtils.isNotBlank(type)) { + fourthTypeList.add(dicTypeService.getDicTypeNameByDicCode(type)); + } + } + sarLawsInformation.setFirstTypeName(String.join(",",fourthTypeList)); + } + + /** + * 比较两个SarLawsInformation 对象 + * @param oldInfo 数据库中存储的对象 + * @param newInfo 更新后的对象 + * @return 差异 + */ + public List compareSarLawsInformation(SarLawsInformation oldInfo, SarLawsInformation newInfo) { + List changes = new ArrayList<>(); + // 不需要比较的字段 + String[] ignoreFields = {"id","firstTypeName","secondTypeName","thirdTypeName","fourthTypeName","uploadTime", + "informationFileName","createAndApproveBy","treeNodeId","treeNodeName","validFlag","createTime", + "modifyTime","sortField","sortMode","collectId","serialVersionUID"}; + List ignoreFieldList = Arrays.asList(ignoreFields); + // 获取SarLawsInformation类的所有字段 + Field[] fields = SarLawsInformation.class.getDeclaredFields(); + for (Field field : fields) { + if (!ignoreFieldList.contains(field.getName())) { + try { + field.setAccessible(true); + String oldValue = String.valueOf(field.get(oldInfo)); + String newValue = String.valueOf(field.get(newInfo)); + if (!Objects.equals(oldValue, newValue)) { + if ("firstType".equals(field.getName()) || "secondType".equals(field.getName()) || "thirdType".equals(field.getName()) || + "fourthType".equals(field.getName())) { + List typeNameList = new ArrayList<>(); + if (StringUtils.isNotBlank(newValue)) { + for (String type : newValue.split(",")) { + if (StringUtils.isNotBlank(type)) { + typeNameList.add(dicTypeService.getDicTypeNameByDicCode(type)); + } + } + } + // 获取资料类型名称 + String fieldName = field.getName().substring(0, 1).toUpperCase() + field.getName().substring(1); + Method method = SarLawsInformation.class.getMethod("get" + fieldName + "Name"); + Object oldTypeName = method.invoke(oldInfo); + changes.add("\"" + field.getName() + "\"由\"" + oldTypeName + "\"\"改为\"\"" + String.join(",",typeNameList) + "\""); + } else if ("informationFile".equals(field.getName())) { + List fileNameList = new ArrayList<>(); + if (StringUtils.isNotBlank(newValue)) { + String[] split = newValue.split(","); + for (String attId : split) { + AttFileEO fileInfo = attFileEOService.getFileInfo(attId); + fileNameList.add(fileInfo.getOldFileName()); + } + } + // 获取资料类型名称 + String fieldName = field.getName().substring(0, 1).toUpperCase() + field.getName().substring(1); + Method method = SarLawsInformation.class.getMethod("get" + fieldName + "Name"); + Object oldTypeName = method.invoke(oldInfo); + changes.add(field.getName() + "由\"" + oldTypeName + "\"\"改为\"\"" + String.join(",",fileNameList) + "\""); + } + else { + changes.add("\"" + field.getName() + "\"由\"" + oldValue + "\"\"改为\"\"" + newValue + "\""); + } + } + } catch (IllegalAccessException | NoSuchMethodException | InvocationTargetException e) { + // 处理异常 + e.printStackTrace(); + } + } + } + return changes; + } } diff --git a/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsInformation/SarLawsInformationMapper.xml b/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsInformation/SarLawsInformationMapper.xml index 6cc59f52..e73d9012 100644 --- a/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsInformation/SarLawsInformationMapper.xml +++ b/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsInformation/SarLawsInformationMapper.xml @@ -31,13 +31,9 @@ ID, FIRST_TYPE, - (select DIC_TYPE_NAME from ts_dictype where DIC_ID = (SELECT ID FROM `ts_dictionary` where DICTIONARY_CODE = "firstMaterialType") and DIC_TYPE_CODE = FIRST_TYPE) firstTypeName, SECOND_TYPE, - (select DIC_TYPE_NAME from ts_dictype where DIC_ID = (SELECT ID FROM `ts_dictionary` where DICTIONARY_CODE = "secondMaterialType") and DIC_TYPE_CODE = SECOND_TYPE) secondTypeName, THIRD_TYPE, - (select DIC_TYPE_NAME from ts_dictype where DIC_ID = (SELECT ID FROM `ts_dictionary` where DICTIONARY_CODE = "thirdMaterialType") and DIC_TYPE_CODE = THIRD_TYPE) thirdTypeName, FOURTH_TYPE, - (select DIC_TYPE_NAME from ts_dictype where DIC_ID = (SELECT ID FROM `ts_dictionary` where DICTIONARY_CODE = "fourthMaterialType") and DIC_TYPE_CODE = FOURTH_TYPE) fourthTypeName, `NAME`, DEPARTMENT,AUTHOR,UPLOAD_TIME, `DESCRIPTION`,INFORMATION_FILE,VIEWABLE_BY, @@ -46,10 +42,10 @@ - and FIRST_TYPE = #{firstType} + and FIRST_TYPE like concat('%',#{firstType},'%') - and SECOND_TYPE = #{secondType} + and SECOND_TYPE like concat('%',#{secondType},'%') and `NAME` like concat('%',#{name},'%') From 53241dd7bd96eb446b8ec37a1f72b2e249800356 Mon Sep 17 00:00:00 2001 From: wxyclub Date: Thu, 26 Oct 2023 16:30:32 +0800 Subject: [PATCH 24/31] =?UTF-8?q?bug=EF=BC=9A=E4=BC=81=E6=A0=87=E8=AE=A1?= =?UTF-8?q?=E5=88=92=E8=AF=84=E5=88=86=E9=97=AE=E9=A2=98=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/EsRevisePlanController.java | 70 +++++++++---------- .../service/impl/EsRevisePlanServiceImpl.java | 18 +++++ .../impl/QualityEvaluationServiceImpl.java | 10 +-- 3 files changed, 58 insertions(+), 40 deletions(-) diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/esRevisePlan/controller/EsRevisePlanController.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/esRevisePlan/controller/EsRevisePlanController.java index 2e040995..02168023 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/esRevisePlan/controller/EsRevisePlanController.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/esRevisePlan/controller/EsRevisePlanController.java @@ -165,41 +165,41 @@ public class EsRevisePlanController extends BaseController { } } revisePlan.setArea(area); - //查评分 - if (ObjectUtils.isNotEmpty(revisePlan.getStandId())) { - List last = new ArrayList<>(); - List evaluations = qualityEvaluationDao.getEvaluationForm(new QueryWrapper().eq("law_id", revisePlan.getStandId()).eq("evaluation_type", "quality")); - for (QualityEvaluation evaluation : evaluations) { - Double score; - String value; - if (evaluation.getProcessNode()==null){ - value=""; - }else { - value=evaluation.getProcessNode(); - } - String evaluationScore = ObjectUtils.isEmpty(evaluation.getScore()) ? "0" : evaluation.getScore(); - switch (value){ - case "征求意见": - score=Double.valueOf(evaluationScore) * 0.3; - break; - case "技术委员会评审、评审意见修改": - score=Double.valueOf(evaluationScore) * 0.4; - break; - case "重新技术委员会评审、评审意见修改": - score=Double.valueOf(evaluationScore) * 0.4; - break; - case "标准化复审": - score=Double.valueOf(evaluationScore) * 0.15; - break; - case "标准法规部高级经理审核": - score=Double.valueOf(evaluationScore) * 0.15; - break; - default: score=Double.valueOf(evaluationScore); - } - last.add(score); - } - revisePlan.setScore(last.stream().mapToDouble(Double::doubleValue).sum()); - } +// //查评分 +// if (ObjectUtils.isNotEmpty(revisePlan.getStandId())) { +// List last = new ArrayList<>(); +// List evaluations = qualityEvaluationDao.getEvaluationForm(new QueryWrapper().eq("law_id", revisePlan.getStandId()).eq("evaluation_type", "quality")); +// for (QualityEvaluation evaluation : evaluations) { +// Double score; +// String value; +// if (evaluation.getProcessNode()==null){ +// value=""; +// }else { +// value=evaluation.getProcessNode(); +// } +// String evaluationScore = ObjectUtils.isEmpty(evaluation.getScore()) ? "0" : evaluation.getScore(); +// switch (value){ +// case "征求意见": +// score=Double.valueOf(evaluationScore) * 0.3; +// break; +// case "技术委员会评审、评审意见修改": +// score=Double.valueOf(evaluationScore) * 0.4; +// break; +// case "重新技术委员会评审、评审意见修改": +// score=Double.valueOf(evaluationScore) * 0.4; +// break; +// case "标准化复审": +// score=Double.valueOf(evaluationScore) * 0.15; +// break; +// case "标准法规部高级经理审核": +// score=Double.valueOf(evaluationScore) * 0.15; +// break; +// default: score=Double.valueOf(evaluationScore); +// } +// last.add(score); +// } +// revisePlan.setScore(last.stream().mapToDouble(Double::doubleValue).sum()); +// } } PageInfo pageInfo = getPageInfo(esRevisePlan.getPager(),esRevisePlans); return Result.success(pageInfo); diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/esRevisePlan/service/impl/EsRevisePlanServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/esRevisePlan/service/impl/EsRevisePlanServiceImpl.java index def59e5e..2a2fa022 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/esRevisePlan/service/impl/EsRevisePlanServiceImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/esRevisePlan/service/impl/EsRevisePlanServiceImpl.java @@ -15,6 +15,7 @@ import com.adc.da.slrs.esStandRelation.entity.EsStandRelation; import com.adc.da.slrs.esStandRelation.service.IEsStandRelationService; import com.adc.da.slrs.sarBussionessStand.entity.SarBussionessStand; import com.adc.da.slrs.sarBussionessStand.service.ISarBussionessStandService; +import com.adc.da.slrs.sarEnterpriseStandardEvaluation.service.IQualityEvaluationService; import com.adc.da.sys.entity.UserEO; import com.adc.da.util.UUIDUtils; import com.alibaba.fastjson.JSON; @@ -26,6 +27,9 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.math.RoundingMode; +import java.text.NumberFormat; import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; @@ -56,6 +60,9 @@ public class EsRevisePlanServiceImpl extends ServiceImpl getAllPlans(EsRevisePlan esRevisePlan) { Integer count = esRevisePlanDao.getTotal(); @@ -73,6 +80,17 @@ public class EsRevisePlanServiceImpl extends ServiceImpl esRevisePlans = esRevisePlanDao.queryAll(esRevisePlan); + // 获取质量评分 + NumberFormat nf = NumberFormat.getNumberInstance(); + nf.setMaximumFractionDigits(2); + nf.setRoundingMode(RoundingMode.UP); + for (EsRevisePlan revisePlan : esRevisePlans) { + if (StringUtils.isNotBlank(revisePlan.getStandId())) { + Map scoreMap = qualityEvaluationService.getScore(revisePlan.getStandId()); + String quality = nf.format(scoreMap.get("quality")); + revisePlan.setScore(Double.valueOf(quality)); + } + } return esRevisePlans; } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarEnterpriseStandardEvaluation/service/impl/QualityEvaluationServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarEnterpriseStandardEvaluation/service/impl/QualityEvaluationServiceImpl.java index bd46d2aa..56956419 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarEnterpriseStandardEvaluation/service/impl/QualityEvaluationServiceImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarEnterpriseStandardEvaluation/service/impl/QualityEvaluationServiceImpl.java @@ -196,32 +196,32 @@ public class QualityEvaluationServiceImpl extends ServiceImpl countZQYJList = qualityEvaluationDao.selectCountZQYJ(qualityEvaluations.getProcessNode(), qualityEvaluations.getLawId()); if(!countZQYJList.isEmpty()){ countZQYJStr = countZQYJList.size(); } } - if(qualityEvaluations.getProcessNode().equals("技术委员会评审、评审意见修改")) { + if("技术委员会评审、评审意见修改".equals(qualityEvaluations.getProcessNode())) { List countJSWYList = qualityEvaluationDao.selectCountJSWY(qualityEvaluations.getProcessNode(), qualityEvaluations.getLawId()); if(!countJSWYList.isEmpty()){ countJSWYStr = countJSWYList.size(); } } - if(qualityEvaluations.getProcessNode().equals("重新技术委员会评审、评审意见修改")) { + if("重新技术委员会评审、评审意见修改".equals(qualityEvaluations.getProcessNode())) { List countCXJSWYList = qualityEvaluationDao.selectCXJSWY(qualityEvaluations.getProcessNode(), qualityEvaluations.getLawId()); if(!countCXJSWYList.isEmpty()){ countCXJSWYStr = countCXJSWYList.size(); } } - if(qualityEvaluations.getProcessNode().equals("标准化复审")) { + if("标准化复审".equals(qualityEvaluations.getProcessNode())) { List countBZHFSList = qualityEvaluationDao.selectBZHFS(qualityEvaluations.getProcessNode(), qualityEvaluations.getLawId()); if(!countBZHFSList.isEmpty()){ countBZHFSStr = countBZHFSList.size(); } } - if(qualityEvaluations.getProcessNode().equals("标准法规部高级经理审核")) { + if("标准法规部高级经理审核".equals(qualityEvaluations.getProcessNode())) { List countBZSHList = qualityEvaluationDao.selectBZSH(qualityEvaluations.getProcessNode(), qualityEvaluations.getLawId()); if(!countBZSHList.isEmpty()){ countBZSHStr = countBZSHList.size(); From 5ef7dff78cc31fe1233efb9c549f393dc6e5593e Mon Sep 17 00:00:00 2001 From: wxyclub Date: Thu, 26 Oct 2023 18:04:08 +0800 Subject: [PATCH 25/31] =?UTF-8?q?bug=EF=BC=9A=E6=94=BF=E7=AD=96=E8=B5=84?= =?UTF-8?q?=E6=96=99=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../service/impl/SarLawsInformationServiceImpl.java | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/impl/SarLawsInformationServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/impl/SarLawsInformationServiceImpl.java index 92207144..d0ee784d 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/impl/SarLawsInformationServiceImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/impl/SarLawsInformationServiceImpl.java @@ -69,8 +69,7 @@ public class SarLawsInformationServiceImpl extends ServiceImpl wrapper = new LambdaQueryWrapper<>(); wrapper.eq(TsPersonCollect::getCollectResId, sarLawsInformation.getId()); - wrapper.eq(TsPersonCollect::getValidFlag, 0); - List list = collectEOService.list(); + List list = collectEOService.list(wrapper); if (list.size() > 0) { sarLawsInformation.setCollectId(list.get(0).getId()); } @@ -213,7 +212,7 @@ public class SarLawsInformationServiceImpl extends ServiceImpl fileNameList = new ArrayList<>(); if (StringUtils.isNotBlank(newValue)) { @@ -227,10 +226,10 @@ public class SarLawsInformationServiceImpl extends ServiceImpl Date: Thu, 26 Oct 2023 18:04:32 +0800 Subject: [PATCH 26/31] =?UTF-8?q?bug=EF=BC=9A=E6=94=BF=E7=AD=96=E5=8F=82?= =?UTF-8?q?=E4=BC=9A=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/main/java/com/adc/da/common/ActDefineStartMap.java | 2 ++ .../da/workFlow/controller/ActSarLawsTopicEOController.java | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/adc-da-activiti/src/main/java/com/adc/da/common/ActDefineStartMap.java b/adc-da-activiti/src/main/java/com/adc/da/common/ActDefineStartMap.java index 1bb5c6e2..39123211 100644 --- a/adc-da-activiti/src/main/java/com/adc/da/common/ActDefineStartMap.java +++ b/adc-da-activiti/src/main/java/com/adc/da/common/ActDefineStartMap.java @@ -67,6 +67,8 @@ public class ActDefineStartMap { map.put("29","insideOutsideMeetingLibrary"); // 政策课题入会流程 map.put("30","policyResearchGroupEnrollment"); + // 政策课题参会流程 + map.put("31","policyResearchGroupAttendMeeting"); return map.get(type); } diff --git a/adc-da-activiti/src/main/java/com/adc/da/workFlow/controller/ActSarLawsTopicEOController.java b/adc-da-activiti/src/main/java/com/adc/da/workFlow/controller/ActSarLawsTopicEOController.java index 1365d7cb..3662df9e 100644 --- a/adc-da-activiti/src/main/java/com/adc/da/workFlow/controller/ActSarLawsTopicEOController.java +++ b/adc-da-activiti/src/main/java/com/adc/da/workFlow/controller/ActSarLawsTopicEOController.java @@ -33,7 +33,7 @@ public class ActSarLawsTopicEOController { return Result.error("传入数据json不能为空"); } lawsTopicEOService.processLawsTopicMembership(infoJson); - return Result.success("入会成功"); + return Result.success("入库成功"); } @ApiOperation("政策课题参会") @@ -43,6 +43,6 @@ public class ActSarLawsTopicEOController { return Result.error("传入数据json不能为空"); } lawsTopicEOService.processLawsTopicParticipation(infoJson); - return Result.success("参会成功"); + return Result.success("入库成功"); } } From 1c082fc9b6e9b1acc52a5624a73e720a591715a4 Mon Sep 17 00:00:00 2001 From: wxyclub Date: Fri, 27 Oct 2023 11:45:55 +0800 Subject: [PATCH 27/31] =?UTF-8?q?add:=20=E6=94=BF=E7=AD=96=E6=B3=95?= =?UTF-8?q?=E8=A7=84=E8=B5=84=E6=96=99=E5=85=A5=E5=BA=93=E6=B5=81=E7=A8=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/adc/da/common/ActDefineStartMap.java | 2 + .../ActSarLawsInformationEOController.java | 37 ++++++++++++++ .../ActSarLawsInformationEOService.java | 48 +++++++++++++++++++ .../entity/SarLawsInformation.java | 28 +++++++++++ .../impl/SarLawsInformationServiceImpl.java | 13 +++-- 5 files changed, 124 insertions(+), 4 deletions(-) create mode 100644 adc-da-activiti/src/main/java/com/adc/da/workFlow/controller/ActSarLawsInformationEOController.java create mode 100644 adc-da-activiti/src/main/java/com/adc/da/workFlow/service/ActSarLawsInformationEOService.java diff --git a/adc-da-activiti/src/main/java/com/adc/da/common/ActDefineStartMap.java b/adc-da-activiti/src/main/java/com/adc/da/common/ActDefineStartMap.java index 39123211..e9500f7a 100644 --- a/adc-da-activiti/src/main/java/com/adc/da/common/ActDefineStartMap.java +++ b/adc-da-activiti/src/main/java/com/adc/da/common/ActDefineStartMap.java @@ -69,6 +69,8 @@ public class ActDefineStartMap { map.put("30","policyResearchGroupEnrollment"); // 政策课题参会流程 map.put("31","policyResearchGroupAttendMeeting"); + // 政策法规资料入库流程 + map.put("32","PolicyLawsInformationLibrary"); return map.get(type); } diff --git a/adc-da-activiti/src/main/java/com/adc/da/workFlow/controller/ActSarLawsInformationEOController.java b/adc-da-activiti/src/main/java/com/adc/da/workFlow/controller/ActSarLawsInformationEOController.java new file mode 100644 index 00000000..371a1e96 --- /dev/null +++ b/adc-da-activiti/src/main/java/com/adc/da/workFlow/controller/ActSarLawsInformationEOController.java @@ -0,0 +1,37 @@ +package com.adc.da.workFlow.controller; + +import com.adc.da.http.ResponseMessage; +import com.adc.da.http.Result; +import com.adc.da.workFlow.service.ActSarLawsInformationEOService; +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/27 + */ +@Api("政策法规资料") +@RestController +@RequestMapping("/${restPath}/lawss/sarLawsTopic") +public class ActSarLawsInformationEOController { + + @Resource + private ActSarLawsInformationEOService informationEOService; + + @ApiOperation("政策法规资料入库") + @PostMapping("/processLawsRegulatoryInformation") + public ResponseMessage processCreateLawsInformation(String infoJson) throws Exception { + if (StringUtils.isBlank(infoJson)) { + return Result.error("传入数据json不能为空"); + } + informationEOService.processCreateLawsInformation(infoJson); + return Result.success("入库成功"); + } +} diff --git a/adc-da-activiti/src/main/java/com/adc/da/workFlow/service/ActSarLawsInformationEOService.java b/adc-da-activiti/src/main/java/com/adc/da/workFlow/service/ActSarLawsInformationEOService.java new file mode 100644 index 00000000..4a98ff62 --- /dev/null +++ b/adc-da-activiti/src/main/java/com/adc/da/workFlow/service/ActSarLawsInformationEOService.java @@ -0,0 +1,48 @@ +package com.adc.da.workFlow.service; + +import com.adc.da.slrs.sarLawsInformation.entity.SarLawsInformation; +import com.adc.da.slrs.sarLawsInformation.service.SarLawsInformationService; +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; + +/** + * @author tjzdw + * @description + * @date 2023/10/27 + */ +@Service +@Transactional(value = "transactionManager", readOnly = false, propagation = Propagation.REQUIRED, rollbackFor = Throwable.class) +public class ActSarLawsInformationEOService { + + @Resource + private SarLawsInformationService informationService; + + private static final Logger logger = LoggerFactory.getLogger(ActSarLawsInformationEOService.class); + + public void processCreateLawsInformation(String lawsInformationInfo) { + SarLawsInformation sarLawsInformation = JSONObject.parseObject(lawsInformationInfo, SarLawsInformation.class); + JSONObject jsonObject = JSONObject.parseObject(lawsInformationInfo); + String applyUserId = jsonObject.getString("applyUserId"); + String applyUserName = jsonObject.getString("applyUserName"); + String approverId = jsonObject.getString("approverId"); + String approverName = jsonObject.getString("approverName"); + String createAndApproveBy = ""; + // 判断发起人和审批人是否相同 + if (approverId.equals(applyUserId)) { + createAndApproveBy = applyUserName + "(" + applyUserId + ")"; + }else { + createAndApproveBy = applyUserName + "(" + applyUserId + ")," + approverName + "(" + approverId + ")"; + } + sarLawsInformation.setCreateAndApproveBy(createAndApproveBy); + sarLawsInformation.setDownloadableBy(createAndApproveBy); + sarLawsInformation.setViewableBy(createAndApproveBy); + logger.info("政策法规资料入库:" + sarLawsInformation); + informationService.addLawsInformation(sarLawsInformation); + } +} diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/entity/SarLawsInformation.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/entity/SarLawsInformation.java index edd27b26..5e66844c 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/entity/SarLawsInformation.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/entity/SarLawsInformation.java @@ -9,6 +9,7 @@ import java.io.Serializable; import java.util.Date; import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; @@ -26,78 +27,91 @@ public class SarLawsInformation extends BasePage implements Serializable { /** * 主键 */ + @ApiModelProperty(value = "主键") @TableId(value = "ID", type = IdType.ID_WORKER_STR) private String id; /** * 一级资料类别 */ + @ApiModelProperty("一级资料类别") @TableField(value = "FIRST_TYPE") private String firstType; /** * 一级资料类别名称 */ + @ApiModelProperty(value = "一级资料类别名称") @TableField(exist = false) private String firstTypeName; /** * 二级资料类别 */ + @ApiModelProperty(value = "二级资料类别") @TableField(value = "SECOND_TYPE") private String secondType; /** * 二级资料类别名称 */ + @ApiModelProperty(value = "二级资料类别名称") @TableField(exist = false) private String secondTypeName; /** * 三级资料类别 */ + @ApiModelProperty(value = "三级资料类别") @TableField(value = "THIRD_TYPE") private String thirdType; /** * 三级资料类别名称 */ + @ApiModelProperty(value = "三级资料类别名称") @TableField(exist = false) private String thirdTypeName; /** * 四级资料类别 */ + @ApiModelProperty(value = "四级资料类别") @TableField(value = "FOURTH_TYPE") private String fourthType; /** * 四级资料类别名称 */ + @ApiModelProperty(value = "四级资料类别名称") @TableField(exist = false) private String fourthTypeName; /** * 资料名称 */ + @ApiModelProperty(value = "资料名称") @TableField(value = "NAME") private String name; /** * 资料归属部门 */ + @ApiModelProperty(value = "资料归属部门") @TableField(value = "DEPARTMENT") private String department; /** * 作者 */ + @ApiModelProperty(value = "作者") @TableField(value = "AUTHOR") private String author; /** * 上传时间 */ + @ApiModelProperty(value = "上传时间") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") @TableField(value = "UPLOAD_TIME") @@ -106,59 +120,69 @@ public class SarLawsInformation extends BasePage implements Serializable { /** * 资料说明 */ + @ApiModelProperty(value = "资料说明") @TableField(value = "DESCRIPTION") private String description; /** * 资料文件 */ + @ApiModelProperty(value = "资料文件") @TableField(value = "INFORMATION_FILE") private String informationFile; /** * 资料文件名称 */ + @ApiModelProperty(value = "资料文件名称") @TableField(exist = false) private String informationFileName; /** * 可查看者,若设置为空则所有用户均可查看,若设置人员后,仅有可查看者可以查看文件信息。 */ + @ApiModelProperty(value = "可查看者") @TableField(value = "VIEWABLE_BY") private String viewableBy; /** * 可下载者,若设置为空则仅有上传人和审批人可以查看,若设置人员后,仅有可下载者可下载文件信息。 */ + @ApiModelProperty(value = "可下载者") @TableField(value = "DOWNLOADABLE_BY") private String downloadableBy; /** * 创建人和审批人 */ + @ApiModelProperty(value = "创建人和审批人") @TableField private String createAndApproveBy; /** * 树节点ID */ + @ApiModelProperty(value = "树节点ID") private String treeNodeId; /** * 树节点名称 */ + @ApiModelProperty(value = "树节点名称") @TableField(exist = false) private String treeNodeName; /** * 逻辑删除,0可用,1不可用 */ + @ApiModelProperty(value = "逻辑删除") @TableField(value = "VALID_FLAG") private Integer validFlag; /** * 创建时间 */ + @ApiModelProperty(value = "创建时间") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") @TableField(value = "CREATE_TIME") @@ -167,6 +191,7 @@ public class SarLawsInformation extends BasePage implements Serializable { /** * 修改时间 */ + @ApiModelProperty("修改时间") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") @TableField(value = "MODIFY_TIME") @@ -176,18 +201,21 @@ public class SarLawsInformation extends BasePage implements Serializable { /** * 排序字段 */ + @ApiModelProperty(value = "排序字段") @TableField(exist = false) private String sortField = "ID"; /** * 排序方式 */ + @ApiModelProperty(value = "排序方式") @TableField(exist = false) private String sortMode = "asc"; /** * 收藏ID */ + @ApiModelProperty(value = "收藏ID") @TableField(exist = false) private String collectId; diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/impl/SarLawsInformationServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/impl/SarLawsInformationServiceImpl.java index d0ee784d..c806097b 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/impl/SarLawsInformationServiceImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/impl/SarLawsInformationServiceImpl.java @@ -17,6 +17,7 @@ import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.adc.da.slrs.sarLawsInformation.entity.SarLawsInformation; import com.adc.da.slrs.sarLawsInformation.service.SarLawsInformationService; import com.adc.da.slrs.sarLawsInformation.dao.SarLawsInformationDao; +import io.swagger.annotations.ApiModelProperty; import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; @@ -173,7 +174,7 @@ public class SarLawsInformationServiceImpl extends ServiceImpl fileNameList = new ArrayList<>(); if (StringUtils.isNotBlank(newValue)) { @@ -226,10 +228,13 @@ public class SarLawsInformationServiceImpl extends ServiceImpl Date: Fri, 27 Oct 2023 16:13:43 +0800 Subject: [PATCH 28/31] =?UTF-8?q?add:=20=E5=86=85=E5=A4=96=E9=83=A8?= =?UTF-8?q?=E4=BC=9A=E8=AE=AE=E8=AF=A6=E6=83=85?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../entity/InsideOutsideMeeting.java | 18 ++- .../entity/InsideOutsideMeetingVO.java | 5 +- .../service/MeetingTopicService.java | 5 + .../impl/InsideOutsideMeetingServiceImpl.java | 111 +++++++++++++++++- .../service/impl/MeetingTopicServiceImpl.java | 63 ++++++++++ 5 files changed, 197 insertions(+), 5 deletions(-) diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutsideMeeting.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutsideMeeting.java index 8f783abc..8b7ab644 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutsideMeeting.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutsideMeeting.java @@ -1,5 +1,6 @@ package com.adc.da.slrs.InsideOntSideMeeting.entity; +import com.adc.da.att.entity.AttFileEO; import com.adc.da.base.entity.BaseEntity; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; @@ -38,7 +39,10 @@ public class InsideOutsideMeeting extends BaseEntity { @TableField("MEETING_NAME") private String meetingName; - @ApiModelProperty(value = "课题名称,可通过调取功能从政策课题模块中获取") + /** + * 课题名称,可通过调取功能从政策课题模块中获取 + */ + @ApiModelProperty(value = "课题名称") @TableField("TOPIC_NAME") private String topicName; @@ -63,6 +67,10 @@ public class InsideOutsideMeeting extends BaseEntity { @TableField("MEETING_MINUTES") private String meetingMinutes; + @ApiModelProperty(value = "会议纪要文件列表") + @TableField(exist = false) + private List meetingMinutesList; + @ApiModelProperty(value = "会议主要内容") @TableField("MEETING_CONTENT") private String meetingContent; @@ -71,6 +79,9 @@ public class InsideOutsideMeeting extends BaseEntity { @TableField("FIRST_MEETING_TYPE") private String firstMeetingType; + @ApiModelProperty(value = "1级会议类别名称") + private String firstMeetingTypeName; + @ApiModelProperty(value = "2级会议类别") @TableField("SECOND_MEETING_TYPE") private String secondMeetingType; @@ -79,7 +90,10 @@ public class InsideOutsideMeeting extends BaseEntity { @TableField(exist = false) private List meetingTopicList; - @ApiModelProperty(value = "逻辑删除,0可用,1不可用") + /** + * 逻辑删除,0可用,1不可用 + */ + @ApiModelProperty(value = "逻辑删除") @TableField("VALID_FLAG") private Integer validFlag; diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutsideMeetingVO.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutsideMeetingVO.java index 5abc9a15..a596e3eb 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutsideMeetingVO.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutsideMeetingVO.java @@ -1,9 +1,8 @@ package com.adc.da.slrs.InsideOntSideMeeting.entity; +import com.adc.da.att.entity.AttFileEO; import com.adc.da.base.page.BasePage; -import com.baomidou.mybatisplus.annotation.TableField; import com.fasterxml.jackson.annotation.JsonFormat; -import io.swagger.annotations.ApiModelProperty; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; @@ -39,6 +38,8 @@ public class InsideOutsideMeetingVO extends BasePage { private String meetingMinutes; + private List meetingMinutesList; + private String meetingContent; private String firstMeetingType; diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/MeetingTopicService.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/MeetingTopicService.java index ef1b06a5..ea79e3f9 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/MeetingTopicService.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/MeetingTopicService.java @@ -1,12 +1,17 @@ package com.adc.da.slrs.InsideOntSideMeeting.service; +import com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutsideMeeting; import com.adc.da.slrs.InsideOntSideMeeting.entity.MeetingTopic; import com.baomidou.mybatisplus.extension.service.IService; +import java.util.List; + /** * @author tjzdw * @description * @date 2023/10/13 */ public interface MeetingTopicService extends IService { + + public List compareMeetingTopic(InsideOutsideMeeting oldTopic, InsideOutsideMeeting newTopic); } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/impl/InsideOutsideMeetingServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/impl/InsideOutsideMeetingServiceImpl.java index 0dcee162..391aac06 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/impl/InsideOutsideMeetingServiceImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/impl/InsideOutsideMeetingServiceImpl.java @@ -1,5 +1,7 @@ package com.adc.da.slrs.InsideOntSideMeeting.service.impl; +import com.adc.da.att.entity.AttFileEO; +import com.adc.da.att.service.IAttFileEOService; import com.adc.da.common.FileUnZip; import com.adc.da.http.ResponseMessage; import com.adc.da.http.Result; @@ -9,10 +11,13 @@ 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.adc.da.slrs.sarLawsInformation.entity.SarLawsInformation; +import com.adc.da.slrs.tsDictionaryType.service.ITsDicTypeService; import com.adc.da.utils.util.FieldConvertUtil; 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 io.swagger.annotations.ApiModelProperty; import org.apache.commons.io.FileUtils; import org.apache.commons.lang3.StringUtils; import org.apache.poi.hssf.usermodel.HSSFDateUtil; @@ -25,6 +30,9 @@ import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import java.io.File; import java.io.IOException; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; @@ -40,6 +48,12 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl meetingMinutesList = new ArrayList<>(); + for (String attId : insideOutSideMeeting.getMeetingMinutes().split(",")) { + AttFileEO fileInfo = attFileEOService.getFileInfo(attId); + meetingMinutesList.add(fileInfo); + } + insideOutSideMeeting.setMeetingMinutesList(meetingMinutesList); + } LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); wrapper.eq(MeetingTopic::getMeetingId, meetingId); List meetingTopicList = meetingTopicService.list(wrapper); @@ -98,7 +120,18 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl queryAllMeeting(InsideOutsideMeetingVO insideOutsideMeetingVO) { - return this.baseMapper.queryAllMeeting(insideOutsideMeetingVO); + List insideOutsideMeetingVOList = this.baseMapper.queryAllMeeting(insideOutsideMeetingVO); + for (InsideOutsideMeetingVO meetingVO : insideOutsideMeetingVOList) { + if (StringUtils.isNotBlank(meetingVO.getMeetingMinutes())) { + List meetingMinutesList = new ArrayList<>(); + for (String attId : meetingVO.getMeetingMinutes().split(",")) { + AttFileEO fileInfo = attFileEOService.getFileInfo(attId); + meetingMinutesList.add(fileInfo); + } + meetingVO.setMeetingMinutesList(meetingMinutesList); + } + } + return insideOutsideMeetingVOList; } @Override @@ -320,4 +353,80 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl compareInsideOutsideMeeting(InsideOutsideMeeting oldMeeting, InsideOutsideMeeting newMeeting) { + List changes = new ArrayList<>(); + // 不需要比较的字段 + String[] ignoreFields = {"id","validFlag","createTime","modifyTime","meetingTopicList"}; + List ignoreFieldList = Arrays.asList(ignoreFields); + // 获取SarLawsInformation类的所有字段 + Field[] fields = SarLawsInformation.class.getDeclaredFields(); + for (Field field : fields) { + if (!ignoreFieldList.contains(field.getName())) { + try { + field.setAccessible(true); + String oldValue = String.valueOf(field.get(oldMeeting)); + String newValue = String.valueOf(field.get(newMeeting)); + if (!Objects.equals(oldValue, newValue)) { + if ("firstMeetingType".equals(field.getName()) || "secondMeetingType".equals(field.getName())) { + String typeName = ""; + if (StringUtils.isNotBlank(newValue)) { + typeName = dicTypeService.getDicTypeNameByDicCode(newValue); + } + // 获取资料类型名称 + String fieldName = field.getName().substring(0, 1).toUpperCase() + field.getName().substring(1); + Method method = SarLawsInformation.class.getMethod("get" + fieldName + "Name"); + Object oldTypeName = method.invoke(oldMeeting); + ApiModelProperty annotationsByType = field.getAnnotationsByType(ApiModelProperty.class)[0]; + changes.add(annotationsByType.value() + "由\"" + oldTypeName + "\"改为\"" + typeName + "\""); + } else if ("meetingMinutes".equals(field.getName())) { + List fileNameList = new ArrayList<>(); + if (StringUtils.isNotBlank(newValue)) { + String[] split = newValue.split(","); + for (String attId : split) { + AttFileEO fileInfo = attFileEOService.getFileInfo(attId); + fileNameList.add(fileInfo.getOldFileName()); + } + } + // 获取资料类型名称 + String fieldName = field.getName().substring(0, 1).toUpperCase() + field.getName().substring(1); + Method method = SarLawsInformation.class.getMethod("get" + fieldName + "Name"); + Object oldTypeName = method.invoke(oldMeeting); + // 获取字段名称 + ApiModelProperty annotationsByType = field.getAnnotationsByType(ApiModelProperty.class)[0]; + changes.add(annotationsByType.value() + "由\"" + oldTypeName + "\"改为\"" + String.join(",",fileNameList) + "\""); + } + else if ("meetingTopicList".equals(field.getName())) { +// // 获取会议列表内容 +// String fieldName = field.getName().substring(0, 1).toUpperCase() + field.getName().substring(1); +// Method method = SarLawsInformation.class.getMethod("get" + fieldName); +// List oldMeetingTopicList = (List)method.invoke(oldMeeting); +// List newMeetingTopicList = (List)method.invoke(newMeeting); +// for (Object meetingTopic : oldMeetingTopicList) { +// meetingTopicService.compareMeetingTopic(meetingTopic, oldMeeting); +// } + + ApiModelProperty annotationsByType = field.getAnnotationsByType(ApiModelProperty.class)[0]; + changes.add(annotationsByType.value() + "由\"" + oldValue + "\"改为\"" + newValue + "\""); + } + else { + ApiModelProperty annotationsByType = field.getAnnotationsByType(ApiModelProperty.class)[0]; + changes.add(annotationsByType.value() + "由\"" + oldValue + "\"改为\"" + newValue + "\""); + } + } + } catch (IllegalAccessException | NoSuchMethodException | InvocationTargetException e) { + // 处理异常 + e.printStackTrace(); + } + } + } + return changes; + } } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/impl/MeetingTopicServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/impl/MeetingTopicServiceImpl.java index f07636a7..3c0fbc76 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/impl/MeetingTopicServiceImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/impl/MeetingTopicServiceImpl.java @@ -1,11 +1,26 @@ package com.adc.da.slrs.InsideOntSideMeeting.service.impl; +import com.adc.da.att.entity.AttFileEO; +import com.adc.da.att.service.IAttFileEOService; import com.adc.da.slrs.InsideOntSideMeeting.dao.MeetingTopicDao; +import com.adc.da.slrs.InsideOntSideMeeting.entity.InsideOutsideMeeting; import com.adc.da.slrs.InsideOntSideMeeting.entity.MeetingTopic; import com.adc.da.slrs.InsideOntSideMeeting.service.MeetingTopicService; +import com.adc.da.slrs.sarLawsInformation.entity.SarLawsInformation; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; +import io.swagger.annotations.ApiModelProperty; +import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; +import javax.annotation.Resource; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; +import java.lang.reflect.Method; +import java.util.ArrayList; +import java.util.Arrays; +import java.util.List; +import java.util.Objects; + /** * @author tjzdw * @description @@ -13,4 +28,52 @@ import org.springframework.stereotype.Service; */ @Service public class MeetingTopicServiceImpl extends ServiceImpl implements MeetingTopicService { + + @Resource + private IAttFileEOService attFileEOService; + + @Override + public List compareMeetingTopic(InsideOutsideMeeting oldTopic, InsideOutsideMeeting newTopic) { + List changes = new ArrayList<>(); + // 不需要比较的字段 + String[] ignoreFields = {"id","meetingId","validFlag","createTime","modifyTime"}; + List ignoreFieldList = Arrays.asList(ignoreFields); + // 获取SarLawsInformation类的所有字段 + Field[] fields = SarLawsInformation.class.getDeclaredFields(); + for (Field field : fields) { + if (!ignoreFieldList.contains(field.getName())) { + try { + field.setAccessible(true); + String oldValue = String.valueOf(field.get(oldTopic)); + String newValue = String.valueOf(field.get(newTopic)); + if (!Objects.equals(oldValue, newValue)) { + if ("agendaMaterials".equals(field.getName())) { + List fileNameList = new ArrayList<>(); + if (StringUtils.isNotBlank(newValue)) { + String[] split = newValue.split(","); + for (String attId : split) { + AttFileEO fileInfo = attFileEOService.getFileInfo(attId); + fileNameList.add(fileInfo.getOldFileName()); + } + } + // 获取文件名称 + String fieldName = field.getName().substring(0, 1).toUpperCase() + field.getName().substring(1); + Method method = SarLawsInformation.class.getMethod("get" + fieldName + "Name"); + Object oldTypeName = method.invoke(oldTopic); + // 获取字段名称 + ApiModelProperty annotationsByType = field.getAnnotationsByType(ApiModelProperty.class)[0]; + changes.add(annotationsByType.value() + "由\"" + oldTypeName + "\"改为\"" + String.join(",",fileNameList) + "\""); + } else { + ApiModelProperty annotationsByType = field.getAnnotationsByType(ApiModelProperty.class)[0]; + changes.add(annotationsByType.value() + "由\"" + oldValue + "\"改为\"" + newValue + "\""); + } + } + } catch (IllegalAccessException | NoSuchMethodException | InvocationTargetException e) { + // 处理异常 + e.printStackTrace(); + } + } + } + return changes; + } } From 40ded57e5bc5ffe93a06943e1b979b7924e6098d Mon Sep 17 00:00:00 2001 From: wxyclub Date: Mon, 30 Oct 2023 09:12:32 +0800 Subject: [PATCH 29/31] =?UTF-8?q?add:=20=E6=94=BF=E7=AD=96=E5=AF=BC?= =?UTF-8?q?=E5=85=A5=E5=AF=BC=E5=87=BA?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../adc/da/login/security/WebMvcConfig.java | 7 + .../InsideOutSideMeetingController.java | 95 +++- .../entity/InsideOutsideMeeting.java | 5 + .../entity/InsideOutsideMeetingVO.java | 16 + .../entity/MeetingTopic.java | 22 +- .../impl/InsideOutsideMeetingServiceImpl.java | 288 +++++++----- .../service/impl/MeetingTopicServiceImpl.java | 2 +- .../SarLawsInformationController.java | 145 ++++++ .../dao/SarLawsInformationDao.java | 2 + .../entity/SarLawsInformation.java | 25 +- .../service/SarLawsInformationService.java | 18 + .../impl/SarLawsInformationServiceImpl.java | 280 +++++++++++- .../controller/SarLawsTopicController.java | 146 +++++++ .../sarLawsTopic/dao/SarLawsTopicMapper.java | 5 + .../entity/SarLawsContactInformation.java | 6 + .../sarLawsTopic/entity/SarLawsTopic.java | 84 ++-- .../entity/SarLawsTopicMeeting.java | 8 +- .../sarLawsTopic/entity/SarLawsTopicVO.java | 40 ++ .../service/SarLawsTopicService.java | 9 + .../service/impl/SarLawsTopicServiceImpl.java | 411 +++++++++++++++--- .../tsDictionaryType/dao/TsDicTypeDao.java | 4 + .../service/ITsDicTypeService.java | 8 + .../service/impl/TsDicTypeServiceImpl.java | 6 + .../adc/da/utils/util/ExcelExportUtil.java | 112 +++++ .../adc/da/utils/util/FieldConvertUtil.java | 13 + .../util/InsideOutsideMeetingExportUtil.java | 4 +- .../InsideOntSideMeeting.xml | 5 +- .../SarLawsInformationMapper.xml | 8 + .../sarLawsTopic/SarLawsTopicMapper.xml | 24 +- .../tsDictionaryType/TsDicTypeMapper.xml | 9 + 30 files changed, 1564 insertions(+), 243 deletions(-) create mode 100644 adc-da-slrs/src/main/java/com/adc/da/utils/util/ExcelExportUtil.java diff --git a/adc-da-jwtLogin/src/main/java/com/adc/da/login/security/WebMvcConfig.java b/adc-da-jwtLogin/src/main/java/com/adc/da/login/security/WebMvcConfig.java index 5617a2d5..4bca8743 100644 --- a/adc-da-jwtLogin/src/main/java/com/adc/da/login/security/WebMvcConfig.java +++ b/adc-da-jwtLogin/src/main/java/com/adc/da/login/security/WebMvcConfig.java @@ -188,6 +188,13 @@ public class WebMvcConfig implements WebMvcConfigurer { // 标准法规库-企标计划导出接口 addInterceptor.excludePathPatterns("/api/esRevisePlan/es-revise-plan/exportEsRevisePlanInfoExcel"); + // 内外部会议导出接口 + addInterceptor.excludePathPatterns("/api/lawss/insideOutsideMeeting/exportMeetingInfo"); + + // 政策课题导出接口 + addInterceptor.excludePathPatterns("/api/lawss/sarLawsTopic/exportLawsTopicInfo"); + + addInterceptor.excludePathPatterns("/api/lawss/sarLawsInformation/exportLawsInformationInfo"); // // 添加自定义拦截器,并拦截对应 url addInterceptor.addPathPatterns("/**"); diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/controller/InsideOutSideMeetingController.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/controller/InsideOutSideMeetingController.java index ba820d17..b0b3895a 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/controller/InsideOutSideMeetingController.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/controller/InsideOutSideMeetingController.java @@ -1,6 +1,10 @@ package com.adc.da.slrs.InsideOntSideMeeting.controller; +import cn.afterturn.easypoi.excel.ExcelExportUtil; +import cn.afterturn.easypoi.excel.entity.ExportParams; +import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; import cn.hutool.core.util.StrUtil; +import cn.hutool.core.util.ZipUtil; import com.adc.da.base.web.BaseController; import com.adc.da.common.ReadExcel; import com.adc.da.exception.AdcDaBaseException; @@ -10,22 +14,27 @@ import com.adc.da.http.Result; 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 com.adc.da.utils.util.InsideOutsideMeetingExportUtil; +import com.adc.da.util.UUIDUtils; +import com.adc.da.utils.util.FieldConvertUtil; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; -import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.hssf.usermodel.HSSFCellStyle; +import org.apache.poi.hssf.usermodel.HSSFSheet; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.ss.usermodel.*; +import org.apache.poi.ss.util.CellRangeAddress; import org.apache.poi.util.IOUtils; import org.slf4j.Logger; import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; -import java.io.IOException; -import java.io.OutputStream; +import java.io.*; import java.text.ParseException; import java.util.Arrays; import java.util.List; @@ -44,6 +53,9 @@ public class InsideOutSideMeetingController extends BaseController getMeetingInfo(String meetingId){ @@ -110,7 +122,11 @@ public class InsideOutSideMeetingController extends BaseController meetingTopicList; diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutsideMeetingVO.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutsideMeetingVO.java index a596e3eb..d4297649 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutsideMeetingVO.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/InsideOutsideMeetingVO.java @@ -1,5 +1,7 @@ package com.adc.da.slrs.InsideOntSideMeeting.entity; +import cn.afterturn.easypoi.excel.annotation.Excel; +import cn.afterturn.easypoi.excel.annotation.ExcelCollection; import com.adc.da.att.entity.AttFileEO; import com.adc.da.base.page.BasePage; import com.fasterxml.jackson.annotation.JsonFormat; @@ -22,17 +24,23 @@ public class InsideOutsideMeetingVO extends BasePage { private String id; + @Excel(name = "会议名称", needMerge = true) private String meetingName; + @Excel(name = "课题名称", needMerge = true) private String topicName; + @Excel(name = "会议主办单位", needMerge = true) private String meetingOrganizer; @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") + @Excel(name = "会议时间", exportFormat = "yyyy-MM-dd", needMerge = true) private Date meetingTime; + @Excel(name = "会议地点", needMerge = true) private String meetingAddress; + @Excel(name = "参会人员", needMerge = true) private String participants; private List participantsList; @@ -40,12 +48,20 @@ public class InsideOutsideMeetingVO extends BasePage { private List meetingMinutesList; + @Excel(name = "会议主要内容", needMerge = true) private String meetingContent; private String firstMeetingType; + @Excel(name = "1级会议类别", needMerge = true) + private String firstMeetingTypeName; + private String secondMeetingType; + @Excel(name = "2级会议类别", needMerge = true) + private String secondMeetingTypeName; + + @ExcelCollection(name = "会议议题") private List meetingTopicList; private String agendaName; diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/MeetingTopic.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/MeetingTopic.java index f030a1bc..dd9435f5 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/MeetingTopic.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/entity/MeetingTopic.java @@ -1,19 +1,17 @@ package com.adc.da.slrs.InsideOntSideMeeting.entity; +import cn.afterturn.easypoi.excel.annotation.Excel; 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; import lombok.Data; import lombok.EqualsAndHashCode; import lombok.experimental.Accessors; -import java.util.Date; - /** * @author tjzdw * @description @@ -36,6 +34,7 @@ public class MeetingTopic extends BaseEntity { @ApiModelProperty(value = "议题名称") @TableField("AGENDA_NAME") + @Excel(name = "议题名称") private String agendaName; @ApiModelProperty(value = "议题材料") @@ -44,27 +43,16 @@ public class MeetingTopic extends BaseEntity { @ApiModelProperty(value = "汇报人") @TableField("REPORTER") + @Excel(name = "汇报人") private String reporter; @ApiModelProperty(value = "汇报单位") @TableField("REPORTING_UNIT") + @Excel(name = "汇报单位") private String reportingUnit; @ApiModelProperty(value = "议题主要内容") @TableField("AGENDA_CONTENT") + @Excel(name = "议题主要内容") private String agendaContent; - - @ApiModelProperty(value = "逻辑删除,0可用,1不可用") - @TableField("VALID_FLAG") - private Integer validFlag; - - @ApiModelProperty(value = "创建时间") - @TableField("CREATE_TIME") - @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") - private Date createTime; - - @ApiModelProperty(value = "修改时间") - @TableField("MODIFY_TIME") - @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") - private Date modifyTime; } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/impl/InsideOutsideMeetingServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/impl/InsideOutsideMeetingServiceImpl.java index 391aac06..d3305cc3 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/impl/InsideOutsideMeetingServiceImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/InsideOntSideMeeting/service/impl/InsideOutsideMeetingServiceImpl.java @@ -12,7 +12,12 @@ 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.adc.da.slrs.sarLawsInformation.entity.SarLawsInformation; +import com.adc.da.slrs.sarUpdLog.entity.SarUpdLog; +import com.adc.da.slrs.sarUpdLog.service.ISarUpdLogService; +import com.adc.da.slrs.tsDictionaryType.entity.TsDicType; import com.adc.da.slrs.tsDictionaryType.service.ITsDicTypeService; +import com.adc.da.util.LoginUserUtil; +import com.adc.da.util.UUIDUtils; import com.adc.da.utils.util.FieldConvertUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; @@ -36,6 +41,7 @@ import java.lang.reflect.Method; import java.text.ParseException; import java.text.SimpleDateFormat; import java.util.*; +import java.util.stream.Collectors; /** * @author tjzdw @@ -47,34 +53,38 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl meetingMinutesList = new ArrayList<>(); - for (String attId : insideOutSideMeeting.getMeetingMinutes().split(",")) { + for (String attId : insideOutsideMeeting.getMeetingMinutes().split(",")) { AttFileEO fileInfo = attFileEOService.getFileInfo(attId); meetingMinutesList.add(fileInfo); } - insideOutSideMeeting.setMeetingMinutesList(meetingMinutesList); + insideOutsideMeeting.setMeetingMinutesList(meetingMinutesList); } + // 获取会议类别值 + getTypeByCode(insideOutsideMeeting); + // 获取会议课题列表 LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); wrapper.eq(MeetingTopic::getMeetingId, meetingId); List meetingTopicList = meetingTopicService.list(wrapper); - insideOutSideMeeting.setMeetingTopicList(meetingTopicList); + insideOutsideMeeting.setMeetingTopicList(meetingTopicList); } - return insideOutSideMeeting; + return insideOutsideMeeting; } @Transactional @@ -85,73 +95,78 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl topicWrapper = new LambdaUpdateWrapper<>(); + LambdaQueryWrapper topicWrapper = new LambdaQueryWrapper<>(); topicWrapper.eq(MeetingTopic::getMeetingId, meetingId); - topicWrapper.set(MeetingTopic::getValidFlag,1); - meetingTopicService.update(topicWrapper); + meetingTopicService.remove(topicWrapper); } return update; } @Transactional @Override - public Boolean updateMeetingInfo(InsideOutsideMeeting insideOutSideMeeting) { - if (StringUtils.isBlank(insideOutSideMeeting.getId())) { + 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) { - LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); - wrapper.eq(MeetingTopic::getMeetingId,insideOutSideMeeting.getId()); - // 先删除会议信息 - meetingTopicService.remove(wrapper); - // 再添加会议信息 - for (MeetingTopic meetingTopic : insideOutSideMeeting.getMeetingTopicList()) { - meetingTopic.setCreateTime(new Date()); - meetingTopic.setModifyTime(new Date()); - meetingTopic.setValidFlag(0); - meetingTopic.setMeetingId(insideOutSideMeeting.getId()); - meetingTopicService.save(meetingTopic); + InsideOutsideMeeting insideOutsideMeetingDB = this.baseMapper.selectById(insideOutsideMeeting.getId()); + List diffList = compareInsideOutsideMeeting(insideOutsideMeetingDB, insideOutsideMeeting); + if (diffList.size() > 0) { + insideOutsideMeeting.setModifyTime(new Date()); + int update = this.baseMapper.updateById(insideOutsideMeeting); + if (update > 0) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.eq(MeetingTopic::getMeetingId,insideOutsideMeeting.getId()); + // 先删除会议信息 + meetingTopicService.remove(wrapper); + // 再添加会议信息 + for (MeetingTopic meetingTopic : insideOutsideMeeting.getMeetingTopicList()) { + meetingTopic.setMeetingId(insideOutsideMeeting.getId()); + meetingTopicService.save(meetingTopic); + } + // 存储修改记录 + SarUpdLog sarUpdLogEO = new SarUpdLog(); + sarUpdLogEO.setId(UUIDUtils.randomUUID20()); + sarUpdLogEO.setSarId(insideOutsideMeetingDB.getId()); + sarUpdLogEO.setSarType("INSIDE_OUTSIDE_MEETING"); + sarUpdLogEO.setCreationTime(new Date()); + sarUpdLogEO.setCreationUser(LoginUserUtil.getUserId()); + sarUpdLogEO.setContent(insideOutsideMeetingDB.getMeetingName() + "," + String.join(",",diffList)); + updLogService.save(sarUpdLogEO); } } return true; } + // 用于Excel文件导出 @Override public List queryAllMeeting(InsideOutsideMeetingVO insideOutsideMeetingVO) { List insideOutsideMeetingVOList = this.baseMapper.queryAllMeeting(insideOutsideMeetingVO); for (InsideOutsideMeetingVO meetingVO : insideOutsideMeetingVOList) { - if (StringUtils.isNotBlank(meetingVO.getMeetingMinutes())) { - List meetingMinutesList = new ArrayList<>(); - for (String attId : meetingVO.getMeetingMinutes().split(",")) { - AttFileEO fileInfo = attFileEOService.getFileInfo(attId); - meetingMinutesList.add(fileInfo); - } - meetingVO.setMeetingMinutesList(meetingMinutesList); - } + // 获取会议类别值 + getTypeByCode(meetingVO); } return insideOutsideMeetingVOList; } @Override public List queryMeetingById(List exportIdList) { - return this.baseMapper.queryMeetingById(exportIdList); + List insideOutsideMeetingVOList = this.baseMapper.queryMeetingById(exportIdList); + for (InsideOutsideMeetingVO meetingVO : insideOutsideMeetingVOList) { + getTypeByCode(meetingVO); + } + return insideOutsideMeetingVOList; } @Transactional @Override - public Integer addMeetingInfo(InsideOutsideMeeting insideOutSideMeeting) { - insideOutSideMeeting.setCreateTime(new Date()); - insideOutSideMeeting.setModifyTime(new Date()); - insideOutSideMeeting.setValidFlag(0); - 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); + public Integer addMeetingInfo(InsideOutsideMeeting insideOutsideMeeting) { + insideOutsideMeeting.setCreateTime(new Date()); + insideOutsideMeeting.setModifyTime(new Date()); + insideOutsideMeeting.setValidFlag(0); + int insert = this.baseMapper.insert(insideOutsideMeeting); + if (!insideOutsideMeeting.getMeetingTopicList().isEmpty()) { + for (MeetingTopic meetingTopic : insideOutsideMeeting.getMeetingTopicList()) { + meetingTopic.setMeetingId(insideOutsideMeeting.getId()); meetingTopicService.save(meetingTopic); } } @@ -174,7 +189,21 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl insideOutsideMeetingVOList = this.baseMapper.queryByPage(page); + for (InsideOutsideMeetingVO insideOutsideMeeting : insideOutsideMeetingVOList) { + // 获取会议纪要文件对象 + if (StringUtils.isNotBlank(insideOutsideMeeting.getMeetingMinutes())) { + List meetingMinutesList = new ArrayList<>(); + for (String attId : insideOutsideMeeting.getMeetingMinutes().split(",")) { + AttFileEO fileInfo = attFileEOService.getFileInfo(attId); + meetingMinutesList.add(fileInfo); + } + insideOutsideMeeting.setMeetingMinutesList(meetingMinutesList); + } + // 获取会议类别值 + getTypeByCode(insideOutsideMeeting); + } + return insideOutsideMeetingVOList; } @Override @@ -282,6 +311,9 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl 500) { + return Result.error("单元格输入过长"); + } rowMap.put(headerCell.getStringCellValue(), cell.getStringCellValue()); } } else { @@ -290,50 +322,81 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl stringStringMap : importDataList) { - LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); - wrapper.eq(InsideOutsideMeeting::getMeetingName, stringStringMap.get("会议名称")); - List insideOutsideMeetingList = this.baseMapper.selectList(wrapper); - if (insideOutsideMeetingList.size() > 0) { - InsideOutsideMeeting insideOutsideMeeting = insideOutsideMeetingList.get(0); + + // 获取需要校验的字段 + List firstMeetingTypeList = dicTypeService.selectAllDicTypeNameByDicCode("firstMeetingType"); + Set firstMeetingTypeNameSet = firstMeetingTypeList.stream().map(TsDicType::getDicTypeName).collect(Collectors.toSet()); + List secondMeetingTypeList = dicTypeService.selectAllDicTypeNameByDicCode("secondMeetingType"); + Set secondMeetingTypeNameSet = secondMeetingTypeList.stream().map(TsDicType::getDicTypeName).collect(Collectors.toSet()); + // 计数器,用于处理出现多条会议课题的情况 + int count = 0; +// InsideOutsideMeeting insideOutsideMeetingDB = null; + InsideOutsideMeeting insideOutsideMeeting = new InsideOutsideMeeting(); + List meetingTopicList = new ArrayList<>(); + for (Map dataMap : importDataList) { + String meetingName = dataMap.get("会议名称"); + // 如果会议名称为空,则表示该行为会议课题行,是之前会议的会议课题,不提交之前的会议信息。不为空则进入 + if (StringUtils.isNotBlank(meetingName)) { + // 如果计数器大于0,表示进入了新的会议信息中,提交之前的会议信息 + if (count > 0) { + insideOutsideMeeting.setMeetingTopicList(meetingTopicList); + addMeetingInfo(insideOutsideMeeting); + // 初始化会议课题列表 + meetingTopicList.clear(); + // 初始化会议对象 + insideOutsideMeeting = new InsideOutsideMeeting(); + // 计数器归零 + count = 0; + } + insideOutsideMeeting.setMeetingName(meetingName); + insideOutsideMeeting.setTopicName(dataMap.get("课题名称")); + insideOutsideMeeting.setMeetingOrganizer(dataMap.get("会议主办单位")); + insideOutsideMeeting.setMeetingTime(sdf.parse(dataMap.get("会议时间"))); + insideOutsideMeeting.setMeetingAddress(dataMap.get("会议地点")); + insideOutsideMeeting.setParticipants(dataMap.get("参会人员")); + insideOutsideMeeting.setMeetingContent(dataMap.get("会议主要内容")); + if (StringUtils.isNotBlank(dataMap.get("一级会议类别"))) { + if (!firstMeetingTypeNameSet.contains(dataMap.get("一级会议类别"))){ + return Result.error("一级会议类别不符合输入要求"); + } + for (TsDicType tsDicType : firstMeetingTypeList) { + if (dataMap.get("一级会议类别").equals(tsDicType.getDicTypeName())) { + insideOutsideMeeting.setFirstMeetingType(tsDicType.getDicTypeCode()); + } + } + } + if (StringUtils.isNotBlank(dataMap.get("二级会议类别"))) { + if (!secondMeetingTypeNameSet.contains(dataMap.get("二级会议类别"))){ + return Result.error("二级会议类别不符合输入要求"); + } + for (TsDicType tsDicType : secondMeetingTypeList) { + if (dataMap.get("二级会议类别").equals(tsDicType.getDicTypeName())) { + insideOutsideMeeting.setSecondMeetingType(tsDicType.getDicTypeCode()); + } + } + } + // 会议课题信息 MeetingTopic meetingTopic = new MeetingTopic(); - meetingTopic.setAgendaName(stringStringMap.get("议题名称")); - meetingTopic.setReporter("汇报人"); - meetingTopic.setReportingUnit("汇报单位"); - meetingTopic.setAgendaContent("议题主要内容"); - meetingTopic.setValidFlag(0); - meetingTopic.setMeetingId(insideOutsideMeeting.getId()); - meetingTopic.setCreateTime(new Date()); - meetingTopic.setModifyTime(new Date()); - meetingTopicService.save(meetingTopic); + meetingTopic.setAgendaName(dataMap.get("议题名称")); + meetingTopic.setReporter(dataMap.get("汇报人")); + meetingTopic.setReportingUnit(dataMap.get("汇报单位")); + meetingTopic.setAgendaContent(dataMap.get("议题主要内容")); + meetingTopicList.add(meetingTopic); + count++; } else { - InsideOutsideMeeting insideOutsideMeeting = new InsideOutsideMeeting(); - insideOutsideMeeting.setMeetingTopicList(new ArrayList<>()); - insideOutsideMeeting.setMeetingName(stringStringMap.get("会议名称")); - insideOutsideMeeting.setTopicName(stringStringMap.get("课题名称")); - insideOutsideMeeting.setMeetingOrganizer(stringStringMap.get("会议主办单位")); - insideOutsideMeeting.setMeetingTime(sdf.parse(stringStringMap.get("会议时间"))); - insideOutsideMeeting.setMeetingAddress(stringStringMap.get("会议地点")); - insideOutsideMeeting.setParticipants(stringStringMap.get("参会人员")); - insideOutsideMeeting.setMeetingContent(stringStringMap.get("会议主要内容")); - insideOutsideMeeting.setFirstMeetingType(stringStringMap.get("一级会议类别")); - insideOutsideMeeting.setSecondMeetingType(stringStringMap.get("二级会议类别")); - insideOutsideMeeting.setValidFlag(0); - insideOutsideMeeting.setCreateTime(new Date()); - insideOutsideMeeting.setModifyTime(new Date()); - this.baseMapper.insert(insideOutsideMeeting); + // 进入else 表示该行是会议课题行 MeetingTopic meetingTopic = new MeetingTopic(); - meetingTopic.setAgendaName(stringStringMap.get("议题名称")); - meetingTopic.setReporter("汇报人"); - meetingTopic.setReportingUnit("汇报单位"); - meetingTopic.setAgendaContent("议题主要内容"); - meetingTopic.setValidFlag(0); - meetingTopic.setMeetingId(insideOutsideMeeting.getId()); - meetingTopic.setCreateTime(new Date()); - meetingTopic.setModifyTime(new Date()); - meetingTopicService.save(meetingTopic); + meetingTopic.setAgendaName(dataMap.get("议题名称")); + meetingTopic.setReporter(dataMap.get("汇报人")); + meetingTopic.setReportingUnit(dataMap.get("汇报单位")); + meetingTopic.setAgendaContent(dataMap.get("议题主要内容")); + meetingTopicList.add(meetingTopic); + count++; } } + // 插入最后一条记录 + insideOutsideMeeting.setMeetingTopicList(meetingTopicList); + addMeetingInfo(insideOutsideMeeting); return Result.success("导入完成"); } @@ -364,10 +427,10 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl compareInsideOutsideMeeting(InsideOutsideMeeting oldMeeting, InsideOutsideMeeting newMeeting) { List changes = new ArrayList<>(); // 不需要比较的字段 - String[] ignoreFields = {"id","validFlag","createTime","modifyTime","meetingTopicList"}; + String[] ignoreFields = {"id","validFlag","createTime","modifyTime", "firstMeetingTypeName", "secondMeetingTypeName"}; List ignoreFieldList = Arrays.asList(ignoreFields); // 获取SarLawsInformation类的所有字段 - Field[] fields = SarLawsInformation.class.getDeclaredFields(); + Field[] fields = InsideOutsideMeeting.class.getDeclaredFields(); for (Field field : fields) { if (!ignoreFieldList.contains(field.getName())) { try { @@ -382,7 +445,7 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl oldFileList = (List)method.invoke(oldMeeting); + List oldFileNameList = new ArrayList<>(); + if (oldFileList != null && oldFileList.size() > 0) { + for (Object oldFile : oldFileList) { + AttFileEO oldFile1 = (AttFileEO) oldFile; + oldFileNameList.add(oldFile1.getOldFileName()); + } + } // 获取字段名称 ApiModelProperty annotationsByType = field.getAnnotationsByType(ApiModelProperty.class)[0]; - changes.add(annotationsByType.value() + "由\"" + oldTypeName + "\"改为\"" + String.join(",",fileNameList) + "\""); + changes.add(annotationsByType.value() + "由\"" + String.join(",",oldFileNameList) + "\"改为\"" + String.join(",",fileNameList) + "\""); } else if ("meetingTopicList".equals(field.getName())) { -// // 获取会议列表内容 -// String fieldName = field.getName().substring(0, 1).toUpperCase() + field.getName().substring(1); -// Method method = SarLawsInformation.class.getMethod("get" + fieldName); -// List oldMeetingTopicList = (List)method.invoke(oldMeeting); -// List newMeetingTopicList = (List)method.invoke(newMeeting); -// for (Object meetingTopic : oldMeetingTopicList) { -// meetingTopicService.compareMeetingTopic(meetingTopic, oldMeeting); -// } - ApiModelProperty annotationsByType = field.getAnnotationsByType(ApiModelProperty.class)[0]; - changes.add(annotationsByType.value() + "由\"" + oldValue + "\"改为\"" + newValue + "\""); + changes.add(annotationsByType.value() + "被变更"); } else { ApiModelProperty annotationsByType = field.getAnnotationsByType(ApiModelProperty.class)[0]; @@ -429,4 +490,23 @@ public class InsideOutsideMeetingServiceImpl extends ServiceImpl compareMeetingTopic(InsideOutsideMeeting oldTopic, InsideOutsideMeeting newTopic) { List changes = new ArrayList<>(); // 不需要比较的字段 - String[] ignoreFields = {"id","meetingId","validFlag","createTime","modifyTime"}; + String[] ignoreFields = {"id","meetingId"}; List ignoreFieldList = Arrays.asList(ignoreFields); // 获取SarLawsInformation类的所有字段 Field[] fields = SarLawsInformation.class.getDeclaredFields(); diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/controller/SarLawsInformationController.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/controller/SarLawsInformationController.java index ba9f4f7d..54b6a43d 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/controller/SarLawsInformationController.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/controller/SarLawsInformationController.java @@ -1,17 +1,41 @@ package com.adc.da.slrs.sarLawsInformation.controller; +import cn.afterturn.easypoi.excel.ExcelExportUtil; +import cn.afterturn.easypoi.excel.entity.ExportParams; +import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; +import cn.hutool.core.util.StrUtil; +import cn.hutool.core.util.ZipUtil; import com.adc.da.base.web.BaseController; +import com.adc.da.common.ReadExcel; +import com.adc.da.exception.AdcDaBaseException; import com.adc.da.http.PageInfo; import com.adc.da.http.ResponseMessage; import com.adc.da.http.Result; import com.adc.da.slrs.sarLawsInformation.entity.SarLawsInformation; import com.adc.da.slrs.sarLawsInformation.service.SarLawsInformationService; +import com.adc.da.util.UUIDUtils; +import com.adc.da.utils.util.FieldConvertUtil; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; +import org.apache.poi.hssf.usermodel.HSSFCellStyle; +import org.apache.poi.hssf.usermodel.HSSFSheet; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.ss.usermodel.*; +import org.apache.poi.ss.util.CellRangeAddress; +import org.apache.poi.util.IOUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.*; +import java.text.ParseException; +import java.util.Arrays; import java.util.List; /** @@ -23,9 +47,14 @@ import java.util.List; @RequestMapping("/${restPath}/lawss/sarLawsInformation") public class SarLawsInformationController extends BaseController { + private static final Logger logger = LoggerFactory.getLogger(SarLawsInformationController.class); + @Resource private SarLawsInformationService informationService; + @Value("${file.path}") + private String filePath; + @ApiOperation(value = "根据政策资料ID查询资料信息") @GetMapping("/getLawsInformationInfo") public ResponseMessage getLawsInformationInfo(String id){ @@ -69,4 +98,120 @@ public class SarLawsInformationController extends BaseController exportLawsInformationInfo(SarLawsInformation sarLawsInformation, HttpServletResponse response, + HttpServletRequest request) { + OutputStream os = null; + Workbook workbook = null; + List datas; + try { + if(StringUtils.isEmpty(sarLawsInformation.getExportName())||sarLawsInformation.getExportName().equals("null")){ + sarLawsInformation.setExportName("政策法规资料信息"); + } + response.setHeader("Content-Disposition", + "attachment; filename=" + ReadExcel.encodeFileName(sarLawsInformation.getExportName()+".xlsx", + request)); + // 导出数据,若指定了值则使用ids字段条件导出,否则根据条件导出 + if (StrUtil.isNotBlank(sarLawsInformation.getExportIds())) { + List idList = Arrays.asList(sarLawsInformation.getExportIds().split(",")); + datas = informationService.getLawsInformationByIds(idList); + } else { + // 导出所有数据 + datas = informationService.getAllLawsInformation(sarLawsInformation); + } + ExportParams exportParams = new ExportParams(); + exportParams.setType(ExcelType.XSSF); + exportParams.setSheetName(sarLawsInformation.getExportName()); + workbook = ExcelExportUtil.exportExcel(exportParams,SarLawsInformation.class,datas); + os = response.getOutputStream(); + workbook.write(os); + os.flush(); + } catch (IOException e) { + logger.error(e.getMessage(), e); + throw new AdcDaBaseException("下载文件失败,请重试"); + } finally { + IOUtils.closeQuietly(os); + } + return Result.success(); + } + + @ApiOperation("Excel文件导入政策资料信息") + @PostMapping("/importLawsInformationInfo") + public ResponseMessage importLawsInformationInfo(@RequestParam(value = "file",required = false) MultipartFile file) throws ParseException { + if (file == null) { + return Result.error("文件为空,请重新上传"); + } + return informationService.importLawsInformationInfo(file); + } + + @ApiOperation(value = "政策法规资料导入模板下载") + @GetMapping("/exportTemplateFile") + public void exportTemplateFile(String fileName,HttpServletResponse response, HttpServletRequest request)throws Exception{ + + OutputStream os = null; + OutputStream excelOS = null; + HSSFWorkbook workbook = new HSSFWorkbook(); + String fileOriName = "政策法规资料导入模板"; + if (StringUtils.isNotEmpty(fileName)) { + fileOriName = fileName; + } + try{ + //创建临时文件夹 + String fileNowPath = filePath + "/tempZip/" + UUIDUtils.randomUUID20() + "/" + fileOriName; + File nowFile = new File(fileNowPath); + if (nowFile.exists()){ + nowFile.delete(); + } + nowFile.mkdirs(); + String fileName2 = "导入模板.xls"; + HSSFSheet sheetItems = workbook.createSheet("模板"); + sheetItems.setDefaultColumnWidth(13); + Row rowHeader = sheetItems.createRow(1);//开始创建标题行 + sheetItems.addMergedRegion(new CellRangeAddress(0, 0, 0, 8)); + Row row2 = sheetItems.createRow(0);//开始创建填写说明 + String exportFieldName = FieldConvertUtil.exportFieldLawsInformation; + if (StringUtils.isNotBlank(exportFieldName)) { + String[] headerArr = exportFieldName.split(","); + for (int i=0;i < headerArr.length; i++) { + rowHeader.createCell(i).setCellValue(headerArr[i]); + } + } + Cell cellA2 = row2.createCell(0); + cellA2.setCellValue(FieldConvertUtil.exportLawsInformationDesc); + //sheetItems.setColumnWidth(0, 20 * 150); + row2.setHeight((short) (100 * 25)); + HSSFCellStyle cellStyle =workbook.createCellStyle(); + cellStyle.setAlignment(HorizontalAlignment.LEFT); + cellStyle.setVerticalAlignment(VerticalAlignment.TOP); + cellStyle.setWrapText(true); + cellA2.setCellStyle(cellStyle); + String repFileName = fileName2.replaceAll("/","_"); + excelOS = new FileOutputStream(fileNowPath + "/" + repFileName); + response.setHeader("Content-Disposition", + "attachment; filename=\""+ ReadExcel.encodeFileName(fileOriName+".zip", request) +"\""); + response.setContentType("application/force-download"); + response.flushBuffer(); + os = response.getOutputStream(); + workbook.write(excelOS); + excelOS.flush(); + excelOS.close(); + ZipUtil.zip(fileNowPath,fileNowPath+".zip"); + FileInputStream fis = new FileInputStream(fileNowPath+".zip"); + int len = 0; + while ((len = fis.read()) != -1) { + os.write(len); + } + os.flush(); + os.close(); // 后开先关 + fis.close(); // 先开后关 + } catch (Exception e) { + logger.error(e.getMessage(), e); + throw new com.adc.da.exception.AdcDaBaseException("下载文件失败,请重试"); + } finally { + IOUtils.closeQuietly(os); + IOUtils.closeQuietly(excelOS); + } + } } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/dao/SarLawsInformationDao.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/dao/SarLawsInformationDao.java index 337149b8..184679d4 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/dao/SarLawsInformationDao.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/dao/SarLawsInformationDao.java @@ -18,6 +18,8 @@ public interface SarLawsInformationDao extends BaseMapper { Integer queryByPageCount(SarLawsInformation page); List queryByPage(SarLawsInformation page); + + List getAllLawsInformation(SarLawsInformation sarLawsInformation); } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/entity/SarLawsInformation.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/entity/SarLawsInformation.java index 5e66844c..8883148f 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/entity/SarLawsInformation.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/entity/SarLawsInformation.java @@ -1,5 +1,7 @@ package com.adc.da.slrs.sarLawsInformation.entity; +import cn.afterturn.easypoi.excel.annotation.Excel; +import com.adc.da.att.entity.AttFileEO; import com.adc.da.base.page.BasePage; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; @@ -7,6 +9,7 @@ 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 io.swagger.annotations.ApiModelProperty; @@ -43,6 +46,7 @@ public class SarLawsInformation extends BasePage implements Serializable { */ @ApiModelProperty(value = "一级资料类别名称") @TableField(exist = false) + @Excel(name = "一级资料类别", orderNum = "0") private String firstTypeName; /** @@ -57,6 +61,7 @@ public class SarLawsInformation extends BasePage implements Serializable { */ @ApiModelProperty(value = "二级资料类别名称") @TableField(exist = false) + @Excel(name = "二级资料类别", orderNum = "1") private String secondTypeName; /** @@ -71,6 +76,7 @@ public class SarLawsInformation extends BasePage implements Serializable { */ @ApiModelProperty(value = "三级资料类别名称") @TableField(exist = false) + @Excel(name = "三级资料类别", orderNum = "2") private String thirdTypeName; /** @@ -85,6 +91,7 @@ public class SarLawsInformation extends BasePage implements Serializable { */ @ApiModelProperty(value = "四级资料类别名称") @TableField(exist = false) + @Excel(name = "四级资料类别", orderNum = "3") private String fourthTypeName; /** @@ -92,6 +99,7 @@ public class SarLawsInformation extends BasePage implements Serializable { */ @ApiModelProperty(value = "资料名称") @TableField(value = "NAME") + @Excel(name = "资料名称", orderNum = "4") private String name; /** @@ -99,6 +107,7 @@ public class SarLawsInformation extends BasePage implements Serializable { */ @ApiModelProperty(value = "资料归属部门") @TableField(value = "DEPARTMENT") + @Excel(name = "资料归属部门", orderNum = "5") private String department; /** @@ -106,6 +115,7 @@ public class SarLawsInformation extends BasePage implements Serializable { */ @ApiModelProperty(value = "作者") @TableField(value = "AUTHOR") + @Excel(name = "作者", orderNum = "6") private String author; /** @@ -115,6 +125,7 @@ public class SarLawsInformation extends BasePage implements Serializable { @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") @TableField(value = "UPLOAD_TIME") + @Excel(name = "上传时间", orderNum = "7", exportFormat = "yyyy-MM-dd") private Date uploadTime; /** @@ -122,6 +133,7 @@ public class SarLawsInformation extends BasePage implements Serializable { */ @ApiModelProperty(value = "资料说明") @TableField(value = "DESCRIPTION") + @Excel(name = "资料说明", orderNum = "8") private String description; /** @@ -134,9 +146,9 @@ public class SarLawsInformation extends BasePage implements Serializable { /** * 资料文件名称 */ - @ApiModelProperty(value = "资料文件名称") + @ApiModelProperty(value = "资料文件对象列表") @TableField(exist = false) - private String informationFileName; + private List informationFileList; /** * 可查看者,若设置为空则所有用户均可查看,若设置人员后,仅有可查看者可以查看文件信息。 @@ -219,6 +231,15 @@ public class SarLawsInformation extends BasePage implements Serializable { @TableField(exist = false) private String collectId; + // Excel导出使用字段 + @ApiModelProperty("导出文件名") + @TableField(exist = false) + private String exportName; + + @ApiModelProperty("导出的文件Ids") + @TableField(exist = false) + private String exportIds; + @TableField(exist = false) private static final long serialVersionUID = 1L; } \ No newline at end of file diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/SarLawsInformationService.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/SarLawsInformationService.java index e8797d2c..d2affd3e 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/SarLawsInformationService.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/SarLawsInformationService.java @@ -1,7 +1,9 @@ package com.adc.da.slrs.sarLawsInformation.service; +import com.adc.da.http.ResponseMessage; import com.adc.da.slrs.sarLawsInformation.entity.SarLawsInformation; import com.baomidou.mybatisplus.extension.service.IService; +import org.springframework.web.multipart.MultipartFile; import java.util.List; @@ -21,4 +23,20 @@ public interface SarLawsInformationService extends IService Boolean deleteInformation(String id); Boolean updateLawsInformationInfo(SarLawsInformation lawsInformation); + + /** + * 根据法规资料id列表查询资料信息,用于导出,不包含文件信息 + * @param idList 法规资料Id列表 + * @return 法规资料列表 + */ + List getLawsInformationByIds(List idList); + + /** + * 查询法规资料信息,用于导出,不包含文件信息 + * @param sarLawsInformation 法规资料对象,用于查询 + * @return 法规资料列表 + */ + List getAllLawsInformation(SarLawsInformation sarLawsInformation); + + ResponseMessage importLawsInformationInfo(MultipartFile file); } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/impl/SarLawsInformationServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/impl/SarLawsInformationServiceImpl.java index c806097b..4cd5ecf0 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/impl/SarLawsInformationServiceImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsInformation/service/impl/SarLawsInformationServiceImpl.java @@ -1,31 +1,53 @@ package com.adc.da.slrs.sarLawsInformation.service.impl; +import cn.afterturn.easypoi.excel.ExcelExportUtil; +import cn.afterturn.easypoi.excel.ExcelImportUtil; +import cn.afterturn.easypoi.excel.entity.ImportParams; import com.adc.da.att.entity.AttFileEO; import com.adc.da.att.service.IAttFileEOService; +import com.adc.da.common.FileUnZip; +import com.adc.da.http.ResponseMessage; +import com.adc.da.http.Result; import com.adc.da.person.entity.TsPersonCollect; import com.adc.da.person.service.IPersonCollectEOService; import com.adc.da.slrs.sarLawsInformationCenterTree.entity.SarLawsInformationCenterTree; import com.adc.da.slrs.sarLawsInformationCenterTree.service.SarLawsInformationCenterTreeService; import com.adc.da.slrs.sarUpdLog.entity.SarUpdLog; import com.adc.da.slrs.sarUpdLog.service.ISarUpdLogService; +import com.adc.da.slrs.sarUser.entity.TsUser; +import com.adc.da.slrs.sarUser.service.ITsUserService; +import com.adc.da.slrs.tsDictionaryType.entity.TsDicType; import com.adc.da.slrs.tsDictionaryType.service.ITsDicTypeService; import com.adc.da.util.LoginUserUtil; import com.adc.da.util.UUIDUtils; +import com.adc.da.utils.util.FieldConvertUtil; import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.update.LambdaUpdateWrapper; import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl; import com.adc.da.slrs.sarLawsInformation.entity.SarLawsInformation; import com.adc.da.slrs.sarLawsInformation.service.SarLawsInformationService; import com.adc.da.slrs.sarLawsInformation.dao.SarLawsInformationDao; import io.swagger.annotations.ApiModelProperty; +import org.apache.commons.io.FileUtils; import org.apache.commons.lang3.StringUtils; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.ss.usermodel.WorkbookFactory; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; +import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; +import java.io.File; +import java.io.IOException; import java.lang.reflect.Field; import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; +import java.text.SimpleDateFormat; import java.util.*; +import java.util.stream.Collectors; /** * @author tjzdw @@ -46,6 +68,10 @@ public class SarLawsInformationServiceImpl extends ServiceImpl fileNameList = new ArrayList<>(); + List fileNameList = new ArrayList<>(); for (String attId : split) { AttFileEO fileInfo = attFileEOService.getFileInfo(attId); - fileNameList.add(fileInfo.getOldFileName()); + fileNameList.add(fileInfo); } - sarLawsInformation.setInformationFileName(String.join(",",fileNameList)); + sarLawsInformation.setInformationFileList(fileNameList); } // 查询体系节点信息 if (StringUtils.isNotBlank(sarLawsInformation.getTreeNodeId())) { @@ -89,10 +115,20 @@ public class SarLawsInformationServiceImpl extends ServiceImpl sarLawsInformationList = this.baseMapper.queryByPage(page); for (SarLawsInformation sarLawsInformation : sarLawsInformationList) { + // 将字典编号变更为字典值 convertCodeToName(sarLawsInformation); + // 查询文件信息 + if (StringUtils.isNotBlank(sarLawsInformation.getInformationFile())) { + String[] split = sarLawsInformation.getInformationFile().split(","); + List fileNameList = new ArrayList<>(); + for (String attId : split) { + AttFileEO fileInfo = attFileEOService.getFileInfo(attId); + fileNameList.add(fileInfo); + } + sarLawsInformation.setInformationFileList(fileNameList); + } } return sarLawsInformationList; } @@ -101,8 +137,14 @@ public class SarLawsInformationServiceImpl extends ServiceImpl wrapper = new LambdaQueryWrapper<>(); @@ -146,6 +188,204 @@ public class SarLawsInformationServiceImpl extends ServiceImpl getLawsInformationByIds(List idList) { + LambdaQueryWrapper wrapper = new LambdaQueryWrapper<>(); + wrapper.in(SarLawsInformation::getId, idList); + List sarLawsInformationList = this.baseMapper.selectList(wrapper); + for (SarLawsInformation sarLawsInformation : sarLawsInformationList) { + // 将字典编号变更为字典值 + convertCodeToName(sarLawsInformation); + } + return sarLawsInformationList; + } + + @Override + public List getAllLawsInformation(SarLawsInformation sarLawsInformation) { + List sarLawsInformationList = this.baseMapper.getAllLawsInformation(sarLawsInformation); + for (SarLawsInformation lawsInformation : sarLawsInformationList) { + // 将字典编号变更为字典值 + convertCodeToName(lawsInformation); + // 查询文件信息 + if (StringUtils.isNotBlank(lawsInformation.getInformationFile())) { + String[] split = lawsInformation.getInformationFile().split(","); + List fileNameList = new ArrayList<>(); + for (String attId : split) { + AttFileEO fileInfo = attFileEOService.getFileInfo(attId); + fileNameList.add(fileInfo); + } + lawsInformation.setInformationFileList(fileNameList); + } + } + return sarLawsInformationList; + } + + @Override + public ResponseMessage importLawsInformationInfo(MultipartFile file) { + //获取文件全称 + String fileNameStr = file.getOriginalFilename(); + //获取最后.的位置 + assert fileNameStr != null; + int pos = fileNameStr.lastIndexOf("."); + //获取压缩文件名称并以小写显示 + String fileStr = fileNameStr.substring(pos + 1).toLowerCase(); + //校验是否是zip文件 + if (!fileStr.equals("zip")) { + return Result.error("请上传zip格式的文件"); + } + //进行拼接获取文件名称 + String fileName = fileNameStr.substring(0, pos); + //获取路径和文件名称 + String path = filePath + "/" + fileName; + + File saveDirectory = new File(path); + //判断saveDirectory中是否是文件夹 + if (!saveDirectory.isDirectory()) { + saveDirectory.mkdir(); + } + //将文件写入到指定路径中 + try { + FileUtils.copyInputStreamToFile(file.getInputStream(), new File(path + "/" + fileNameStr)); + } catch (IOException e) { + return Result.error("文件存储失败!"); + } + //解压缩 + String zipEntryName = null; + try { + zipEntryName = FileUnZip.unZipFiles(path + "/" + fileNameStr, path); + FileUnZip.delete(new File(path + "/" + fileNameStr)); + } catch (IOException e) { + return Result.error("文件解压失败"); + } + //获取文件信息 + List fileList = readImpExcelFile(zipEntryName); + //判断获取到的文件数量 + if (fileList.size() != 1) { + return Result.error("上传的文件只能有一个"); + } + File importFile = fileList.get(0); + if (!importFile.getName().contains(".xls") && !importFile.getName().contains(".xlsx")) { + return Result.error("文件必须是EXCEL文件"); + } + Workbook workbook = null; + try { + workbook = WorkbookFactory.create(importFile); + } catch (IOException e) { + FileUnZip.deleteDir(saveDirectory); + return Result.error("导入失败,需要导入的数据有问题或导入的企标标号和企标名称已存在"); + } + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + Sheet sheet = workbook.getSheetAt(0); + if (sheet == null) { + return Result.error("工作表为空"); + } + StringBuilder sb = new StringBuilder(); + List headerList = new ArrayList<>(); + // 获取excel表头 + Row headerRow = sheet.getRow(1); + for (int i = 0; i < 8; i++) { + headerList.add(headerRow.getCell(i).getStringCellValue()); + } + + // 判断表头字段是否相同 + if (!String.join(",",headerList).equals(FieldConvertUtil.exportFieldLawsInformation)) { + try { + workbook.close(); + } catch (IOException e) { + return Result.error("文件关闭出错"); + } + //删除原上传文件 + FileUnZip.deleteDir(saveDirectory); + return Result.error("fail", "读取失败,请严格按照模板文件导入数据"); + } + + ImportParams importParams = new ImportParams(); + importParams.setTitleRows(1); + List sarLawsInformationList = ExcelImportUtil.importExcel(readImpExcelFile(zipEntryName).get(0), SarLawsInformation.class, importParams); + // 获取需要校验的字段 + List firstMaterialTypeList = dicTypeService.selectAllDicTypeNameByDicCode("firstMaterialType"); + Set firstMaterialTypeNameSet = firstMaterialTypeList.stream().map(TsDicType::getDicTypeName).collect(Collectors.toSet()); + List secondMaterialTypeList = dicTypeService.selectAllDicTypeNameByDicCode("secondMaterialType"); + Set secondMaterialTypeNameSet = secondMaterialTypeList.stream().map(TsDicType::getDicTypeName).collect(Collectors.toSet()); + List thirdMaterialTypeList = dicTypeService.selectAllDicTypeNameByDicCode("thirdMaterialType"); + Set thirdMaterialTypeNameSet = thirdMaterialTypeList.stream().map(TsDicType::getDicTypeName).collect(Collectors.toSet()); + List fourthMaterialTypeList = dicTypeService.selectAllDicTypeNameByDicCode("fourthMaterialType"); + Set fourthMaterialTypeNameSet = fourthMaterialTypeList.stream().map(TsDicType::getDicTypeName).collect(Collectors.toSet()); + // 遍历索引 + int index = 1; + // 去除空数据 + List sarLawsInformationListNew = new ArrayList<>(); + for (SarLawsInformation sarLawsInformation : sarLawsInformationList) { + if (StringUtils.isNotBlank(sarLawsInformation.getName())) { + sarLawsInformationListNew.add(sarLawsInformation); + } + } + for (SarLawsInformation sarLawsInformation : sarLawsInformationListNew){ + // 把excel表中的类别名转换为类别编号,并对类别名做检测 + if (StringUtils.isNotBlank(sarLawsInformation.getFirstTypeName())) { + List firstTypeCodeList = new ArrayList<>(); + for (String firstTypeName : sarLawsInformation.getFirstTypeName().split(",")) { + if (!firstMaterialTypeNameSet.contains(firstTypeName)){ + return Result.error("第" + index + "条记录的一级会议类别不符合输入要求"); + } + for (TsDicType tsDicType : firstMaterialTypeList) { + if (firstTypeName.equals(tsDicType.getDicTypeName())) { + firstTypeCodeList.add(tsDicType.getDicTypeCode()); + } + } + } + sarLawsInformation.setFirstType(String.join(",", firstTypeCodeList)); + } + if (StringUtils.isNotBlank(sarLawsInformation.getSecondTypeName())) { + List secondTypeCodeList = new ArrayList<>(); + for (String secondTypeName : sarLawsInformation.getSecondTypeName().split(",")) { + if (!secondMaterialTypeNameSet.contains(secondTypeName)){ + return Result.error("第" + index + "条记录的二级会议类别不符合输入要求"); + } + for (TsDicType tsDicType : secondMaterialTypeList) { + if (secondTypeName.equals(tsDicType.getDicTypeName())) { + secondTypeCodeList.add(tsDicType.getDicTypeCode()); + } + } + } + sarLawsInformation.setSecondType(String.join(",", secondTypeCodeList)); + } + if (StringUtils.isNotBlank(sarLawsInformation.getThirdTypeName())) { + List thirdTypeCodeList = new ArrayList<>(); + for (String thirdTypeName : sarLawsInformation.getThirdTypeName().split(",")) { + if (!thirdMaterialTypeNameSet.contains(thirdTypeName)){ + return Result.error("第" + index + "条记录的三级会议类别不符合输入要求"); + } + for (TsDicType tsDicType : thirdMaterialTypeList) { + if (thirdTypeName.equals(tsDicType.getDicTypeName())) { + thirdTypeCodeList.add(tsDicType.getDicTypeCode()); + } + } + } + sarLawsInformation.setThirdType(String.join(",", thirdTypeCodeList)); + } + if (StringUtils.isNotBlank(sarLawsInformation.getFourthTypeName())) { + List fourthTypeCodeList = new ArrayList<>(); + for (String fourthTypeName : sarLawsInformation.getFourthTypeName().split(",")) { + if (!fourthMaterialTypeNameSet.contains(fourthTypeName)){ + return Result.error("第" + index + "条记录的四级会议类别不符合输入要求"); + } + for (TsDicType tsDicType : fourthMaterialTypeList) { + if (fourthTypeName.equals(tsDicType.getDicTypeName())) { + fourthTypeCodeList.add(tsDicType.getDicTypeCode()); + } + } + } + sarLawsInformation.setFourthType(String.join(",", fourthTypeCodeList)); + } + // 索引 +1 + index++; + // 存入数据库 + addLawsInformation(sarLawsInformation); + } + return Result.success("导入成功"); + } + public void convertCodeToName(SarLawsInformation sarLawsInformation) { List firstTypeList = new ArrayList<>(); for (String type : sarLawsInformation.getFirstType().split(",")) { @@ -187,7 +427,7 @@ public class SarLawsInformationServiceImpl extends ServiceImpl changes = new ArrayList<>(); // 不需要比较的字段 String[] ignoreFields = {"id","firstTypeName","secondTypeName","thirdTypeName","fourthTypeName","uploadTime", - "informationFileName","createAndApproveBy","treeNodeId","treeNodeName","validFlag","createTime", + "informationFileList","createAndApproveBy","treeNodeId","treeNodeName","validFlag","createTime", "modifyTime","sortField","sortMode","collectId","serialVersionUID"}; List ignoreFieldList = Arrays.asList(ignoreFields); // 获取SarLawsInformation类的所有字段 @@ -227,10 +467,17 @@ public class SarLawsInformationServiceImpl extends ServiceImpl oldFileList = (List)method.invoke(oldInfo); + List oldFileNameList = new ArrayList<>(); + if (oldFileList != null && oldFileList.size() > 0) { + for (Object oldFile : oldFileList) { + AttFileEO oldFile1 = (AttFileEO) oldFile; + oldFileNameList.add(oldFile1.getOldFileName()); + } + } // 获取字段名称 ApiModelProperty annotationsByType = field.getAnnotationsByType(ApiModelProperty.class)[0]; - changes.add(annotationsByType.value() + "由\"" + oldTypeName + "\"改为\"" + String.join(",",fileNameList) + "\""); + changes.add(annotationsByType.value() + "由\"" + String.join(",",oldFileNameList) + "\"改为\"" + String.join(",",fileNameList) + "\""); } else { ApiModelProperty annotationsByType = field.getAnnotationsByType(ApiModelProperty.class)[0]; @@ -245,6 +492,23 @@ public class SarLawsInformationServiceImpl extends ServiceImpl readImpExcelFile(String path) { + File file = new File(path); + List resultlist = new ArrayList<>(); + if (file.isDirectory()) { + File[] files = file.listFiles(); + for (File fi : files) { + // 对文件进行过滤,读取所有文件 + String name = fi.getName(); + //文件不为空 添加 + if (name != null){ + resultlist.add(fi); + } + } + } + return resultlist; + } } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/controller/SarLawsTopicController.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/controller/SarLawsTopicController.java index c09cfdc4..ca54cae9 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/controller/SarLawsTopicController.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/controller/SarLawsTopicController.java @@ -1,19 +1,44 @@ package com.adc.da.slrs.sarLawsTopic.controller; +import cn.afterturn.easypoi.excel.ExcelExportUtil; +import cn.afterturn.easypoi.excel.entity.ExportParams; +import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; +import cn.hutool.core.util.StrUtil; +import cn.hutool.core.util.ZipUtil; import com.adc.da.base.web.BaseController; +import com.adc.da.common.ReadExcel; +import com.adc.da.exception.AdcDaBaseException; import com.adc.da.http.PageInfo; import com.adc.da.http.ResponseMessage; import com.adc.da.http.Result; +import com.adc.da.slrs.sarLawsInformation.entity.SarLawsInformation; 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 com.adc.da.util.UUIDUtils; +import com.adc.da.utils.util.FieldConvertUtil; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; +import org.apache.poi.hssf.usermodel.HSSFCellStyle; +import org.apache.poi.hssf.usermodel.HSSFSheet; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.ss.usermodel.*; +import org.apache.poi.ss.util.CellRangeAddress; +import org.apache.poi.util.IOUtils; +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; +import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.*; +import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.*; +import java.text.ParseException; +import java.util.Arrays; import java.util.List; /** @@ -26,9 +51,14 @@ import java.util.List; @RequestMapping("/${restPath}/lawss/sarLawsTopic") public class SarLawsTopicController extends BaseController { + private static final Logger logger = LoggerFactory.getLogger(SarLawsTopicController.class); + @Resource private SarLawsTopicService lawsTopicService; + @Value("${file.path}") + private String filePath; + @ApiOperation(value = "根据政策课题ID查询会议信息") @GetMapping("/getLawsTopicInfo") public ResponseMessage getLawsTopicInfo(String id) throws Exception{ @@ -72,4 +102,120 @@ public class SarLawsTopicController extends BaseController { Boolean updateResult = lawsTopicService.updateLawsTopicInfo(lawsTopic); return updateResult ? Result.success() : Result.error("更新失败"); } + + @ApiOperation("导出政策课题信息") + @GetMapping("/exportLawsTopicInfo") + public ResponseMessage exportLawsTopicInfo(SarLawsTopicVO sarLawsTopicVO, HttpServletResponse response, + HttpServletRequest request) { + OutputStream os = null; + Workbook workbook = null; + List datas; + try { + if(StringUtils.isEmpty(sarLawsTopicVO.getExportName())||sarLawsTopicVO.getExportName().equals("null")){ + sarLawsTopicVO.setExportName("政策课题信息"); + } + response.setHeader("Content-Disposition", + "attachment; filename=" + ReadExcel.encodeFileName(sarLawsTopicVO.getExportName()+".xlsx", + request)); + // 导出数据,若指定了值则使用ids字段条件导出,否则根据条件导出 + if (StrUtil.isNotBlank(sarLawsTopicVO.getExportIds())) { + List idList = Arrays.asList(sarLawsTopicVO.getExportIds().split(",")); + datas = lawsTopicService.getLawsTopicByIds(idList); + } else { + // 导出所有数据 + datas = lawsTopicService.getAllLawsTopic(sarLawsTopicVO); + } + ExportParams exportParams = new ExportParams(); + exportParams.setType(ExcelType.XSSF); + exportParams.setSheetName(sarLawsTopicVO.getExportName()); + workbook = ExcelExportUtil.exportExcel(exportParams, SarLawsTopicVO.class, datas); + os = response.getOutputStream(); + workbook.write(os); + os.flush(); + } catch (IOException e) { + logger.error(e.getMessage(), e); + throw new AdcDaBaseException("下载文件失败,请重试"); + } finally { + IOUtils.closeQuietly(os); + } + return Result.success(); + } + + @ApiOperation("Excel文件导入政策资料信息") + @PostMapping("/importLawsTopicInfo") + public ResponseMessage importLawsTopicInfo(@RequestParam(value = "file",required = false) MultipartFile file) throws ParseException { + if (file == null) { + return Result.error("文件为空,请重新上传"); + } + return lawsTopicService.importLawsTopicInfo(file); + } + + @ApiOperation(value = "政策课题导入模板下载") + @GetMapping("/exportTemplateFile") + public void exportTemplateFile(String fileName,HttpServletResponse response, HttpServletRequest request)throws Exception{ + + OutputStream os = null; + OutputStream excelOS = null; + HSSFWorkbook workbook = new HSSFWorkbook(); + String fileOriName = "政策课题导入模板"; + if (StringUtils.isNotEmpty(fileName)) { + fileOriName = fileName; + } + try{ + //创建临时文件夹 + String fileNowPath = filePath + "/tempZip/" + UUIDUtils.randomUUID20() + "/" + fileOriName; + File nowFile = new File(fileNowPath); + if (nowFile.exists()){ + nowFile.delete(); + } + nowFile.mkdirs(); + String fileName2 = "导入模板.xls"; + HSSFSheet sheetItems = workbook.createSheet("模板"); + sheetItems.setDefaultColumnWidth(13); + Row rowHeader = sheetItems.createRow(1);//开始创建标题行 + sheetItems.addMergedRegion(new CellRangeAddress(0, 0, 0, 13)); + Row row2 = sheetItems.createRow(0);//开始创建填写说明 + String exportFieldName = FieldConvertUtil.exportFieldLawsTopic; + if (StringUtils.isNotBlank(exportFieldName)) { + String[] headerArr = exportFieldName.split(","); + for (int i=0;i < headerArr.length; i++) { + rowHeader.createCell(i).setCellValue(headerArr[i]); + } + } + Cell cellA2 = row2.createCell(0); + cellA2.setCellValue(FieldConvertUtil.exportLawsInformationDesc); + //sheetItems.setColumnWidth(0, 20 * 150); + row2.setHeight((short) (100 * 25)); + HSSFCellStyle cellStyle =workbook.createCellStyle(); + cellStyle.setAlignment(HorizontalAlignment.LEFT); + cellStyle.setVerticalAlignment(VerticalAlignment.TOP); + cellStyle.setWrapText(true); + cellA2.setCellStyle(cellStyle); + String repFileName = fileName2.replaceAll("/","_"); + excelOS = new FileOutputStream(fileNowPath + "/" + repFileName); + response.setHeader("Content-Disposition", + "attachment; filename=\""+ ReadExcel.encodeFileName(fileOriName+".zip", request) +"\""); + response.setContentType("application/force-download"); + response.flushBuffer(); + os = response.getOutputStream(); + workbook.write(excelOS); + excelOS.flush(); + excelOS.close(); + ZipUtil.zip(fileNowPath,fileNowPath+".zip"); + FileInputStream fis = new FileInputStream(fileNowPath+".zip"); + int len = 0; + while ((len = fis.read()) != -1) { + os.write(len); + } + os.flush(); + os.close(); // 后开先关 + fis.close(); // 先开后关 + } catch (Exception e) { + logger.error(e.getMessage(), e); + throw new com.adc.da.exception.AdcDaBaseException("下载文件失败,请重试"); + } finally { + IOUtils.closeQuietly(os); + IOUtils.closeQuietly(excelOS); + } + } } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/dao/SarLawsTopicMapper.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/dao/SarLawsTopicMapper.java index 506dd9ff..ddbd8f2b 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/dao/SarLawsTopicMapper.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/dao/SarLawsTopicMapper.java @@ -4,6 +4,7 @@ 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 org.apache.ibatis.annotations.Param; import java.util.List; @@ -19,6 +20,10 @@ public interface SarLawsTopicMapper extends BaseMapper { Integer queryByPageCount(SarLawsTopicVO page); List queryByPage(SarLawsTopicVO page); + + List getLawsTopicByIds(@Param("idList") List idList); + + List getAllLawsTopic(SarLawsTopicVO sarLawsTopicVO); } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsContactInformation.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsContactInformation.java index 6b0d4584..c5c7db0a 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsContactInformation.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsContactInformation.java @@ -1,5 +1,6 @@ package com.adc.da.slrs.sarLawsTopic.entity; +import cn.afterturn.easypoi.excel.annotation.Excel; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; @@ -36,30 +37,35 @@ public class SarLawsContactInformation implements Serializable { * 姓名 */ @TableField(value = "NAME") + @Excel(name = "姓名", orderNum = "0", type = 1) private String name; /** * 单位 */ @TableField(value = "DEPARTMENT") + @Excel(name = "单位", orderNum = "1", type = 1) private String department; /** * 电话 */ @TableField(value = "PHONE") + @Excel(name = "电话", orderNum = "2", type = 1) private String phone; /** * 邮箱 */ @TableField(value = "EMAIL") + @Excel(name = "邮箱", orderNum = "3", type = 1) private String email; /** * 身份 */ @TableField(value = "IDENTITY") + @Excel(name = "身份", orderNum = "4", type = 1) private String identity; @TableField(exist = false) diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsTopic.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsTopic.java index 14dc22c4..9ceb0cff 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsTopic.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsTopic.java @@ -1,5 +1,6 @@ package com.adc.da.slrs.sarLawsTopic.entity; +import com.adc.da.att.entity.AttFileEO; import com.baomidou.mybatisplus.annotation.IdType; import com.baomidou.mybatisplus.annotation.TableField; import com.baomidou.mybatisplus.annotation.TableId; @@ -9,6 +10,7 @@ import java.util.Date; import java.util.List; import com.fasterxml.jackson.annotation.JsonFormat; +import io.swagger.annotations.ApiModelProperty; import lombok.Data; /** @@ -21,36 +23,42 @@ public class SarLawsTopic implements Serializable { /** * 主键 */ + @ApiModelProperty(value = "主键") @TableId(value = "ID", type = IdType.ID_WORKER_STR) private String id; /** * 课题名称 */ + @ApiModelProperty(value = "课题名称") @TableField(value = "TOPIC_NAME") private String topicName; /** * 课题承办单位 */ + @ApiModelProperty(value = "课题承办单位") @TableField(value = "ORGANIZER") private String organizer; /** * 课题指导单位 */ + @ApiModelProperty(value = "课题指导单位") @TableField(value = "GUIDANCE_UNIT") private String guidanceUnit; /** * 课题参与单位 */ + @ApiModelProperty(value = "课题参与单位") @TableField(value = "PARTICIPATING_UNIT") private String participatingUnit; /** * 开始时间 */ + @ApiModelProperty(value = "开始时间") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") @TableField(value = "START_TIME") private Date startTime; @@ -58,6 +66,7 @@ public class SarLawsTopic implements Serializable { /** * 结题时间 */ + @ApiModelProperty(value = "结题时间") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") @TableField(value = "CLOSE_TIME") private Date closeTime; @@ -65,162 +74,162 @@ public class SarLawsTopic implements Serializable { /** * 课题状态 */ + @ApiModelProperty(value = "课题状态") @TableField(value = "TOPIC_STATUS") private String topicStatus; /** * 课题费用(万元) */ + @ApiModelProperty(value = "课题费用") @TableField(value = "TOPIC_COST") private String topicCost; /** * 协议 */ + @ApiModelProperty("协议文件") @TableField(value = "AGREEMENT") private String agreement; - /** - * 协议真实文件名 - */ + @ApiModelProperty(value = "协议文件列表") @TableField(exist = false) - private String agreementName; + private List agreementList; /** * 课题组会议列表 */ + @ApiModelProperty(value = "课题组会议列表") @TableField(exist = false) private List meetingList; /** * 课题组研究方案 */ + @ApiModelProperty(value = "课题研究方案") @TableField(value = "RESEARCH_PLAN") private String researchPlan; - /** - * 课题组研究方案真实文件名 - */ + @ApiModelProperty(value = "课题组研究方案文件列表") @TableField(exist = false) - private String researchPlanName; + private List researchPlanList; /** * 课题组研究成果 */ + @ApiModelProperty(value = "课题组研究成果") @TableField(value = "RESEARCH_FINDINGS") private String researchFindings; /** * 课题组研究成果真实文件名 */ + @ApiModelProperty(value = "课题组研究成果文件列表") @TableField(exist = false) - private String researchFindingsName; + private List researchFindingsList; /** * 课题组其他 */ + @ApiModelProperty(value = "课题组其他文件") @TableField(value = "RESEARCH_GROUP_OTHER") private String researchGroupOther; - /** - * 课题组其他真实文件名 - */ + @ApiModelProperty(value = "课题组其他文件列表") @TableField(exist = false) - private String researchGroupOtherName; + private List researchGroupOtherList; /** * 课题组会议资料 */ + @ApiModelProperty(value = "课题组会议资料") @TableField(value = "CONFERENCE_MATERIALS") private String conferenceMaterials; - /** - * 课题组会议资料真实文件名 - */ + @ApiModelProperty(value = "课题组会议资料文件列表") @TableField(exist = false) - private String conferenceMaterialsName; + private List conferenceMaterialsList; /** * 课题组联系方式 */ + @ApiModelProperty(value = "课题组联系方式列表") @TableField(exist = false) private List topicContactInformationList; /** * 内部资料立项报告 */ + @ApiModelProperty(value = "内部资料立项报告") @TableField(value = "INSIDE_PROJECT_PROPOSAL_REPORT") private String insideProjectProposalRepost; - /** - * 内部资料立项报告真实文件名 - */ + @ApiModelProperty(value = "内部资料立项报告文件列表") @TableField(exist = false) - private String insideProjectProposalRepostName; + private List insideProjectProposalRepostList; /** * 内部资料研究方案 */ + @ApiModelProperty(value = "内部资料研究方案") @TableField(value = "INSIDE_RESEARCH_PLAN") private String insideResearchPlan; - /** - * 内部资料研究方案真实文件名 - */ + @ApiModelProperty(value = "内部资料研究方案文件列表") @TableField(exist = false) - private String insideResearchPlanName; + private List insideResearchPlanList; /** * 内部资料会议资料 */ + @ApiModelProperty(value = "内部资料会议资料") @TableField(value = "INSIDE_CONFERENCE_MATERIALS") private String insideConferenceMaterials; - /** - * 内部资料会议资料真实文件名 - */ + @ApiModelProperty(value = "内部资料会议资料文件列表") @TableField(exist = false) - private String insideConferenceMaterialsName; + private List insideConferenceMaterialsList; /** * 内部会议研究成果 */ + @ApiModelProperty(value = "内部会议研究成果") @TableField(value = "INSIDE_RESEARCH_FINDINGS") private String insideResearchFindings; - /** - * 内部会议研究成果真实文件名 - */ + @ApiModelProperty(value = "内部会议研究成果文件列表") @TableField(exist = false) - private String insideResearchFindingsName; + private List insideResearchFindingsList; /** * 内部会议其他 */ + @ApiModelProperty(value = "内部会议其他文件") @TableField(value = "INSIDE_OTHER") private String insideOther; - /** - * 内部会议其他真实文件名 - */ + @ApiModelProperty(value = "内部会议其他文件列表") @TableField(exist = false) - private String insideOtherName; + private List insideOtherList; /** * 内部联系方式 */ + @ApiModelProperty(value = "内部联系方式列表") @TableField(exist = false) private List insideContactInformationList; /** * 逻辑删除,0可用,1不可用 */ + @ApiModelProperty(value = "逻辑删除") @TableField(value = "VALID_FLAG") private Integer validFlag; /** * 创建时间 */ + @ApiModelProperty(value = "创建时间") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") @TableField(value = "CREATE_TIME") private Date createTime; @@ -228,6 +237,7 @@ public class SarLawsTopic implements Serializable { /** * 修改时间 */ + @ApiModelProperty(value = "修改时间") @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss") @TableField(value = "MODIFY_TIME") private Date modifyTime; diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsTopicMeeting.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsTopicMeeting.java index b0a749d5..cd7d6cde 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsTopicMeeting.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsTopicMeeting.java @@ -1,13 +1,12 @@ package com.adc.da.slrs.sarLawsTopic.entity; +import cn.afterturn.easypoi.excel.annotation.Excel; 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; /** @@ -33,30 +32,35 @@ public class SarLawsTopicMeeting implements Serializable { * 会议名称 */ @TableField(value = "MEETING_NAME") + @Excel(name = "会议名称", orderNum = "0", type = 1) private String meetingName; /** * 会议时间 */ @TableField(value = "MEETING_TIME") + @Excel(name = "会议时间", orderNum = "1", type = 1) private String meetingTime; /** * 会议地点 */ @TableField(value = "MEETING_ADDRESS") + @Excel(name = "会议地点", orderNum = "2", type = 1) private String meetingAddress; /** * 参会人员(内部) */ @TableField(value = "PARTICIPANTS") + @Excel(name = "参会人员(内部)", orderNum = "3", type = 1) private String participants; /** * 会议主要内容 */ @TableField(value = "MEETING_CONTENT") + @Excel(name = "会议主要内容", orderNum = "4", type = 1) private String meetingContent; @TableField(exist = false) diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsTopicVO.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsTopicVO.java index 553b40fa..ecc187da 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsTopicVO.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/entity/SarLawsTopicVO.java @@ -1,5 +1,8 @@ package com.adc.da.slrs.sarLawsTopic.entity; +import cn.afterturn.easypoi.excel.annotation.Excel; +import cn.afterturn.easypoi.excel.annotation.ExcelCollection; +import com.adc.da.att.entity.AttFileEO; import com.adc.da.base.page.BasePage; import com.fasterxml.jackson.annotation.JsonFormat; import lombok.Data; @@ -27,21 +30,25 @@ public class SarLawsTopicVO extends BasePage { /** * 课题名称 */ + @Excel(name = "课题名称", orderNum = "0", type = 1, needMerge = true) private String topicName; /** * 课题承办单位 */ + @Excel(name = "课题承办单位", orderNum = "1",type = 1, needMerge = true) private String organizer; /** * 课题指导单位 */ + @Excel(name = "课题指导单位", orderNum = "2", type = 1, needMerge = true) private String guidanceUnit; /** * 课题参与单位 */ + @Excel(name = "课题参与单位", orderNum = "3", type = 1, needMerge = true) private String participatingUnit; /** @@ -49,6 +56,7 @@ public class SarLawsTopicVO extends BasePage { */ @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") + @Excel(name = "开始时间", orderNum = "4", exportFormat = "yyyy-MM-dd", needMerge = true) private Date startTime; /** @@ -56,16 +64,19 @@ public class SarLawsTopicVO extends BasePage { */ @JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd") @DateTimeFormat(pattern = "yyyy-MM-dd") + @Excel(name = "结题时间", orderNum = "5", exportFormat = "yyyy-MM-dd", needMerge = true) private Date closeTime; /** * 课题状态 */ + @Excel(name = "课题状态", orderNum = "6", type = 1, needMerge = true) private String topicStatus; /** * 课题费用(万元) */ + @Excel(name = "课题费用(万元)", orderNum = "7", type = 1, needMerge = true) private String topicCost; /** @@ -73,9 +84,12 @@ public class SarLawsTopicVO extends BasePage { */ private String agreement; + private List agreementList; + /** * 课题组会议列表 */ + @ExcelCollection(name = "课题组会议列表", orderNum = "8") private List meetingList; /** @@ -111,24 +125,33 @@ public class SarLawsTopicVO extends BasePage { */ private String researchPlan; + private List researchPlanList; + /** * 课题组研究成果 */ private String researchFindings; + private List researchFindingsList; + /** * 课题组其他 */ private String researchGroupOther; + private List researchGroupOtherList; + /** * 课题组会议资料 */ private String conferenceMaterials; + private List conferenceMaterialsList; + /** * 课题组联系方式 */ + @ExcelCollection(name = "课题组联系方式", orderNum = "9") private List topicContactInformationList; // 课题组用户名称 @@ -147,29 +170,40 @@ public class SarLawsTopicVO extends BasePage { */ private String insideProjectProposalRepost; + private List insideProjectProposalRepostList; + /** * 内部资料研究方案 */ private String insideResearchPlan; + private List insideResearchPlanList; + /** * 内部资料会议资料 */ private String insideConferenceMaterials; + private List insideConferenceMaterialsList; + /** * 内部会议研究成果 */ private String insideResearchFindings; + private List insideResearchFindingsList; + /** * 内部会议其他 */ private String insideOther; + private List insideOtherList; + /** * 内部联系方式 */ + @ExcelCollection(name = "内部联系方式", orderNum = "10") private List insideContactInformationList; // 内部人员名称 @@ -206,4 +240,10 @@ public class SarLawsTopicVO extends BasePage { private String startTimeOperator = "="; private String closeTimeOperator = "="; + + // 导出使用的属性 + // 导出文件名 + private String exportName; + // 导出的ID列表字符串 + private String exportIds; } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/SarLawsTopicService.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/SarLawsTopicService.java index 812a94e4..bd9b409c 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/SarLawsTopicService.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/SarLawsTopicService.java @@ -1,8 +1,11 @@ package com.adc.da.slrs.sarLawsTopic.service; +import com.adc.da.http.ResponseMessage; +import com.adc.da.slrs.sarLawsInformation.entity.SarLawsInformation; import com.adc.da.slrs.sarLawsTopic.entity.SarLawsTopic; import com.adc.da.slrs.sarLawsTopic.entity.SarLawsTopicVO; import com.baomidou.mybatisplus.extension.service.IService; +import org.springframework.web.multipart.MultipartFile; import java.util.List; @@ -22,4 +25,10 @@ public interface SarLawsTopicService extends IService { Boolean updateLawsTopicInfo(SarLawsTopic lawsTopic); List queryByPage(SarLawsTopicVO sarLawsTopicVO); + + List getLawsTopicByIds(List idList); + + List getAllLawsTopic(SarLawsTopicVO sarLawsTopicVO); + + ResponseMessage importLawsTopicInfo(MultipartFile file); } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/impl/SarLawsTopicServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/impl/SarLawsTopicServiceImpl.java index de7c04ed..7e94b4ad 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/impl/SarLawsTopicServiceImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/service/impl/SarLawsTopicServiceImpl.java @@ -1,28 +1,49 @@ package com.adc.da.slrs.sarLawsTopic.service.impl; +import cn.afterturn.easypoi.excel.ExcelImportUtil; +import cn.afterturn.easypoi.excel.entity.ImportParams; import com.adc.da.att.entity.AttFileEO; import com.adc.da.att.service.impl.AttFileEOServiceImpl; +import com.adc.da.common.FileUnZip; +import com.adc.da.http.ResponseMessage; +import com.adc.da.http.Result; 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.adc.da.slrs.sarUpdLog.entity.SarUpdLog; +import com.adc.da.slrs.sarUpdLog.service.ISarUpdLogService; +import com.adc.da.util.LoginUserUtil; +import com.adc.da.util.UUIDUtils; +import com.adc.da.utils.util.FieldConvertUtil; 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 io.swagger.annotations.ApiModelProperty; +import org.apache.commons.io.FileUtils; import org.apache.commons.lang3.StringUtils; +import org.apache.poi.ss.usermodel.Row; +import org.apache.poi.ss.usermodel.Sheet; +import org.apache.poi.ss.usermodel.Workbook; +import org.apache.poi.ss.usermodel.WorkbookFactory; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.transaction.annotation.Transactional; +import org.springframework.web.multipart.MultipartFile; import javax.annotation.Resource; +import java.io.File; +import java.io.IOException; +import java.lang.reflect.Field; +import java.lang.reflect.InvocationTargetException; import java.lang.reflect.Method; -import java.util.ArrayList; -import java.util.Arrays; -import java.util.Date; -import java.util.List; +import java.text.SimpleDateFormat; +import java.util.*; /** * @author tjzdw @@ -37,33 +58,17 @@ public class SarLawsTopicServiceImpl extends ServiceImpl aClass = sarLawsTopic.getClass(); - for (String fileField : fileFieldArray) { - fileField = fileField.substring(0,1).toUpperCase() + fileField.substring(1); - Method getMethod = aClass.getMethod("get" + fileField); - String attIds = (String) getMethod.invoke(sarLawsTopic, null); - if (StringUtils.isNotBlank(attIds)) { - String[] split = attIds.split(","); - List tempList = new ArrayList<>(); - for (String attId : split) { - AttFileEO fileInfo = attFileEOService.getFileInfo(attId); - tempList.add(fileInfo.getOldFileName()); - } - Method setMethod = aClass.getMethod("set" + fileField + "Name", String.class); - String join = String.join(",", tempList); - System.out.println(fileField+":"+join); - setMethod.invoke(sarLawsTopic,join); - } - } // 查询课题组会议 LambdaQueryWrapper meetingWrapper = new LambdaQueryWrapper<>(); meetingWrapper.eq(SarLawsTopicMeeting::getLawsTopicId, lawsTopicId); @@ -72,15 +77,17 @@ public class SarLawsTopicServiceImpl extends ServiceImpl topicGroupWrapper = new LambdaQueryWrapper<>(); topicGroupWrapper.eq(SarLawsContactInformation::getLawsTopicId, lawsTopicId); - topicGroupWrapper.eq(SarLawsContactInformation::getGroupType,"lawsTopic"); + topicGroupWrapper.eq(SarLawsContactInformation::getGroupType,"topicGroup"); List lawsTopicContactInformation = contactInformationService.list(topicGroupWrapper); sarLawsTopic.setTopicContactInformationList(lawsTopicContactInformation); // 查询内部联系房方式 LambdaQueryWrapper insideWrapper = new LambdaQueryWrapper<>(); - topicGroupWrapper.eq(SarLawsContactInformation::getLawsTopicId, lawsTopicId); - topicGroupWrapper.eq(SarLawsContactInformation::getGroupType,"lawsTopic"); - List insideContactInformation = contactInformationService.list(topicGroupWrapper); + insideWrapper.eq(SarLawsContactInformation::getLawsTopicId, lawsTopicId); + insideWrapper.eq(SarLawsContactInformation::getGroupType,"inside"); + List insideContactInformation = contactInformationService.list(insideWrapper); sarLawsTopic.setInsideContactInformationList(insideContactInformation); + // 获取文件信息 + getFileListByAttFile(sarLawsTopic); return sarLawsTopic; } @@ -93,22 +100,28 @@ public class SarLawsTopicServiceImpl extends ServiceImpl compareList = compareLawsTopic(lawsTopicInfoDB, lawsTopic); + if (compareLawsTopic(lawsTopicInfoDB, lawsTopic).size() == 0) { return true; } - // 先删除关联信息 - LambdaQueryWrapper topicWrapper = new LambdaQueryWrapper<>(); - topicWrapper.eq(SarLawsTopicMeeting::getLawsTopicId,lawsTopic.getId()); - meetingService.remove(topicWrapper); - LambdaQueryWrapper informationWrapper = new LambdaQueryWrapper<>(); - informationWrapper.eq(SarLawsContactInformation::getLawsTopicId,lawsTopic.getId()); - contactInformationService.remove(informationWrapper); - // 再添加关联信息 - for (SarLawsTopicMeeting meeting : lawsTopic.getMeetingList()) { - meeting.setLawsTopicId(lawsTopic.getId()); - meetingService.save(meeting); + lawsTopic.setModifyTime(new Date()); + int update = this.baseMapper.updateById(lawsTopic); + // 比较列表字段是否经过修改,如果经过修改,先删除,再添加 + if (compareList.contains("课题组会议列表被变更")) { + LambdaQueryWrapper topicWrapper = new LambdaQueryWrapper<>(); + topicWrapper.eq(SarLawsTopicMeeting::getLawsTopicId,lawsTopic.getId()); + meetingService.remove(topicWrapper); + 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); + if (compareList.contains("课题组联系方式列表被变更")) { + LambdaQueryWrapper informationWrapper = new LambdaQueryWrapper<>(); + informationWrapper.eq(SarLawsContactInformation::getLawsTopicId,lawsTopic.getId()); + informationWrapper.eq(SarLawsContactInformation::getGroupType,"topicGroup"); + contactInformationService.remove(informationWrapper); + 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); + if (compareList.contains("内部联系方式列表被变更")) { + LambdaQueryWrapper informationWrapper = new LambdaQueryWrapper<>(); + informationWrapper.eq(SarLawsContactInformation::getLawsTopicId,lawsTopic.getId()); + informationWrapper.eq(SarLawsContactInformation::getGroupType,"inside"); + contactInformationService.remove(informationWrapper); + for (SarLawsContactInformation information : lawsTopic.getInsideContactInformationList()) { + information.setGroupType("inside"); + information.setLawsTopicId(lawsTopic.getId()); + contactInformationService.save(information); + } } + // 存储修改记录 + SarUpdLog sarUpdLogEO = new SarUpdLog(); + sarUpdLogEO.setId(UUIDUtils.randomUUID20()); + sarUpdLogEO.setSarId(lawsTopicInfoDB.getId()); + sarUpdLogEO.setSarType("LAWS_TOPIC"); + sarUpdLogEO.setCreationTime(new Date()); + sarUpdLogEO.setCreationUser(LoginUserUtil.getUserId()); + sarUpdLogEO.setContent(lawsTopicInfoDB.getTopicName() + "," + String.join(",",compareList)); + updLogService.save(sarUpdLogEO); return true; } @@ -185,7 +219,264 @@ public class SarLawsTopicServiceImpl extends ServiceImpl sarLawsTopicVOList = this.baseMapper.queryByPage(page); + for (SarLawsTopicVO lawsTopicVO : sarLawsTopicVOList) { + getFileListByAttFile(lawsTopicVO); + } + return sarLawsTopicVOList; + } + + @Override + public List getLawsTopicByIds(List idList) { + return this.baseMapper.getLawsTopicByIds(idList); + } + + @Override + public List getAllLawsTopic(SarLawsTopicVO sarLawsTopicVO) { + return this.baseMapper.getAllLawsTopic(sarLawsTopicVO); + } + + @Override + public ResponseMessage importLawsTopicInfo(MultipartFile file) { + //获取文件全称 + String fileNameStr = file.getOriginalFilename(); + //获取最后.的位置 + assert fileNameStr != null; + int pos = fileNameStr.lastIndexOf("."); + //获取压缩文件名称并以小写显示 + String fileStr = fileNameStr.substring(pos + 1).toLowerCase(); + //校验是否是zip文件 + if (!fileStr.equals("zip")) { + return Result.error("请上传zip格式的文件"); + } + //进行拼接获取文件名称 + String fileName = fileNameStr.substring(0, pos); + //获取路径和文件名称 + String path = filePath + "/" + fileName; + + File saveDirectory = new File(path); + //判断saveDirectory中是否是文件夹 + if (!saveDirectory.isDirectory()) { + saveDirectory.mkdir(); + } + //将文件写入到指定路径中 + try { + FileUtils.copyInputStreamToFile(file.getInputStream(), new File(path + "/" + fileNameStr)); + } catch (IOException e) { + return Result.error("文件存储失败!"); + } + //解压缩 + String zipEntryName = null; + try { + zipEntryName = FileUnZip.unZipFiles(path + "/" + fileNameStr, path); + FileUnZip.delete(new File(path + "/" + fileNameStr)); + } catch (IOException e) { + return Result.error("文件解压失败"); + } + //获取文件信息 + List fileList = readImpExcelFile(zipEntryName); + //判断获取到的文件数量 + if (fileList.size() != 1) { + return Result.error("上传的文件只能有一个"); + } + File importFile = fileList.get(0); + if (!importFile.getName().contains(".xls") && !importFile.getName().contains(".xlsx")) { + return Result.error("文件必须是EXCEL文件"); + } + Workbook workbook = null; + try { + workbook = WorkbookFactory.create(importFile); + } catch (IOException e) { + FileUnZip.deleteDir(saveDirectory); + return Result.error("导入失败,需要导入的数据有问题或导入的企标标号和企标名称已存在"); + } + SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); + Sheet sheet = workbook.getSheetAt(0); + if (sheet == null) { + return Result.error("工作表为空"); + } + StringBuilder sb = new StringBuilder(); + // 获取excel表头 + List headerList = new ArrayList<>(); + Row headerRow = sheet.getRow(1); + for (int i = 0; i < 22; i++) { + headerList.add(headerRow.getCell(i).getStringCellValue()); + } + // 获取关联表表头 + Row relationRow = sheet.getRow(2); + List relationList = new ArrayList<>(); + for (int i = 7; i < 22; i++) { + relationList.add(relationRow.getCell(i).getStringCellValue()); + } + + // 判断表头字段是否相同 + if (!String.join(",",headerList).equals(FieldConvertUtil.exportFieldLawsTopic) + && !String.join(",",relationList).equals(FieldConvertUtil.exportFieldLawsTopicRelation)) { + try { + workbook.close(); + } catch (IOException e) { + return Result.error("文件关闭出错"); + } + //删除原上传文件 + FileUnZip.deleteDir(saveDirectory); + return Result.error("fail", "读取失败,请严格按照模板文件导入数据"); + } + + ImportParams importParams = new ImportParams(); + importParams.setTitleRows(1); + importParams.setHeadRows(2); + List lawsTopicVOList = ExcelImportUtil.importExcel(readImpExcelFile(zipEntryName).get(0), SarLawsTopicVO.class, importParams); + // 去除空数据 + for (SarLawsTopicVO lawsTopicVO : lawsTopicVOList) { + if (StringUtils.isNotBlank(lawsTopicVO.getTopicName())) { + // 存入数据库 + SarLawsTopic sarLawsTopic = new SarLawsTopic(); + BeanUtils.copyProperties(lawsTopicVO,sarLawsTopic); + if (sarLawsTopic.getStartTime() != null && sarLawsTopic.getCloseTime() != null) { + sarLawsTopic.setTopicStatus("已结题"); + } else { + sarLawsTopic.setTopicStatus("进行中"); + } + addLawsTopicInfo(sarLawsTopic); + } + } + return Result.success("导入成功"); + } + + // 通过反射获取文件内容 + public void getFileListByAttFile(SarLawsTopic lawsTopic) { + String[] fileField = {"agreement","researchPlan","researchFindings","researchGroupOther","conferenceMaterials", + "insideProjectProposalRepost","insideResearchPlan","insideConferenceMaterials","insideResearchFindings","insideOther"}; + try { + for (String field : fileField) { + String getMethod = "get" + StringUtils.capitalize(field); + Method method = SarLawsTopic.class.getMethod(getMethod); + String fileAttId = String.valueOf(method.invoke(lawsTopic)); + if (StringUtils.isNotBlank(fileAttId) && !"null".equals(fileAttId)) { + List fileList = new ArrayList<>(); + for (String attId : fileAttId.split(",")) { + AttFileEO fileInfo = attFileEOService.getFileInfo(attId); + fileList.add(fileInfo); + } + String setMethod = "set" + StringUtils.capitalize(field) + "List"; + method = SarLawsTopic.class.getMethod(setMethod, List.class); + method.invoke(lawsTopic, fileList); + } + } + }catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException e) { + e.printStackTrace(); + } + } + + public void getFileListByAttFile(SarLawsTopicVO lawsTopic) { + String[] fileField = {"agreement","researchPlan","researchFindings","researchGroupOther","conferenceMaterials", + "insideProjectProposalRepost","insideResearchPlan","insideConferenceMaterials","insideResearchFindings","insideOther"}; + try { + for (String field : fileField) { + String getMethod = "get" + StringUtils.capitalize(field); + Method method = SarLawsTopicVO.class.getMethod(getMethod); + String fileAttId = String.valueOf(method.invoke(lawsTopic)); + if (StringUtils.isNotBlank(fileAttId) && !"null".equals(fileAttId)) { + List fileList = new ArrayList<>(); + for (String attId : fileAttId.split(",")) { + AttFileEO fileInfo = attFileEOService.getFileInfo(attId); + fileList.add(fileInfo); + } + String setMethod = "set" + StringUtils.capitalize(field) + "List"; + method = SarLawsTopicVO.class.getMethod(setMethod, List.class); + method.invoke(lawsTopic, fileList); + } + } + }catch (NoSuchMethodException | InvocationTargetException | IllegalAccessException e) { + e.printStackTrace(); + } + } + + /** + * 比较两个SarLawsTopic 对象 + * @param oldLawsTopic 数据库中存储的对象 + * @param newLawsTopic 更新后的对象 + * @return 差异 + */ + public List compareLawsTopic(SarLawsTopic oldLawsTopic, SarLawsTopic newLawsTopic) { + List changes = new ArrayList<>(); + // 不需要比较的字段 + String[] ignoreFields = {"id","validFlag","createTime","modifyTime","agreementList","researchPlanList", + "researchFindingsList","researchGroupOtherList","conferenceMaterialsList","insideProjectProposalRepostList", + "insideResearchPlanList","insideConferenceMaterialsList","insideResearchFindingsList","insideOtherList","serialVersionUID"}; + String[] fileAttIdFields = {"agreement","researchPlan","researchFindings","researchGroupOther","conferenceMaterials", + "insideProjectProposalRepost","insideResearchPlan","insideConferenceMaterials","insideResearchFindings","insideOther"}; + List ignoreFieldList = Arrays.asList(ignoreFields); + List fileAttIdFieldList = Arrays.asList(fileAttIdFields); + // 获取SarLawsTopic类的所有字段 + Field[] fields = SarLawsTopic.class.getDeclaredFields(); + for (Field field : fields) { + if (!ignoreFieldList.contains(field.getName())) { + try { + field.setAccessible(true); + String oldValue = String.valueOf(field.get(oldLawsTopic)); + String newValue = String.valueOf(field.get(newLawsTopic)); + if (!Objects.equals(oldValue, newValue)) { + // 对比文件字段 + if (fileAttIdFieldList.contains(field.getName())) { + List fileNameList = new ArrayList<>(); + if (StringUtils.isNotBlank(newValue)) { + String[] split = newValue.split(","); + for (String attId : split) { + AttFileEO fileInfo = attFileEOService.getFileInfo(attId); + fileNameList.add(fileInfo.getOldFileName()); + } + } + // 获取文件字段名称 + String fieldName = field.getName().substring(0, 1).toUpperCase() + field.getName().substring(1); + Method method = SarLawsTopic.class.getMethod("get" + fieldName + "List"); + // 获取旧的文件名 + List oldFileList = (List)method.invoke(oldLawsTopic); + List oldFileNameList = new ArrayList<>(); + if (oldFileList != null && oldFileList.size() > 0) { + for (Object oldFile : oldFileList) { + AttFileEO oldFile1 = (AttFileEO) oldFile; + oldFileNameList.add(oldFile1.getOldFileName()); + } + } + // 获取字段名称 + ApiModelProperty annotationsByType = field.getAnnotationsByType(ApiModelProperty.class)[0]; + changes.add(annotationsByType.value() + "由\"" + String.join(",",oldFileNameList) + "\"改为\"" + String.join(",",fileNameList) + "\""); + // 对比列表字段 + } else if ("meetingList".equals(field.getName()) || "topicContactInformationList".equals(field.getName()) + || "insideContactInformationList".equals(field.getName())) { + ApiModelProperty annotationsByType = field.getAnnotationsByType(ApiModelProperty.class)[0]; + changes.add(annotationsByType.value() + "被变更"); + } else { + // 对比其他字段 + ApiModelProperty annotationsByType = field.getAnnotationsByType(ApiModelProperty.class)[0]; + changes.add(annotationsByType.value() + "由\"" + oldValue + "\"改为\"" + newValue + "\""); + } + } + } catch (IllegalAccessException | NoSuchMethodException | InvocationTargetException e) { + // 处理异常 + e.printStackTrace(); + } + } + } + return changes; + } + + private static List readImpExcelFile(String path) { + File file = new File(path); + List resultlist = new ArrayList<>(); + if (file.isDirectory()) { + File[] files = file.listFiles(); + for (File fi : files) { + // 对文件进行过滤,读取所有文件 + String name = fi.getName(); + //文件不为空 添加 + if (name != null){ + resultlist.add(fi); + } + } + } + return resultlist; } } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/tsDictionaryType/dao/TsDicTypeDao.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/tsDictionaryType/dao/TsDicTypeDao.java index 98141619..245c7d03 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/tsDictionaryType/dao/TsDicTypeDao.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/tsDictionaryType/dao/TsDicTypeDao.java @@ -3,8 +3,10 @@ package com.adc.da.slrs.tsDictionaryType.dao; import com.adc.da.slrs.tsDictionaryType.entity.TsDicType; import com.adc.da.slrs.tsDictionaryType.entity.TsSearchMenu; import com.baomidou.mybatisplus.core.mapper.BaseMapper; +import org.apache.ibatis.annotations.MapKey; import java.util.List; +import java.util.Map; /** *

@@ -18,4 +20,6 @@ public interface TsDicTypeDao extends BaseMapper { public List getSearchMenu(); String selectDicTypeNameByDicCode(String typeCode); + + List selectAllDicTypeNameByDicCode(String dicCode); } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/tsDictionaryType/service/ITsDicTypeService.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/tsDictionaryType/service/ITsDicTypeService.java index ac04a9fe..6d281d7e 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/tsDictionaryType/service/ITsDicTypeService.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/tsDictionaryType/service/ITsDicTypeService.java @@ -5,6 +5,7 @@ import com.adc.da.slrs.tsDictionaryType.entity.TsSearchMenu; import com.baomidou.mybatisplus.extension.service.IService; import java.util.List; +import java.util.Map; /** *

@@ -25,4 +26,11 @@ public interface ITsDicTypeService extends IService { */ public String getDicTypeNameByDicCode(String typeCode); + /** + * 根据字典值类别查询指定类别的所有类别名 + * @param dicCode 字典类别编号 + * @return 字典值列表 + */ + List selectAllDicTypeNameByDicCode(String dicCode); + } diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/tsDictionaryType/service/impl/TsDicTypeServiceImpl.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/tsDictionaryType/service/impl/TsDicTypeServiceImpl.java index cc94a502..dd3343b2 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/tsDictionaryType/service/impl/TsDicTypeServiceImpl.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/tsDictionaryType/service/impl/TsDicTypeServiceImpl.java @@ -9,6 +9,7 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import java.util.List; +import java.util.Map; /** *

@@ -30,4 +31,9 @@ public class TsDicTypeServiceImpl extends ServiceImpl i public String getDicTypeNameByDicCode(String typeCode) { return this.baseMapper.selectDicTypeNameByDicCode(typeCode); } + + @Override + public List selectAllDicTypeNameByDicCode(String dicCode) { + return this.baseMapper.selectAllDicTypeNameByDicCode(dicCode); + } } diff --git a/adc-da-slrs/src/main/java/com/adc/da/utils/util/ExcelExportUtil.java b/adc-da-slrs/src/main/java/com/adc/da/utils/util/ExcelExportUtil.java new file mode 100644 index 00000000..11c4ed27 --- /dev/null +++ b/adc-da-slrs/src/main/java/com/adc/da/utils/util/ExcelExportUtil.java @@ -0,0 +1,112 @@ +package com.adc.da.utils.util; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import cn.afterturn.easypoi.excel.entity.ExportParams; +import cn.afterturn.easypoi.excel.entity.enmus.ExcelType; +import com.adc.da.slrs.processModel.utils.TrainFormDate; +import lombok.extern.slf4j.Slf4j; +import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.ss.usermodel.*; +import org.apache.poi.xssf.usermodel.XSSFWorkbook; + +import java.lang.reflect.Field; +import java.util.Collection; +import java.util.HashMap; +import java.util.List; +import java.util.Map; + +/** + * @author tjzdw + * @description + * @date 2023/10/28 + */ +@Slf4j +public class ExcelExportUtil { + + private ExcelExportUtil() { + } + + /** + * 导出Excel文件 + * @param params 导出参数,主要包含,导出的文件名,导出类型 + * @param tClass 导出文件的对象类 + * @param datas 数据 + * @return 工作簿 + */ + public static Workbook exportWithData(ExportParams params, Class tClass , List datas) { + Workbook wb = null; + + if (params.getType().equals(ExcelType.XSSF)) { + wb = new XSSFWorkbook(); + } else { + wb = new HSSFWorkbook(); + } + + // 第二步,在workbook中添加一个sheet,对应Excel文件中的sheet + Sheet sheet = wb.createSheet(params.getSheetName()); + + // 第三步,在sheet中添加表头第0行,注意老版本poi对Excel的行数列数有限制 + Row row = sheet.createRow(0); + + // 第四步,创建单元格,并设置值表头 设置表头居中 + CellStyle style = wb.createCellStyle(); + style.setAlignment(HorizontalAlignment.CENTER); + //声明列对象 + Cell cell = null; + Map map = new HashMap<>(); + Map mapField = new HashMap<>(); + Field[] fields = tClass.getDeclaredFields(); + for (Field field : fields) { + field.setAccessible(true); + Excel excel = field.getAnnotation(Excel.class); + if (null != excel) { + map.put(Integer.valueOf(excel.orderNum()), excel); + mapField.put(Integer.valueOf(excel.orderNum()), field); + } + } + //创建标题行 + DataFormat df = wb.createDataFormat(); + for (Integer i : map.keySet()) { + sheet.setColumnWidth(i, (int) (map.get(i).width() * 256)); + cell = row.createCell(i); + cell.setCellValue(map.get(i).name()); + if (null != map.get(i).exportFormat()) { + CellStyle style1 = wb.createCellStyle(); + style1.setAlignment(HorizontalAlignment.CENTER); // 创建一个居中格式 + style1.setDataFormat(df.getFormat(map.get(i).exportFormat())); + sheet.setDefaultColumnStyle(i, style1); + } + cell.setCellStyle(style); + } + //赋值数据 + int rowNum = 1; + for (Object o : datas) { + Row row1 = sheet.createRow(rowNum); + for (Integer i : map.keySet()) { + Cell cell1 = row1.createCell(i); + Field field = null; + try { + field = o.getClass().getDeclaredField(mapField.get(i).getName()); + } catch (NoSuchFieldException e) { + log.warn(e.getMessage()); + } + if (null != field) { + field.setAccessible(true); + try { + Object fieldVal = field.get(o); + if (null != map.get(i).exportFormat() && !"".equals(map.get(i).exportFormat())) { + cell1.setCellValue("null".equals(String.valueOf(fieldVal)) ? "" : TrainFormDate.dealWithTimeZoneyyyy(String.valueOf(fieldVal), map.get(i).exportFormat())); + } else { + cell1.setCellValue("null".equals(String.valueOf(fieldVal)) ? "" : String.valueOf(fieldVal)); + } + } catch (IllegalAccessException e) { + log.warn(e.getMessage()); + } + } + } + System.out.println(o.toString()); + rowNum++; + } + return wb; + } +} diff --git a/adc-da-slrs/src/main/java/com/adc/da/utils/util/FieldConvertUtil.java b/adc-da-slrs/src/main/java/com/adc/da/utils/util/FieldConvertUtil.java index 8aa7f09b..ed53e2a6 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/utils/util/FieldConvertUtil.java +++ b/adc-da-slrs/src/main/java/com/adc/da/utils/util/FieldConvertUtil.java @@ -63,6 +63,14 @@ public class FieldConvertUtil { // 内外部会议关联表 表头 public static String exportFieldNamesMeetingTopic = "议题名称,汇报人,汇报单位,议题主要内容"; + // 政策法规资料 表头 + public static String exportFieldLawsInformation = "一级资料类别,二级资料类别,三级资料类别,四级资料类别,资料名称,资料归属部门,作者,资料说明"; + + // 政策课题 表头 + public static String exportFieldLawsTopic = "课题名称,课题承办单位,课题指导单位,课题参与单位,开始时间,结题时间,课题费用(万元),课题组会议列表,课题组联系方式,内部联系方式"; + // 政策课题关联表 表头 + public static String exportFieldLawsTopicRelation = "会议名称,会议时间,会议地点,参会人员(内部),会议主要内容,姓名,单位,电话,邮箱,身份,姓名,单位,电话,邮箱,身份"; + public static String exportBaseFieldNamesBussCode = "起草部门,废止日期,代替企标编号,复审日期,起草人,被代替企标编号,采用标准,文件上传人员,采标程度,引用标准,适用车型,能源类型,适用产品线,上传时间,体系类别,备案日期,关联模块-乘用车VPPS编码,关联模块--乘用车vpps中文名称,关联模块--卡车VPPS编码,关联模块--卡车vpps中文名称"; public static String exportAttrFieldNamesBuss = "SVPPS,规范性引用文件,废止日期,复审日期,密级,授权,相关部门," + @@ -85,6 +93,11 @@ public class FieldConvertUtil { "7.关联模块-乘用车VPPS编码和关联模块--卡车VPPS编码是填写数据库中已有的编码从而带出乘用车VPPS名称和卡车VPPS名称\n" + "8.发布稿,编制说明,历史版本,其他文件,修改单,关联文件为附件文件,需要放在Excel文档同级目录中"; + // TODO + public static String exportInsideOutsideMeetingDesc = "内部会议,外部会议"; + + public static String exportLawsInformationDesc = ""; + public static String exportFieldName = "*企标类别,*企标编号,*标准年份,*企标名称,企标英文名称,*文本状态,发布日期,企标实施日期,起草部门,起草人,适用车型,能源类型,适用产品线,体系类别,关联模块-乘用车VPPS编码,关联模块--卡车VPPS编码,发布稿,编制说明,历史版本,其他文件,修改单,代替企标编号,采用标准,采标程度,引用标准,关联文件,"; /*** diff --git a/adc-da-slrs/src/main/java/com/adc/da/utils/util/InsideOutsideMeetingExportUtil.java b/adc-da-slrs/src/main/java/com/adc/da/utils/util/InsideOutsideMeetingExportUtil.java index cd5ad4dc..444d5895 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/utils/util/InsideOutsideMeetingExportUtil.java +++ b/adc-da-slrs/src/main/java/com/adc/da/utils/util/InsideOutsideMeetingExportUtil.java @@ -138,10 +138,10 @@ public class InsideOutsideMeetingExportUtil { value = insideOutsideMeeting.getMeetingContent(); break; case "一级会议类别": - value = insideOutsideMeeting.getFirstMeetingType(); + value = insideOutsideMeeting.getFirstMeetingTypeName(); break; case "二级会议类别": - value = insideOutsideMeeting.getSecondMeetingType(); + value = insideOutsideMeeting.getSecondMeetingTypeName(); break; default: value = null; diff --git a/adc-da-slrs/src/main/resources/mybatis/mapper/InsideOntSideMeeting/InsideOntSideMeeting.xml b/adc-da-slrs/src/main/resources/mybatis/mapper/InsideOntSideMeeting/InsideOntSideMeeting.xml index fe46192a..5d069c4e 100644 --- a/adc-da-slrs/src/main/resources/mybatis/mapper/InsideOntSideMeeting/InsideOntSideMeeting.xml +++ b/adc-da-slrs/src/main/resources/mybatis/mapper/InsideOntSideMeeting/InsideOntSideMeeting.xml @@ -26,9 +26,6 @@ - - - @@ -39,7 +36,7 @@ iom.ID,iom.MEETING_NAME,iom.TOPIC_NAME,iom.MEETING_ORGANIZER,iom.MEETING_TIME,iom.MEETING_ADDRESS, iom.PARTICIPANTS,iom.MEETING_MINUTES,iom.MEETING_CONTENT,iom.FIRST_MEETING_TYPE,iom.SECOND_MEETING_TYPE, mt.ID as mtId,mt.MEETING_ID,mt.AGENDA_NAME,mt.AGENDA_MATERIALS,mt.REPORTER,mt.REPORTING_UNIT, - mt.AGENDA_CONTENT,mt.VALID_FLAG,mt.CREATE_TIME,mt.MODIFY_TIME, + mt.AGENDA_CONTENT, iom.VALID_FLAG,iom.CREATE_TIME,iom.MODIFY_TIME diff --git a/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsInformation/SarLawsInformationMapper.xml b/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsInformation/SarLawsInformationMapper.xml index e73d9012..aed4403b 100644 --- a/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsInformation/SarLawsInformationMapper.xml +++ b/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsInformation/SarLawsInformationMapper.xml @@ -71,4 +71,12 @@ order by ${sortField} ${sortMode} limit ${pager.startIndex-1},${pageSize} + diff --git a/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsTopic/SarLawsTopicMapper.xml b/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsTopic/SarLawsTopicMapper.xml index 8aa24169..606e448c 100644 --- a/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsTopic/SarLawsTopicMapper.xml +++ b/adc-da-slrs/src/main/resources/mybatis/mapper/sarLawsTopic/SarLawsTopicMapper.xml @@ -4,7 +4,7 @@ "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> - + @@ -205,4 +205,26 @@ order by slt.${sortField} ${sortMode} limit ${pager.startIndex-1},${pageSize} + + diff --git a/adc-da-slrs/src/main/resources/mybatis/mapper/tsDictionaryType/TsDicTypeMapper.xml b/adc-da-slrs/src/main/resources/mybatis/mapper/tsDictionaryType/TsDicTypeMapper.xml index 3e637c31..916d5ba1 100644 --- a/adc-da-slrs/src/main/resources/mybatis/mapper/tsDictionaryType/TsDicTypeMapper.xml +++ b/adc-da-slrs/src/main/resources/mybatis/mapper/tsDictionaryType/TsDicTypeMapper.xml @@ -14,6 +14,11 @@ + + + + + select DIC_TYPE_NAME from ts_dictype where DIC_TYPE_CODE = #{typeCode} + From 3b4d167afaa97c1bf4227d54c489d6b2a2767d5f Mon Sep 17 00:00:00 2001 From: wxyclub Date: Tue, 31 Oct 2023 11:26:54 +0800 Subject: [PATCH 30/31] =?UTF-8?q?add:=20=E6=94=BF=E7=AD=96=E5=85=A5?= =?UTF-8?q?=E5=BA=93=E5=AD=97=E6=AE=B5=E6=B7=BB=E5=8A=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../com/adc/da/workFlow/service/ActSarItemsLawsEOService.java | 1 + 1 file changed, 1 insertion(+) diff --git a/adc-da-activiti/src/main/java/com/adc/da/workFlow/service/ActSarItemsLawsEOService.java b/adc-da-activiti/src/main/java/com/adc/da/workFlow/service/ActSarItemsLawsEOService.java index 72f03988..100b9855 100644 --- a/adc-da-activiti/src/main/java/com/adc/da/workFlow/service/ActSarItemsLawsEOService.java +++ b/adc-da-activiti/src/main/java/com/adc/da/workFlow/service/ActSarItemsLawsEOService.java @@ -866,6 +866,7 @@ public class ActSarItemsLawsEOService { case "isRelateAccess": sarLawsStandInfo.setIsRelateAccess(valueStr); break; case "lawsYear": sarLawsStandInfo.setLawsYear(valueStr); break; case "lawsNotisyncNum": sarLawsStandInfo.setLawsNotisyncNum(valueStr); break; + case "notisyncNumLink": sarLawsStandInfo.setNotisyncNumLink(valueStr); break; case "lawsBulletin": sarLawsStandInfo.setLawsBulletin(valueStr); break; case "lawsLabel": sarLawsStandInfo.setLawsLabel(valueStr); break; case "lawsRemark": sarLawsStandInfo.setLawsRemark(valueStr); break; From a8f10f075c92f79d1097c246ff9a42f71ffb9b36 Mon Sep 17 00:00:00 2001 From: wxyclub Date: Tue, 31 Oct 2023 11:27:55 +0800 Subject: [PATCH 31/31] =?UTF-8?q?add:=20=E6=94=BF=E7=AD=96=E8=AF=BE?= =?UTF-8?q?=E9=A2=98=E6=94=BF=E7=AD=96=E8=B5=84=E6=96=99=E6=A8=A1=E6=9D=BF?= =?UTF-8?q?=E4=B8=8B=E8=BD=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../controller/SarLawsTopicController.java | 56 +++++++++++++++---- .../adc/da/utils/util/FieldConvertUtil.java | 14 ++++- 2 files changed, 55 insertions(+), 15 deletions(-) diff --git a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/controller/SarLawsTopicController.java b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/controller/SarLawsTopicController.java index ca54cae9..1f06ca25 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/controller/SarLawsTopicController.java +++ b/adc-da-slrs/src/main/java/com/adc/da/slrs/sarLawsTopic/controller/SarLawsTopicController.java @@ -21,9 +21,7 @@ import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import org.apache.commons.lang3.ObjectUtils; import org.apache.commons.lang3.StringUtils; -import org.apache.poi.hssf.usermodel.HSSFCellStyle; -import org.apache.poi.hssf.usermodel.HSSFSheet; -import org.apache.poi.hssf.usermodel.HSSFWorkbook; +import org.apache.poi.hssf.usermodel.*; import org.apache.poi.ss.usermodel.*; import org.apache.poi.ss.util.CellRangeAddress; import org.apache.poi.util.IOUtils; @@ -173,19 +171,53 @@ public class SarLawsTopicController extends BaseController { HSSFSheet sheetItems = workbook.createSheet("模板"); sheetItems.setDefaultColumnWidth(13); Row rowHeader = sheetItems.createRow(1);//开始创建标题行 - sheetItems.addMergedRegion(new CellRangeAddress(0, 0, 0, 13)); + sheetItems.addMergedRegion(new CellRangeAddress(0, 0, 0, 21)); Row row2 = sheetItems.createRow(0);//开始创建填写说明 - String exportFieldName = FieldConvertUtil.exportFieldLawsTopic; - if (StringUtils.isNotBlank(exportFieldName)) { - String[] headerArr = exportFieldName.split(","); - for (int i=0;i < headerArr.length; i++) { - rowHeader.createCell(i).setCellValue(headerArr[i]); - } + + // 表头样式 + HSSFCellStyle cellStyle1 = workbook.createCellStyle(); + cellStyle1.setAlignment(HorizontalAlignment.CENTER); + cellStyle1.setVerticalAlignment(VerticalAlignment.CENTER); + String exportFieldName = "课题名称,课题承办单位,课题指导单位,课题参与单位,开始时间,结题时间,课题费用(万元)"; + String[] headerArr = exportFieldName.split(","); + for (int i=0;i < headerArr.length; i++) { + Cell cell = rowHeader.createCell(i); + cell.setCellValue(headerArr[i]); + sheetItems.addMergedRegion(new CellRangeAddress(1,2,i,i)); + cell.setCellStyle(cellStyle1); + } + + String exportFieldListName = "课题组会议列表,课题组联系方式,内部联系方式"; + String[] headerListArr = exportFieldListName.split(","); + for (int i=0;i < headerListArr.length; i++) { + Cell cell = rowHeader.createCell(7 + (i * 5)); + cell.setCellValue(headerListArr[i]); + sheetItems.addMergedRegion(new CellRangeAddress(1,1,7+(i*5),7+(i*5)+4)); + cell.setCellStyle(cellStyle1); + } + HSSFRow rowHeader2 = sheetItems.createRow(2); + String exportFieldMeetingName = "会议名称,会议时间,会议地点,参会人员(内部),会议主要内容"; + String[] headerMeetingListArr = exportFieldMeetingName.split(","); + for (int i=0;i < headerMeetingListArr.length; i++) { + Cell cell = rowHeader2.createCell(7 + i); + cell.setCellValue(headerMeetingListArr[i]); + cell.setCellStyle(cellStyle1); + } + String exportFieldContactName = "姓名,单位,电话,邮箱,身份"; + String[] headerContactListArr = exportFieldContactName.split(","); + for (int i=0;i < headerContactListArr.length; i++) { + Cell cell1 = rowHeader2.createCell(12 + i); + cell1.setCellValue(headerContactListArr[i]); + cell1.setCellStyle(cellStyle1); + Cell cell2 = rowHeader2.createCell(17 + i); + cell2.setCellValue(headerContactListArr[i]); + cell2.setCellStyle(cellStyle1); } Cell cellA2 = row2.createCell(0); - cellA2.setCellValue(FieldConvertUtil.exportLawsInformationDesc); + cellA2.setCellValue(FieldConvertUtil.exportLawsTopicDesc); //sheetItems.setColumnWidth(0, 20 * 150); - row2.setHeight((short) (100 * 25)); + row2.setHeight((short) (50 * 22)); + // 说明样式 HSSFCellStyle cellStyle =workbook.createCellStyle(); cellStyle.setAlignment(HorizontalAlignment.LEFT); cellStyle.setVerticalAlignment(VerticalAlignment.TOP); diff --git a/adc-da-slrs/src/main/java/com/adc/da/utils/util/FieldConvertUtil.java b/adc-da-slrs/src/main/java/com/adc/da/utils/util/FieldConvertUtil.java index ed53e2a6..77b17ad3 100644 --- a/adc-da-slrs/src/main/java/com/adc/da/utils/util/FieldConvertUtil.java +++ b/adc-da-slrs/src/main/java/com/adc/da/utils/util/FieldConvertUtil.java @@ -93,10 +93,18 @@ public class FieldConvertUtil { "7.关联模块-乘用车VPPS编码和关联模块--卡车VPPS编码是填写数据库中已有的编码从而带出乘用车VPPS名称和卡车VPPS名称\n" + "8.发布稿,编制说明,历史版本,其他文件,修改单,关联文件为附件文件,需要放在Excel文档同级目录中"; - // TODO - public static String exportInsideOutsideMeetingDesc = "内部会议,外部会议"; + public static String exportInsideOutsideMeetingDesc ="填写说明\n" + + "1.导入数据从第三行开始,第一行为填写说明,第二行为表头,第三行是正式数据\n" + + "2.会议分类按照系统下拉菜单中的分类填写\n" + + "3.会议议题如果存在多条,则在下面以此填写,新的内外部会议另起一行填写"; - public static String exportLawsInformationDesc = ""; + public static String exportLawsInformationDesc = "填写说明\n" + + "1.导入数据从第三行开始,第一行为填写说明,第二行为表头,第三行是正式数据\n" + + "2.资料分类按照系统下拉菜单中的分类填写\n"; + + public static String exportLawsTopicDesc = "填写说明\n" + + "1.导入数据从第三行开始,第一行为填写说明,第二行为表头,第三行是正式数据\n" + + "2.课题组会议、课题组联系方式、内部联系方式如果存在多条,则在下面一次填写,新的课题组会议、课题组联系方式、内部联系方式在下面依次填写"; public static String exportFieldName = "*企标类别,*企标编号,*标准年份,*企标名称,企标英文名称,*文本状态,发布日期,企标实施日期,起草部门,起草人,适用车型,能源类型,适用产品线,体系类别,关联模块-乘用车VPPS编码,关联模块--卡车VPPS编码,发布稿,编制说明,历史版本,其他文件,修改单,代替企标编号,采用标准,采标程度,引用标准,关联文件,";