forked from rongchao/epmet-cloud-rizhao
13 changed files with 556 additions and 6 deletions
@ -0,0 +1,116 @@ |
|||
package com.epmet.dto; |
|||
|
|||
import lombok.Data; |
|||
|
|||
import java.io.Serializable; |
|||
import java.util.Date; |
|||
|
|||
|
|||
/** |
|||
* issue库附件表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-09-30 |
|||
*/ |
|||
@Data |
|||
public class IssueAttachmentDTO implements Serializable { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 主键 |
|||
*/ |
|||
private String id; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 业务id |
|||
*/ |
|||
private String businessId; |
|||
|
|||
/** |
|||
* 议题:issue |
|||
*/ |
|||
private String attachTo; |
|||
|
|||
/** |
|||
* 附件名 |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) |
|||
*/ |
|||
private String format; |
|||
|
|||
/** |
|||
* 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) |
|||
*/ |
|||
private String type; |
|||
|
|||
/** |
|||
* 附件地址 |
|||
*/ |
|||
private String url; |
|||
|
|||
/** |
|||
* 排序字段 |
|||
*/ |
|||
private Integer sort; |
|||
|
|||
/** |
|||
* 附件状态(审核中:auditing; |
|||
auto_passed: 自动通过; |
|||
review:结果不确定,需要人工审核; |
|||
block: 结果违规; |
|||
rejected:人工审核驳回; |
|||
approved:人工审核通过) |
|||
现在图片是同步审核的,所以图片只有auto_passed一种状态 |
|||
*/ |
|||
private String status; |
|||
|
|||
/** |
|||
* 失败原因 |
|||
*/ |
|||
private String reason; |
|||
|
|||
/** |
|||
* 语音或视频时长,秒 |
|||
*/ |
|||
private Integer duration; |
|||
|
|||
/** |
|||
* 删除标记 0:未删除,1:已删除 |
|||
*/ |
|||
private String delFlag; |
|||
|
|||
/** |
|||
* 乐观锁 |
|||
*/ |
|||
private Integer revision; |
|||
|
|||
/** |
|||
* 创建人 |
|||
*/ |
|||
private String createdBy; |
|||
|
|||
/** |
|||
* 创建时间 |
|||
*/ |
|||
private Date createdTime; |
|||
|
|||
/** |
|||
* 更新人 |
|||
*/ |
|||
private String updatedBy; |
|||
|
|||
/** |
|||
* 更新时间 |
|||
*/ |
|||
private Date updatedTime; |
|||
|
|||
} |
@ -0,0 +1,16 @@ |
|||
package com.epmet.dao; |
|||
|
|||
import com.epmet.commons.mybatis.dao.BaseDao; |
|||
import com.epmet.entity.IssueAttachmentEntity; |
|||
import org.apache.ibatis.annotations.Mapper; |
|||
|
|||
/** |
|||
* issue库附件表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-09-30 |
|||
*/ |
|||
@Mapper |
|||
public interface IssueAttachmentDao extends BaseDao<IssueAttachmentEntity> { |
|||
|
|||
} |
@ -0,0 +1,82 @@ |
|||
package com.epmet.entity; |
|||
|
|||
import com.baomidou.mybatisplus.annotation.TableName; |
|||
import com.epmet.commons.mybatis.entity.BaseEpmetEntity; |
|||
import lombok.Data; |
|||
import lombok.EqualsAndHashCode; |
|||
|
|||
/** |
|||
* issue库附件表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-09-30 |
|||
*/ |
|||
@Data |
|||
@EqualsAndHashCode(callSuper=false) |
|||
@TableName("issue_attachment") |
|||
public class IssueAttachmentEntity extends BaseEpmetEntity { |
|||
|
|||
private static final long serialVersionUID = 1L; |
|||
|
|||
/** |
|||
* 客户ID |
|||
*/ |
|||
private String customerId; |
|||
|
|||
/** |
|||
* 业务id |
|||
*/ |
|||
private String businessId; |
|||
|
|||
/** |
|||
* 议题:issue |
|||
*/ |
|||
private String attachTo; |
|||
|
|||
/** |
|||
* 附件名 |
|||
*/ |
|||
private String name; |
|||
|
|||
/** |
|||
* 文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS) |
|||
*/ |
|||
private String format; |
|||
|
|||
/** |
|||
* 附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc)) |
|||
*/ |
|||
private String type; |
|||
|
|||
/** |
|||
* 附件地址 |
|||
*/ |
|||
private String url; |
|||
|
|||
/** |
|||
* 排序字段 |
|||
*/ |
|||
private Integer sort; |
|||
|
|||
/** |
|||
* 附件状态(审核中:auditing; |
|||
auto_passed: 自动通过; |
|||
review:结果不确定,需要人工审核; |
|||
block: 结果违规; |
|||
rejected:人工审核驳回; |
|||
approved:人工审核通过) |
|||
现在图片是同步审核的,所以图片只有auto_passed一种状态 |
|||
*/ |
|||
private String status; |
|||
|
|||
/** |
|||
* 失败原因 |
|||
*/ |
|||
private String reason; |
|||
|
|||
/** |
|||
* 语音或视频时长,秒 |
|||
*/ |
|||
private Integer duration; |
|||
|
|||
} |
@ -0,0 +1,78 @@ |
|||
package com.epmet.service; |
|||
|
|||
import com.epmet.commons.mybatis.service.BaseService; |
|||
import com.epmet.commons.tools.page.PageData; |
|||
import com.epmet.dto.IssueAttachmentDTO; |
|||
import com.epmet.entity.IssueAttachmentEntity; |
|||
|
|||
import java.util.List; |
|||
import java.util.Map; |
|||
|
|||
/** |
|||
* issue库附件表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-09-30 |
|||
*/ |
|||
public interface IssueAttachmentService extends BaseService<IssueAttachmentEntity> { |
|||
|
|||
/** |
|||
* 默认分页 |
|||
* |
|||
* @param params |
|||
* @return PageData<IssueAttachmentDTO> |
|||
* @author generator |
|||
* @date 2022-09-30 |
|||
*/ |
|||
PageData<IssueAttachmentDTO> page(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 默认查询 |
|||
* |
|||
* @param params |
|||
* @return java.util.List<IssueAttachmentDTO> |
|||
* @author generator |
|||
* @date 2022-09-30 |
|||
*/ |
|||
List<IssueAttachmentDTO> list(Map<String, Object> params); |
|||
|
|||
/** |
|||
* 单条查询 |
|||
* |
|||
* @param id |
|||
* @return IssueAttachmentDTO |
|||
* @author generator |
|||
* @date 2022-09-30 |
|||
*/ |
|||
IssueAttachmentDTO get(String id); |
|||
|
|||
/** |
|||
* 默认保存 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2022-09-30 |
|||
*/ |
|||
void save(IssueAttachmentDTO dto); |
|||
|
|||
/** |
|||
* 默认更新 |
|||
* |
|||
* @param dto |
|||
* @return void |
|||
* @author generator |
|||
* @date 2022-09-30 |
|||
*/ |
|||
void update(IssueAttachmentDTO dto); |
|||
|
|||
/** |
|||
* 批量删除 |
|||
* |
|||
* @param ids |
|||
* @return void |
|||
* @author generator |
|||
* @date 2022-09-30 |
|||
*/ |
|||
void delete(String[] ids); |
|||
} |
@ -0,0 +1,82 @@ |
|||
package com.epmet.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.dao.IssueAttachmentDao; |
|||
import com.epmet.dto.IssueAttachmentDTO; |
|||
import com.epmet.entity.IssueAttachmentEntity; |
|||
import com.epmet.service.IssueAttachmentService; |
|||
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; |
|||
|
|||
/** |
|||
* issue库附件表 |
|||
* |
|||
* @author generator generator@elink-cn.com |
|||
* @since v1.0.0 2022-09-30 |
|||
*/ |
|||
@Service |
|||
public class IssueAttachmentServiceImpl extends BaseServiceImpl<IssueAttachmentDao, IssueAttachmentEntity> implements IssueAttachmentService { |
|||
|
|||
@Override |
|||
public PageData<IssueAttachmentDTO> page(Map<String, Object> params) { |
|||
IPage<IssueAttachmentEntity> page = baseDao.selectPage( |
|||
getPage(params, FieldConstant.CREATED_TIME, false), |
|||
getWrapper(params) |
|||
); |
|||
return getPageData(page, IssueAttachmentDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
public List<IssueAttachmentDTO> list(Map<String, Object> params) { |
|||
List<IssueAttachmentEntity> entityList = baseDao.selectList(getWrapper(params)); |
|||
|
|||
return ConvertUtils.sourceToTarget(entityList, IssueAttachmentDTO.class); |
|||
} |
|||
|
|||
private QueryWrapper<IssueAttachmentEntity> getWrapper(Map<String, Object> params){ |
|||
String id = (String)params.get(FieldConstant.ID_HUMP); |
|||
|
|||
QueryWrapper<IssueAttachmentEntity> wrapper = new QueryWrapper<>(); |
|||
wrapper.eq(StringUtils.isNotBlank(id), FieldConstant.ID, id); |
|||
|
|||
return wrapper; |
|||
} |
|||
|
|||
@Override |
|||
public IssueAttachmentDTO get(String id) { |
|||
IssueAttachmentEntity entity = baseDao.selectById(id); |
|||
return ConvertUtils.sourceToTarget(entity, IssueAttachmentDTO.class); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void save(IssueAttachmentDTO dto) { |
|||
IssueAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, IssueAttachmentEntity.class); |
|||
insert(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void update(IssueAttachmentDTO dto) { |
|||
IssueAttachmentEntity entity = ConvertUtils.sourceToTarget(dto, IssueAttachmentEntity.class); |
|||
updateById(entity); |
|||
} |
|||
|
|||
@Override |
|||
@Transactional(rollbackFor = Exception.class) |
|||
public void delete(String[] ids) { |
|||
// 逻辑删除(@TableLogic 注解)
|
|||
baseDao.deleteBatchIds(Arrays.asList(ids)); |
|||
} |
|||
|
|||
} |
@ -1,2 +1,32 @@ |
|||
ALTER TABLE issue MODIFY COLUMN SOURCE_ID varchar(32) NULL COMMENT '来源ID eg:2223232(当SOURCE_TYPE为"resi_topic"时,这里指话题的ID),issue时为空' AFTER SOURCE_TYPE; |
|||
ALTER TABLE issue MODIFY COLUMN SOURCE_TYPE varchar(32) NULL COMMENT '来源类型 话题:resi_topic;直接立议题:issue;' AFTER ISSUE_STATUS; |
|||
|
|||
ALTER TABLE issue_application MODIFY COLUMN GROUP_ID varchar(64) NULL COMMENT '小组id' AFTER TOPIC_ID; |
|||
ALTER TABLE issue_application MODIFY COLUMN TOPIC_ID varchar(32) NULL COMMENT '话题id' AFTER APPLY_STATUS; |
|||
|
|||
|
|||
alter table issue add column ADDRESS VARCHAR(255) DEFAULT '' COMMENT '地址' AFTER `SUGGESTION`; |
|||
alter table issue add COLUMN LONGITUDE VARCHAR(64) DEFAULT'' COMMENT '经度' AFTER ADDRESS; |
|||
alter table issue add COLUMN LATITUDE VARCHAR(64) DEFAULT'' COMMENT '纬度' AFTER LONGITUDE; |
|||
|
|||
CREATE TABLE `issue_attachment` ( |
|||
`ID` varchar(64) NOT NULL COMMENT '主键', |
|||
`CUSTOMER_ID` varchar(64) NOT NULL COMMENT '客户ID', |
|||
`BUSINESS_ID` varchar(64) NOT NULL COMMENT '业务id', |
|||
`ATTACH_TO` varchar(32) DEFAULT NULL COMMENT '议题:issue', |
|||
`NAME` varchar(64) DEFAULT NULL COMMENT '附件名', |
|||
`FORMAT` varchar(64) DEFAULT NULL COMMENT '文件格式(JPG、PNG、PDF、JPEG、BMP、MP4、WMA、M4A、MP3、DOC、DOCX、XLS)', |
|||
`TYPE` varchar(64) NOT NULL COMMENT '附件类型((图片 - image、 视频 - video、 语音 - voice、 文档 - doc))', |
|||
`URL` varchar(255) NOT NULL COMMENT '附件地址', |
|||
`SORT` int(1) NOT NULL COMMENT '排序字段', |
|||
`STATUS` varchar(32) NOT NULL DEFAULT 'auto_passed' COMMENT '附件状态(审核中:auditing; \r\nauto_passed: 自动通过;\r\nreview:结果不确定,需要人工审核;\r\nblock: 结果违规;\r\nrejected:人工审核驳回;\r\napproved:人工审核通过)\r\n现在图片是同步审核的,所以图片只有auto_passed一种状态', |
|||
`REASON` varchar(255) DEFAULT NULL COMMENT '失败原因', |
|||
`DURATION` int(11) DEFAULT NULL COMMENT '语音或视频时长,秒', |
|||
`DEL_FLAG` varchar(1) NOT NULL COMMENT '删除标记 0:未删除,1:已删除', |
|||
`REVISION` int(11) NOT NULL COMMENT '乐观锁', |
|||
`CREATED_BY` varchar(32) NOT NULL COMMENT '创建人', |
|||
`CREATED_TIME` datetime NOT NULL COMMENT '创建时间', |
|||
`UPDATED_BY` varchar(32) NOT NULL COMMENT '更新人', |
|||
`UPDATED_TIME` datetime NOT NULL COMMENT '更新时间', |
|||
PRIMARY KEY (`ID`) USING BTREE |
|||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 ROW_FORMAT=COMPACT COMMENT='issue库附件表'; |
@ -0,0 +1,6 @@ |
|||
<?xml version="1.0" encoding="UTF-8"?> |
|||
<!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
|||
|
|||
<mapper namespace="com.epmet.dao.IssueAttachmentDao"> |
|||
|
|||
</mapper> |
Loading…
Reference in new issue