From 8e389d76dc48b7fe67a492e3bdcded7930558f24 Mon Sep 17 00:00:00 2001 From: sunyuchao Date: Thu, 17 Dec 2020 13:59:30 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=9D=E9=A2=98=E8=AF=AD=E9=9F=B3=E4=BB=A3?= =?UTF-8?q?=E7=A0=81=E7=94=9F=E6=88=90?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../dto/topic/TopicDraftAttachmentDTO.java | 117 ++++++++++++++ .../resi/group/dto/topic/TopicDraftDTO.java | 146 ++++++++++++++++++ .../dto/topic/TopicDraftOperationDTO.java | 96 ++++++++++++ .../controller/TopicDraftController.java | 94 +++++++++++ .../topic/dao/TopicDraftAttachmentDao.java | 33 ++++ .../modules/topic/dao/TopicDraftDao.java | 33 ++++ .../topic/dao/TopicDraftOperationDao.java | 33 ++++ .../entity/TopicDraftAttachmentEntity.java | 87 +++++++++++ .../topic/entity/TopicDraftEntity.java | 116 ++++++++++++++ .../entity/TopicDraftOperationEntity.java | 66 ++++++++ .../com/epmet/modules/topic/excel/.gitkeep | 0 .../excel/TopicDraftAttachmentExcel.java | 80 ++++++++++ .../modules/topic/excel/TopicDraftExcel.java | 98 ++++++++++++ .../topic/excel/TopicDraftOperationExcel.java | 68 ++++++++ .../service/TopicDraftAttachmentService.java | 95 ++++++++++++ .../service/TopicDraftOperationService.java | 95 ++++++++++++ .../topic/service/TopicDraftService.java | 95 ++++++++++++ .../epmet/modules/topic/service/impl/.gitkeep | 0 .../impl/TopicDraftAttachmentServiceImpl.java | 99 ++++++++++++ .../impl/TopicDraftOperationServiceImpl.java | 99 ++++++++++++ .../service/impl/TopicDraftServiceImpl.java | 99 ++++++++++++ .../src/main/resources/mapper/topic/.gitkeep | 0 .../mapper/topic/TopicDraftAttachmentDao.xml | 8 + .../resources/mapper/topic/TopicDraftDao.xml | 7 + .../mapper/topic/TopicDraftOperationDao.xml | 8 + 25 files changed, 1672 insertions(+) create mode 100644 epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/TopicDraftAttachmentDTO.java create mode 100644 epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/TopicDraftDTO.java create mode 100644 epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/TopicDraftOperationDTO.java create mode 100644 epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/TopicDraftController.java create mode 100644 epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/TopicDraftAttachmentDao.java create mode 100644 epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/TopicDraftDao.java create mode 100644 epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/TopicDraftOperationDao.java create mode 100644 epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/TopicDraftAttachmentEntity.java create mode 100644 epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/TopicDraftEntity.java create mode 100644 epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/TopicDraftOperationEntity.java delete mode 100644 epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/excel/.gitkeep create mode 100644 epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/excel/TopicDraftAttachmentExcel.java create mode 100644 epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/excel/TopicDraftExcel.java create mode 100644 epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/excel/TopicDraftOperationExcel.java create mode 100644 epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/TopicDraftAttachmentService.java create mode 100644 epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/TopicDraftOperationService.java create mode 100644 epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/TopicDraftService.java delete mode 100644 epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/.gitkeep create mode 100644 epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftAttachmentServiceImpl.java create mode 100644 epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftOperationServiceImpl.java create mode 100644 epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftServiceImpl.java delete mode 100644 epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/.gitkeep create mode 100644 epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/TopicDraftAttachmentDao.xml create mode 100644 epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/TopicDraftDao.xml create mode 100644 epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/TopicDraftOperationDao.xml diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/TopicDraftAttachmentDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/TopicDraftAttachmentDTO.java new file mode 100644 index 0000000000..35ec1d69ee --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/TopicDraftAttachmentDTO.java @@ -0,0 +1,117 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.resi.group.dto.topic; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 话题草稿附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-17 + */ +@Data +public class TopicDraftAttachmentDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 附件id + */ + private String id; + + /** + * 话题草稿id + */ + private String topicDraftId; + + /** + * 客户id + */ + private String customerId; + + /** + * 附件名(uuid随机生成) + */ + private String attachmentName; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String attachmentFormat; + + /** + * 附件类型((图片 - image、视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * 附件地址url + */ + private String attachmentUrl; + + /** + * 排序字段(按附件类型分组排序) + */ + private Integer sort; + + /** + * 附件状态(审核中:auditing; + auto_passed: 自动通过; + review:结果不确定,需要人工审核; + block: 结果违规; + rejected:人工审核驳回; + approved:人工审核通过) + 现在图片是同步审核的,所以图片只有auto_passed一种状态 + */ + private String status; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 创建人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/TopicDraftDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/TopicDraftDTO.java new file mode 100644 index 0000000000..80fcc43105 --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/TopicDraftDTO.java @@ -0,0 +1,146 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.resi.group.dto.topic; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 话题草稿内容表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-17 + */ +@Data +public class TopicDraftDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 话题草稿id + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 小组Id + */ + private String groupId; + + /** + * 话题内容 + */ + private String topicContent; + + /** + * 话题草稿状态(审核中:auditing; + auto_passed: 自动通过; + review:结果不确定,需要人工审核; + block: 结果违规; + rejected:人工审核驳回; + approved:人工审核通过) + */ + private String draftStatus; + + /** + * 草稿审核理由 + */ + private String draftReason; + + /** + * 省 + */ + private String province; + + /** + * 市 + */ + private String city; + + /** + * 区 + */ + private String area; + + /** + * 地址 + */ + private String address; + + /** + * 经度 + */ + private String longitude; + + /** + * 维度 + */ + private String dimension; + + /** + * 发布成功后的话题id + */ + private String topicId; + + /** + * 创建者是否可见(0是 1否) + */ + private String isSee; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 话题发布人 + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/TopicDraftOperationDTO.java b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/TopicDraftOperationDTO.java new file mode 100644 index 0000000000..b0629f991a --- /dev/null +++ b/epmet-module/resi-group/resi-group-client/src/main/java/com/epmet/resi/group/dto/topic/TopicDraftOperationDTO.java @@ -0,0 +1,96 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.resi.group.dto.topic; + +import java.io.Serializable; +import java.util.Date; +import lombok.Data; + + +/** + * 话题草稿操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-17 + */ +@Data +public class TopicDraftOperationDTO implements Serializable { + + private static final long serialVersionUID = 1L; + + /** + * 话题草稿操作日志id + */ + private String id; + + /** + * 客户id + */ + private String customerId; + + /** + * 话题草稿id + */ + private String topicDraftId; + + /** + * 操作类型:submit:提交发布; + auto_passed: 自动审核-通过; + review:自动审核-结果不确定,需要人工审核; + block: 自动审核-结果违规; + rejected:人工审核驳回; + approved:人工审核通过 + */ + private String operateType; + + /** + * 操作时的备注,比如驳回理由 + */ + private String remark; + + /** + * 删除标记 0:未删除,1:已删除 + */ + private String delFlag; + + /** + * 乐观锁 + */ + private Integer revision; + + /** + * 操作人,API审核结果,存储为SCAN_USER或者APP_USER + */ + private String createdBy; + + /** + * 创建时间 + */ + private Date createdTime; + + /** + * 更新人 + */ + private String updatedBy; + + /** + * 更新时间 + */ + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/TopicDraftController.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/TopicDraftController.java new file mode 100644 index 0000000000..71f79e615b --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/controller/TopicDraftController.java @@ -0,0 +1,94 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.topic.controller; + +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ExcelUtils; +import com.epmet.commons.tools.utils.Result; +import com.epmet.commons.tools.validator.AssertUtils; +import com.epmet.commons.tools.validator.ValidatorUtils; +import com.epmet.commons.tools.validator.group.AddGroup; +import com.epmet.commons.tools.validator.group.DefaultGroup; +import com.epmet.commons.tools.validator.group.UpdateGroup; +import com.epmet.modules.topic.excel.TopicDraftExcel; +import com.epmet.modules.topic.service.TopicDraftService; +import com.epmet.resi.group.dto.topic.TopicDraftDTO; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.web.bind.annotation.*; + +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Map; + + +/** + * 话题草稿内容表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-17 + */ +@RestController +@RequestMapping("topicdraft") +public class TopicDraftController { + + @Autowired + private TopicDraftService topicDraftService; + + @GetMapping("page") + public Result> page(@RequestParam Map params){ + PageData page = topicDraftService.page(params); + return new Result>().ok(page); + } + + @GetMapping("{id}") + public Result get(@PathVariable("id") String id){ + TopicDraftDTO data = topicDraftService.get(id); + return new Result().ok(data); + } + + @PostMapping + public Result save(@RequestBody TopicDraftDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, AddGroup.class, DefaultGroup.class); + topicDraftService.save(dto); + return new Result(); + } + + @PutMapping + public Result update(@RequestBody TopicDraftDTO dto){ + //效验数据 + ValidatorUtils.validateEntity(dto, UpdateGroup.class, DefaultGroup.class); + topicDraftService.update(dto); + return new Result(); + } + + @DeleteMapping + public Result delete(@RequestBody String[] ids){ + //效验数据 + AssertUtils.isArrayEmpty(ids, "id"); + topicDraftService.delete(ids); + return new Result(); + } + + @GetMapping("export") + public void export(@RequestParam Map params, HttpServletResponse response) throws Exception { + List list = topicDraftService.list(params); + ExcelUtils.exportExcelToTarget(response, null, list, TopicDraftExcel.class); + } + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/TopicDraftAttachmentDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/TopicDraftAttachmentDao.java new file mode 100644 index 0000000000..a41c95d420 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/TopicDraftAttachmentDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.topic.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.modules.topic.entity.TopicDraftAttachmentEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 话题草稿附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-17 + */ +@Mapper +public interface TopicDraftAttachmentDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/TopicDraftDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/TopicDraftDao.java new file mode 100644 index 0000000000..e4a41b173b --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/TopicDraftDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.topic.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.modules.topic.entity.TopicDraftEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 话题草稿内容表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-17 + */ +@Mapper +public interface TopicDraftDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/TopicDraftOperationDao.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/TopicDraftOperationDao.java new file mode 100644 index 0000000000..83350cea13 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/dao/TopicDraftOperationDao.java @@ -0,0 +1,33 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.topic.dao; + +import com.epmet.commons.mybatis.dao.BaseDao; +import com.epmet.modules.topic.entity.TopicDraftOperationEntity; +import org.apache.ibatis.annotations.Mapper; + +/** + * 话题草稿操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-17 + */ +@Mapper +public interface TopicDraftOperationDao extends BaseDao { + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/TopicDraftAttachmentEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/TopicDraftAttachmentEntity.java new file mode 100644 index 0000000000..0929f7adba --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/TopicDraftAttachmentEntity.java @@ -0,0 +1,87 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.topic.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 话题草稿附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("topic_draft_attachment") +public class TopicDraftAttachmentEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 话题草稿id + */ + private String topicDraftId; + + /** + * 客户id + */ + private String customerId; + + /** + * 附件名(uuid随机生成) + */ + private String attachmentName; + + /** + * 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) + */ + private String attachmentFormat; + + /** + * 附件类型((图片 - image、视频 - video、 语音 - voice、 文档 - doc)) + */ + private String attachmentType; + + /** + * 附件地址url + */ + private String attachmentUrl; + + /** + * 排序字段(按附件类型分组排序) + */ + private Integer sort; + + /** + * 附件状态(审核中:auditing; + auto_passed: 自动通过; + review:结果不确定,需要人工审核; + block: 结果违规; + rejected:人工审核驳回; + approved:人工审核通过) + 现在图片是同步审核的,所以图片只有auto_passed一种状态 + */ + private String status; + +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/TopicDraftEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/TopicDraftEntity.java new file mode 100644 index 0000000000..513e03c4cf --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/TopicDraftEntity.java @@ -0,0 +1,116 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.topic.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 话题草稿内容表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("topic_draft") +public class TopicDraftEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 网格ID + */ + private String gridId; + + /** + * 小组Id + */ + private String groupId; + + /** + * 话题内容 + */ + private String topicContent; + + /** + * 话题草稿状态(审核中:auditing; + auto_passed: 自动通过; + review:结果不确定,需要人工审核; + block: 结果违规; + rejected:人工审核驳回; + approved:人工审核通过) + */ + private String draftStatus; + + /** + * 草稿审核理由 + */ + private String draftReason; + + /** + * 省 + */ + private String province; + + /** + * 市 + */ + private String city; + + /** + * 区 + */ + private String area; + + /** + * 地址 + */ + private String address; + + /** + * 经度 + */ + private String longitude; + + /** + * 维度 + */ + private String dimension; + + /** + * 发布成功后的话题id + */ + private String topicId; + + /** + * 创建者是否可见(0是 1否) + */ + private String isSee; + +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/TopicDraftOperationEntity.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/TopicDraftOperationEntity.java new file mode 100644 index 0000000000..e1092bbaf5 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/entity/TopicDraftOperationEntity.java @@ -0,0 +1,66 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.topic.entity; + +import com.baomidou.mybatisplus.annotation.TableName; + +import com.epmet.commons.mybatis.entity.BaseEpmetEntity; +import lombok.Data; +import lombok.EqualsAndHashCode; + +import java.util.Date; + +/** + * 话题草稿操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-17 + */ +@Data +@EqualsAndHashCode(callSuper=false) +@TableName("topic_draft_operation") +public class TopicDraftOperationEntity extends BaseEpmetEntity { + + private static final long serialVersionUID = 1L; + + /** + * 客户id + */ + private String customerId; + + /** + * 话题草稿id + */ + private String topicDraftId; + + /** + * 操作类型:submit:提交发布; + auto_passed: 自动审核-通过; + review:自动审核-结果不确定,需要人工审核; + block: 自动审核-结果违规; + rejected:人工审核驳回; + approved:人工审核通过 + */ + private String operateType; + + /** + * 操作时的备注,比如驳回理由 + */ + private String remark; + +} diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/excel/.gitkeep b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/excel/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/excel/TopicDraftAttachmentExcel.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/excel/TopicDraftAttachmentExcel.java new file mode 100644 index 0000000000..bf2dfe4460 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/excel/TopicDraftAttachmentExcel.java @@ -0,0 +1,80 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.topic.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 话题草稿附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-17 + */ +@Data +public class TopicDraftAttachmentExcel { + + @Excel(name = "附件id") + private String id; + + @Excel(name = "话题草稿id") + private String topicDraftId; + + @Excel(name = "客户id") + private String customerId; + + @Excel(name = "附件名(uuid随机生成)") + private String attachmentName; + + @Excel(name = "文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS)") + private String attachmentFormat; + + @Excel(name = "附件类型((图片 - image、视频 - video、 语音 - voice、 文档 - doc))") + private String attachmentType; + + @Excel(name = "附件地址url") + private String attachmentUrl; + + @Excel(name = "排序字段(按附件类型分组排序)") + private Integer sort; + + @Excel(name = "附件状态(审核中:auditing;auto_passed: 自动通过;review:结果不确定,需要人工审核;"+ +"block: 结果违规;rejected:人工审核驳回;approved:人工审核通过)现在图片是同步审核的,所以图片只有auto_passed一种状态") + private String status; + + @Excel(name = "删除标记 0:未删除,1:已删除") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "创建人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/excel/TopicDraftExcel.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/excel/TopicDraftExcel.java new file mode 100644 index 0000000000..2a7d97c8b9 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/excel/TopicDraftExcel.java @@ -0,0 +1,98 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.topic.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 话题草稿内容表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-17 + */ +@Data +public class TopicDraftExcel { + + @Excel(name = "话题草稿id") + private String id; + + @Excel(name = "客户id") + private String customerId; + + @Excel(name = "网格ID") + private String gridId; + + @Excel(name = "小组Id") + private String groupId; + + @Excel(name = "话题内容") + private String topicContent; + + @Excel(name = "话题草稿状态(审核中:auditing; auto_passed: 自动通过;review:结果不确定,需要人工审核;"+ +"block: 结果违规;rejected:人工审核驳回;approved:人工审核通过)") + private String draftStatus; + + @Excel(name = "草稿审核理由") + private String draftReason; + + @Excel(name = "省") + private String province; + + @Excel(name = "市") + private String city; + + @Excel(name = "区 ") + private String area; + + @Excel(name = "地址") + private String address; + + @Excel(name = "经度") + private String longitude; + + @Excel(name = "维度") + private String dimension; + + @Excel(name = "发布成功后的话题id") + private String topicId; + + @Excel(name = "创建者是否可见(0是 1否)") + private String isSee; + + @Excel(name = "删除标记 0:未删除,1:已删除") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "话题发布人") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/excel/TopicDraftOperationExcel.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/excel/TopicDraftOperationExcel.java new file mode 100644 index 0000000000..428b9c4140 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/excel/TopicDraftOperationExcel.java @@ -0,0 +1,68 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.topic.excel; + +import cn.afterturn.easypoi.excel.annotation.Excel; +import lombok.Data; + +import java.util.Date; + +/** + * 话题草稿操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-17 + */ +@Data +public class TopicDraftOperationExcel { + + @Excel(name = "话题草稿操作日志id") + private String id; + + @Excel(name = "客户id") + private String customerId; + + @Excel(name = "话题草稿id") + private String topicDraftId; + + @Excel(name = "操作类型:submit:提交发布; auto_passed: 自动审核-通过;review:自动审核-结果不确定,需要人工审核;"+ +"block: 自动审核-结果违规;rejected:人工审核驳回;approved:人工审核通过") + private String operateType; + + @Excel(name = "操作时的备注,比如驳回理由") + private String remark; + + @Excel(name = "删除标记 0:未删除,1:已删除") + private String delFlag; + + @Excel(name = "乐观锁") + private Integer revision; + + @Excel(name = "操作人,API审核结果,存储为SCAN_USER或者APP_USER") + private String createdBy; + + @Excel(name = "创建时间") + private Date createdTime; + + @Excel(name = "更新人") + private String updatedBy; + + @Excel(name = "更新时间") + private Date updatedTime; + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/TopicDraftAttachmentService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/TopicDraftAttachmentService.java new file mode 100644 index 0000000000..6a40eb8236 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/TopicDraftAttachmentService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.topic.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.modules.topic.entity.TopicDraftAttachmentEntity; +import com.epmet.resi.group.dto.topic.TopicDraftAttachmentDTO; + +import java.util.List; +import java.util.Map; + +/** + * 话题草稿附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-17 + */ +public interface TopicDraftAttachmentService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-12-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-12-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return TopicDraftAttachmentDTO + * @author generator + * @date 2020-12-17 + */ + TopicDraftAttachmentDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-12-17 + */ + void save(TopicDraftAttachmentDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-12-17 + */ + void update(TopicDraftAttachmentDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-12-17 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/TopicDraftOperationService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/TopicDraftOperationService.java new file mode 100644 index 0000000000..f118236a8d --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/TopicDraftOperationService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.topic.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.modules.topic.entity.TopicDraftOperationEntity; +import com.epmet.resi.group.dto.topic.TopicDraftOperationDTO; + +import java.util.List; +import java.util.Map; + +/** + * 话题草稿操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-17 + */ +public interface TopicDraftOperationService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-12-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-12-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return TopicDraftOperationDTO + * @author generator + * @date 2020-12-17 + */ + TopicDraftOperationDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-12-17 + */ + void save(TopicDraftOperationDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-12-17 + */ + void update(TopicDraftOperationDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-12-17 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/TopicDraftService.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/TopicDraftService.java new file mode 100644 index 0000000000..d32cd5a42a --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/TopicDraftService.java @@ -0,0 +1,95 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.topic.service; + +import com.epmet.commons.mybatis.service.BaseService; +import com.epmet.commons.tools.page.PageData; +import com.epmet.modules.topic.entity.TopicDraftEntity; +import com.epmet.resi.group.dto.topic.TopicDraftDTO; + +import java.util.List; +import java.util.Map; + +/** + * 话题草稿内容表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-17 + */ +public interface TopicDraftService extends BaseService { + + /** + * 默认分页 + * + * @param params + * @return PageData + * @author generator + * @date 2020-12-17 + */ + PageData page(Map params); + + /** + * 默认查询 + * + * @param params + * @return java.util.List + * @author generator + * @date 2020-12-17 + */ + List list(Map params); + + /** + * 单条查询 + * + * @param id + * @return TopicDraftDTO + * @author generator + * @date 2020-12-17 + */ + TopicDraftDTO get(String id); + + /** + * 默认保存 + * + * @param dto + * @return void + * @author generator + * @date 2020-12-17 + */ + void save(TopicDraftDTO dto); + + /** + * 默认更新 + * + * @param dto + * @return void + * @author generator + * @date 2020-12-17 + */ + void update(TopicDraftDTO dto); + + /** + * 批量删除 + * + * @param ids + * @return void + * @author generator + * @date 2020-12-17 + */ + void delete(String[] ids); +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/.gitkeep b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftAttachmentServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftAttachmentServiceImpl.java new file mode 100644 index 0000000000..d34c50fe70 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftAttachmentServiceImpl.java @@ -0,0 +1,99 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.topic.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.modules.topic.dao.TopicDraftAttachmentDao; +import com.epmet.modules.topic.entity.TopicDraftAttachmentEntity; +import com.epmet.modules.topic.service.TopicDraftAttachmentService; +import com.epmet.resi.group.dto.topic.TopicDraftAttachmentDTO; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 话题草稿附件表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-17 + */ +@Service +public class TopicDraftAttachmentServiceImpl extends BaseServiceImpl implements TopicDraftAttachmentService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, TopicDraftAttachmentDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, TopicDraftAttachmentDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public TopicDraftAttachmentDTO get(String id) { + TopicDraftAttachmentEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, TopicDraftAttachmentDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(TopicDraftAttachmentDTO dto) { + TopicDraftAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, TopicDraftAttachmentEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(TopicDraftAttachmentDTO dto) { + TopicDraftAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, TopicDraftAttachmentEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftOperationServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftOperationServiceImpl.java new file mode 100644 index 0000000000..1fcf022738 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftOperationServiceImpl.java @@ -0,0 +1,99 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.topic.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.modules.topic.dao.TopicDraftOperationDao; +import com.epmet.modules.topic.entity.TopicDraftOperationEntity; +import com.epmet.modules.topic.service.TopicDraftOperationService; +import com.epmet.resi.group.dto.topic.TopicDraftOperationDTO; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 话题草稿操作日志表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-17 + */ +@Service +public class TopicDraftOperationServiceImpl extends BaseServiceImpl implements TopicDraftOperationService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, TopicDraftOperationDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, TopicDraftOperationDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public TopicDraftOperationDTO get(String id) { + TopicDraftOperationEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, TopicDraftOperationDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(TopicDraftOperationDTO dto) { + TopicDraftOperationEntity entity = ConvertUtils.sourceToTarget(dto, TopicDraftOperationEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(TopicDraftOperationDTO dto) { + TopicDraftOperationEntity entity = ConvertUtils.sourceToTarget(dto, TopicDraftOperationEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftServiceImpl.java b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftServiceImpl.java new file mode 100644 index 0000000000..ac3df4b7b8 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/java/com/epmet/modules/topic/service/impl/TopicDraftServiceImpl.java @@ -0,0 +1,99 @@ +/** + * Copyright 2018 人人开源 https://www.renren.io + *

+ * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + *

+ * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + *

+ * You should have received a copy of the GNU General Public License + * along with this program. If not, see . + */ + +package com.epmet.modules.topic.service.impl; + +import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; +import com.baomidou.mybatisplus.core.metadata.IPage; +import com.epmet.commons.mybatis.service.impl.BaseServiceImpl; +import com.epmet.commons.tools.constant.FieldConstant; +import com.epmet.commons.tools.page.PageData; +import com.epmet.commons.tools.utils.ConvertUtils; +import com.epmet.modules.topic.dao.TopicDraftDao; +import com.epmet.modules.topic.entity.TopicDraftEntity; +import com.epmet.modules.topic.service.TopicDraftService; +import com.epmet.resi.group.dto.topic.TopicDraftDTO; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import org.springframework.transaction.annotation.Transactional; + +import java.util.Arrays; +import java.util.List; +import java.util.Map; + +/** + * 话题草稿内容表 + * + * @author generator generator@elink-cn.com + * @since v1.0.0 2020-12-17 + */ +@Service +public class TopicDraftServiceImpl extends BaseServiceImpl implements TopicDraftService { + + @Override + public PageData page(Map params) { + IPage page = baseDao.selectPage( + getPage(params, FieldConstant.CREATED_TIME, false), + getWrapper(params) + ); + return getPageData(page, TopicDraftDTO.class); + } + + @Override + public List list(Map params) { + List entityList = baseDao.selectList(getWrapper(params)); + + return ConvertUtils.sourceToTarget(entityList, TopicDraftDTO.class); + } + + private QueryWrapper getWrapper(Map params){ + String id = (String)params.get(FieldConstant.ID_HUMP); + + QueryWrapper wrapper = new QueryWrapper<>(); + wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); + + return wrapper; + } + + @Override + public TopicDraftDTO get(String id) { + TopicDraftEntity entity = baseDao.selectById(id); + return ConvertUtils.sourceToTarget(entity, TopicDraftDTO.class); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void save(TopicDraftDTO dto) { + TopicDraftEntity entity = ConvertUtils.sourceToTarget(dto, TopicDraftEntity.class); + insert(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void update(TopicDraftDTO dto) { + TopicDraftEntity entity = ConvertUtils.sourceToTarget(dto, TopicDraftEntity.class); + updateById(entity); + } + + @Override + @Transactional(rollbackFor = Exception.class) + public void delete(String[] ids) { + // 逻辑删除(@TableLogic 注解) + baseDao.deleteBatchIds(Arrays.asList(ids)); + } + +} \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/.gitkeep b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/.gitkeep deleted file mode 100644 index e69de29bb2..0000000000 diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/TopicDraftAttachmentDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/TopicDraftAttachmentDao.xml new file mode 100644 index 0000000000..107d7bdee0 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/TopicDraftAttachmentDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/TopicDraftDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/TopicDraftDao.xml new file mode 100644 index 0000000000..acecc51e74 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/TopicDraftDao.xml @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/TopicDraftOperationDao.xml b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/TopicDraftOperationDao.xml new file mode 100644 index 0000000000..c25307d1c7 --- /dev/null +++ b/epmet-module/resi-group/resi-group-server/src/main/resources/mapper/topic/TopicDraftOperationDao.xml @@ -0,0 +1,8 @@ + + + + + + + + \ No newline at end of file