Kaynağa Gözat

新增话务模块-IVR文字文件

zhoufan 2 yıl önce
ebeveyn
işleme
908b98b855

+ 104 - 0
jiayi-api/src/main/java/com/jiayi/web/controller/call/CallIvrWordController.java

@@ -0,0 +1,104 @@
1
+package com.jiayi.web.controller.call;
2
+
3
+import java.util.List;
4
+import javax.servlet.http.HttpServletResponse;
5
+import org.springframework.security.access.prepost.PreAuthorize;
6
+import org.springframework.beans.factory.annotation.Autowired;
7
+import org.springframework.web.bind.annotation.GetMapping;
8
+import org.springframework.web.bind.annotation.PostMapping;
9
+import org.springframework.web.bind.annotation.PutMapping;
10
+import org.springframework.web.bind.annotation.DeleteMapping;
11
+import org.springframework.web.bind.annotation.PathVariable;
12
+import org.springframework.web.bind.annotation.RequestBody;
13
+import org.springframework.web.bind.annotation.RequestMapping;
14
+import org.springframework.web.bind.annotation.RestController;
15
+import com.jiayi.common.annotation.Log;
16
+import com.jiayi.common.core.controller.BaseController;
17
+import com.jiayi.common.core.domain.AjaxResult;
18
+import com.jiayi.common.enums.BusinessType;
19
+import com.jiayi.call.domain.CallIvrWord;
20
+import com.jiayi.call.service.ICallIvrWordService;
21
+import com.jiayi.common.utils.poi.ExcelUtil;
22
+import com.jiayi.common.core.page.TableDataInfo;
23
+
24
+/**
25
+ * ivr文字文件Controller
26
+ * 
27
+ * @author jiayi
28
+ * @date 2023-04-26
29
+ */
30
+@RestController
31
+@RequestMapping("/call/word")
32
+public class CallIvrWordController extends BaseController
33
+{
34
+    @Autowired
35
+    private ICallIvrWordService callIvrWordService;
36
+
37
+    /**
38
+     * 查询ivr文字文件列表
39
+     */
40
+    @PreAuthorize("@ss.hasPermi('call:word:list')")
41
+    @GetMapping("/list")
42
+    public TableDataInfo list(CallIvrWord callIvrWord)
43
+    {
44
+        startPage();
45
+        List<CallIvrWord> list = callIvrWordService.selectCallIvrWordList(callIvrWord);
46
+        return getDataTable(list);
47
+    }
48
+
49
+    /**
50
+     * 导出ivr文字文件列表
51
+     */
52
+    @PreAuthorize("@ss.hasPermi('call:word:export')")
53
+    @Log(title = "ivr文字文件", businessType = BusinessType.EXPORT)
54
+    @PostMapping("/export")
55
+    public void export(HttpServletResponse response, CallIvrWord callIvrWord)
56
+    {
57
+        List<CallIvrWord> list = callIvrWordService.selectCallIvrWordList(callIvrWord);
58
+        ExcelUtil<CallIvrWord> util = new ExcelUtil<CallIvrWord>(CallIvrWord.class);
59
+        util.exportExcel(response, list, "ivr文字文件数据");
60
+    }
61
+
62
+    /**
63
+     * 获取ivr文字文件详细信息
64
+     */
65
+    @PreAuthorize("@ss.hasPermi('call:word:query')")
66
+    @GetMapping(value = "/{wordId}")
67
+    public AjaxResult getInfo(@PathVariable("wordId") Long wordId)
68
+    {
69
+        return success(callIvrWordService.selectCallIvrWordByWordId(wordId));
70
+    }
71
+
72
+    /**
73
+     * 新增ivr文字文件
74
+     */
75
+    @PreAuthorize("@ss.hasPermi('call:word:add')")
76
+    @Log(title = "ivr文字文件", businessType = BusinessType.INSERT)
77
+    @PostMapping
78
+    public AjaxResult add(@RequestBody CallIvrWord callIvrWord)
79
+    {
80
+        return toAjax(callIvrWordService.insertCallIvrWord(callIvrWord));
81
+    }
82
+
83
+    /**
84
+     * 修改ivr文字文件
85
+     */
86
+    @PreAuthorize("@ss.hasPermi('call:word:edit')")
87
+    @Log(title = "ivr文字文件", businessType = BusinessType.UPDATE)
88
+    @PutMapping
89
+    public AjaxResult edit(@RequestBody CallIvrWord callIvrWord)
90
+    {
91
+        return toAjax(callIvrWordService.updateCallIvrWord(callIvrWord));
92
+    }
93
+
94
+    /**
95
+     * 删除ivr文字文件
96
+     */
97
+    @PreAuthorize("@ss.hasPermi('call:word:remove')")
98
+    @Log(title = "ivr文字文件", businessType = BusinessType.DELETE)
99
+	@DeleteMapping("/{wordIds}")
100
+    public AjaxResult remove(@PathVariable Long[] wordIds)
101
+    {
102
+        return toAjax(callIvrWordService.deleteCallIvrWordByWordIds(wordIds));
103
+    }
104
+}

+ 172 - 0
jiayi-call/src/main/java/com/jiayi/call/domain/CallIvrWord.java

@@ -0,0 +1,172 @@
1
+package com.jiayi.call.domain;
2
+
3
+import java.util.Date;
4
+import com.fasterxml.jackson.annotation.JsonFormat;
5
+import org.apache.commons.lang3.builder.ToStringBuilder;
6
+import org.apache.commons.lang3.builder.ToStringStyle;
7
+import com.jiayi.common.annotation.Excel;
8
+import com.jiayi.common.core.domain.BaseEntity;
9
+
10
+/**
11
+ * ivr文字文件对象 call_ivr_word
12
+ * 
13
+ * @author jiayi
14
+ * @date 2023-04-26
15
+ */
16
+public class CallIvrWord extends BaseEntity
17
+{
18
+    private static final long serialVersionUID = 1L;
19
+
20
+    /** 自增id */
21
+    private Long wordId;
22
+
23
+    /** 标题 */
24
+    @Excel(name = "标题")
25
+    private String title;
26
+
27
+    /** 内容 */
28
+    @Excel(name = "内容")
29
+    private String content;
30
+
31
+    /** 语音文件路径 */
32
+    @Excel(name = "语音文件路径")
33
+    private String filePath;
34
+
35
+    /** 类型1文字2路径 */
36
+    @Excel(name = "类型1文字2路径")
37
+    private Long type;
38
+
39
+    /** 开始时间 */
40
+    @JsonFormat(pattern = "yyyy-MM-dd")
41
+    @Excel(name = "开始时间", width = 30, dateFormat = "yyyy-MM-dd")
42
+    private Date startTime;
43
+
44
+    /** 结束时间 */
45
+    @JsonFormat(pattern = "yyyy-MM-dd")
46
+    @Excel(name = "结束时间", width = 30, dateFormat = "yyyy-MM-dd")
47
+    private Date endTime;
48
+
49
+    /** 删除标志(0代表存在 */
50
+    private String delFlag;
51
+
52
+    /** 删除者 */
53
+    @Excel(name = "删除者")
54
+    private String delBy;
55
+
56
+    /** 删除时间 */
57
+    @JsonFormat(pattern = "yyyy-MM-dd")
58
+    @Excel(name = "删除时间", width = 30, dateFormat = "yyyy-MM-dd")
59
+    private Date delTime;
60
+
61
+    public void setWordId(Long wordId) 
62
+    {
63
+        this.wordId = wordId;
64
+    }
65
+
66
+    public Long getWordId() 
67
+    {
68
+        return wordId;
69
+    }
70
+    public void setTitle(String title) 
71
+    {
72
+        this.title = title;
73
+    }
74
+
75
+    public String getTitle() 
76
+    {
77
+        return title;
78
+    }
79
+    public void setContent(String content) 
80
+    {
81
+        this.content = content;
82
+    }
83
+
84
+    public String getContent() 
85
+    {
86
+        return content;
87
+    }
88
+    public void setFilePath(String filePath) 
89
+    {
90
+        this.filePath = filePath;
91
+    }
92
+
93
+    public String getFilePath() 
94
+    {
95
+        return filePath;
96
+    }
97
+    public void setType(Long type) 
98
+    {
99
+        this.type = type;
100
+    }
101
+
102
+    public Long getType() 
103
+    {
104
+        return type;
105
+    }
106
+    public void setStartTime(Date startTime) 
107
+    {
108
+        this.startTime = startTime;
109
+    }
110
+
111
+    public Date getStartTime() 
112
+    {
113
+        return startTime;
114
+    }
115
+    public void setEndTime(Date endTime) 
116
+    {
117
+        this.endTime = endTime;
118
+    }
119
+
120
+    public Date getEndTime() 
121
+    {
122
+        return endTime;
123
+    }
124
+    public void setDelFlag(String delFlag) 
125
+    {
126
+        this.delFlag = delFlag;
127
+    }
128
+
129
+    public String getDelFlag() 
130
+    {
131
+        return delFlag;
132
+    }
133
+    public void setDelBy(String delBy) 
134
+    {
135
+        this.delBy = delBy;
136
+    }
137
+
138
+    public String getDelBy() 
139
+    {
140
+        return delBy;
141
+    }
142
+    public void setDelTime(Date delTime) 
143
+    {
144
+        this.delTime = delTime;
145
+    }
146
+
147
+    public Date getDelTime() 
148
+    {
149
+        return delTime;
150
+    }
151
+
152
+    @Override
153
+    public String toString() {
154
+        return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
155
+            .append("wordId", getWordId())
156
+            .append("title", getTitle())
157
+            .append("content", getContent())
158
+            .append("filePath", getFilePath())
159
+            .append("type", getType())
160
+            .append("startTime", getStartTime())
161
+            .append("endTime", getEndTime())
162
+            .append("remark", getRemark())
163
+            .append("delFlag", getDelFlag())
164
+            .append("createBy", getCreateBy())
165
+            .append("createTime", getCreateTime())
166
+            .append("updateBy", getUpdateBy())
167
+            .append("updateTime", getUpdateTime())
168
+            .append("delBy", getDelBy())
169
+            .append("delTime", getDelTime())
170
+            .toString();
171
+    }
172
+}

+ 61 - 0
jiayi-call/src/main/java/com/jiayi/call/mapper/CallIvrWordMapper.java

@@ -0,0 +1,61 @@
1
+package com.jiayi.call.mapper;
2
+
3
+import java.util.List;
4
+import com.jiayi.call.domain.CallIvrWord;
5
+
6
+/**
7
+ * ivr文字文件Mapper接口
8
+ * 
9
+ * @author jiayi
10
+ * @date 2023-04-26
11
+ */
12
+public interface CallIvrWordMapper 
13
+{
14
+    /**
15
+     * 查询ivr文字文件
16
+     * 
17
+     * @param wordId ivr文字文件主键
18
+     * @return ivr文字文件
19
+     */
20
+    public CallIvrWord selectCallIvrWordByWordId(Long wordId);
21
+
22
+    /**
23
+     * 查询ivr文字文件列表
24
+     * 
25
+     * @param callIvrWord ivr文字文件
26
+     * @return ivr文字文件集合
27
+     */
28
+    public List<CallIvrWord> selectCallIvrWordList(CallIvrWord callIvrWord);
29
+
30
+    /**
31
+     * 新增ivr文字文件
32
+     * 
33
+     * @param callIvrWord ivr文字文件
34
+     * @return 结果
35
+     */
36
+    public int insertCallIvrWord(CallIvrWord callIvrWord);
37
+
38
+    /**
39
+     * 修改ivr文字文件
40
+     * 
41
+     * @param callIvrWord ivr文字文件
42
+     * @return 结果
43
+     */
44
+    public int updateCallIvrWord(CallIvrWord callIvrWord);
45
+
46
+    /**
47
+     * 删除ivr文字文件
48
+     * 
49
+     * @param wordId ivr文字文件主键
50
+     * @return 结果
51
+     */
52
+    public int deleteCallIvrWordByWordId(Long wordId);
53
+
54
+    /**
55
+     * 批量删除ivr文字文件
56
+     * 
57
+     * @param wordIds 需要删除的数据主键集合
58
+     * @return 结果
59
+     */
60
+    public int deleteCallIvrWordByWordIds(Long[] wordIds);
61
+}

+ 61 - 0
jiayi-call/src/main/java/com/jiayi/call/service/ICallIvrWordService.java

@@ -0,0 +1,61 @@
1
+package com.jiayi.call.service;
2
+
3
+import java.util.List;
4
+import com.jiayi.call.domain.CallIvrWord;
5
+
6
+/**
7
+ * ivr文字文件Service接口
8
+ * 
9
+ * @author jiayi
10
+ * @date 2023-04-26
11
+ */
12
+public interface ICallIvrWordService 
13
+{
14
+    /**
15
+     * 查询ivr文字文件
16
+     * 
17
+     * @param wordId ivr文字文件主键
18
+     * @return ivr文字文件
19
+     */
20
+    public CallIvrWord selectCallIvrWordByWordId(Long wordId);
21
+
22
+    /**
23
+     * 查询ivr文字文件列表
24
+     * 
25
+     * @param callIvrWord ivr文字文件
26
+     * @return ivr文字文件集合
27
+     */
28
+    public List<CallIvrWord> selectCallIvrWordList(CallIvrWord callIvrWord);
29
+
30
+    /**
31
+     * 新增ivr文字文件
32
+     * 
33
+     * @param callIvrWord ivr文字文件
34
+     * @return 结果
35
+     */
36
+    public int insertCallIvrWord(CallIvrWord callIvrWord);
37
+
38
+    /**
39
+     * 修改ivr文字文件
40
+     * 
41
+     * @param callIvrWord ivr文字文件
42
+     * @return 结果
43
+     */
44
+    public int updateCallIvrWord(CallIvrWord callIvrWord);
45
+
46
+    /**
47
+     * 批量删除ivr文字文件
48
+     * 
49
+     * @param wordIds 需要删除的ivr文字文件主键集合
50
+     * @return 结果
51
+     */
52
+    public int deleteCallIvrWordByWordIds(Long[] wordIds);
53
+
54
+    /**
55
+     * 删除ivr文字文件信息
56
+     * 
57
+     * @param wordId ivr文字文件主键
58
+     * @return 结果
59
+     */
60
+    public int deleteCallIvrWordByWordId(Long wordId);
61
+}

+ 96 - 0
jiayi-call/src/main/java/com/jiayi/call/service/impl/CallIvrWordServiceImpl.java

@@ -0,0 +1,96 @@
1
+package com.jiayi.call.service.impl;
2
+
3
+import java.util.List;
4
+import com.jiayi.common.utils.DateUtils;
5
+import org.springframework.beans.factory.annotation.Autowired;
6
+import org.springframework.stereotype.Service;
7
+import com.jiayi.call.mapper.CallIvrWordMapper;
8
+import com.jiayi.call.domain.CallIvrWord;
9
+import com.jiayi.call.service.ICallIvrWordService;
10
+
11
+/**
12
+ * ivr文字文件Service业务层处理
13
+ * 
14
+ * @author jiayi
15
+ * @date 2023-04-26
16
+ */
17
+@Service
18
+public class CallIvrWordServiceImpl implements ICallIvrWordService 
19
+{
20
+    @Autowired
21
+    private CallIvrWordMapper callIvrWordMapper;
22
+
23
+    /**
24
+     * 查询ivr文字文件
25
+     * 
26
+     * @param wordId ivr文字文件主键
27
+     * @return ivr文字文件
28
+     */
29
+    @Override
30
+    public CallIvrWord selectCallIvrWordByWordId(Long wordId)
31
+    {
32
+        return callIvrWordMapper.selectCallIvrWordByWordId(wordId);
33
+    }
34
+
35
+    /**
36
+     * 查询ivr文字文件列表
37
+     * 
38
+     * @param callIvrWord ivr文字文件
39
+     * @return ivr文字文件
40
+     */
41
+    @Override
42
+    public List<CallIvrWord> selectCallIvrWordList(CallIvrWord callIvrWord)
43
+    {
44
+        return callIvrWordMapper.selectCallIvrWordList(callIvrWord);
45
+    }
46
+
47
+    /**
48
+     * 新增ivr文字文件
49
+     * 
50
+     * @param callIvrWord ivr文字文件
51
+     * @return 结果
52
+     */
53
+    @Override
54
+    public int insertCallIvrWord(CallIvrWord callIvrWord)
55
+    {
56
+        callIvrWord.setCreateTime(DateUtils.getNowDate());
57
+        return callIvrWordMapper.insertCallIvrWord(callIvrWord);
58
+    }
59
+
60
+    /**
61
+     * 修改ivr文字文件
62
+     * 
63
+     * @param callIvrWord ivr文字文件
64
+     * @return 结果
65
+     */
66
+    @Override
67
+    public int updateCallIvrWord(CallIvrWord callIvrWord)
68
+    {
69
+        callIvrWord.setUpdateTime(DateUtils.getNowDate());
70
+        return callIvrWordMapper.updateCallIvrWord(callIvrWord);
71
+    }
72
+
73
+    /**
74
+     * 批量删除ivr文字文件
75
+     * 
76
+     * @param wordIds 需要删除的ivr文字文件主键
77
+     * @return 结果
78
+     */
79
+    @Override
80
+    public int deleteCallIvrWordByWordIds(Long[] wordIds)
81
+    {
82
+        return callIvrWordMapper.deleteCallIvrWordByWordIds(wordIds);
83
+    }
84
+
85
+    /**
86
+     * 删除ivr文字文件信息
87
+     * 
88
+     * @param wordId ivr文字文件主键
89
+     * @return 结果
90
+     */
91
+    @Override
92
+    public int deleteCallIvrWordByWordId(Long wordId)
93
+    {
94
+        return callIvrWordMapper.deleteCallIvrWordByWordId(wordId);
95
+    }
96
+}

+ 115 - 0
jiayi-call/src/main/resources/mapper/call/CallIvrWordMapper.xml

@@ -0,0 +1,115 @@
1
+<?xml version="1.0" encoding="UTF-8" ?>
2
+<!DOCTYPE mapper
3
+PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN"
4
+"http://mybatis.org/dtd/mybatis-3-mapper.dtd">
5
+<mapper namespace="com.jiayi.call.mapper.CallIvrWordMapper">
6
+    
7
+    <resultMap type="CallIvrWord" id="CallIvrWordResult">
8
+        <result property="wordId"    column="word_id"    />
9
+        <result property="title"    column="title"    />
10
+        <result property="content"    column="content"    />
11
+        <result property="filePath"    column="file_path"    />
12
+        <result property="type"    column="type"    />
13
+        <result property="startTime"    column="start_time"    />
14
+        <result property="endTime"    column="end_time"    />
15
+        <result property="remark"    column="remark"    />
16
+        <result property="delFlag"    column="del_flag"    />
17
+        <result property="createBy"    column="create_by"    />
18
+        <result property="createTime"    column="create_time"    />
19
+        <result property="updateBy"    column="update_by"    />
20
+        <result property="updateTime"    column="update_time"    />
21
+        <result property="delBy"    column="del_by"    />
22
+        <result property="delTime"    column="del_time"    />
23
+    </resultMap>
24
+
25
+    <sql id="selectCallIvrWordVo">
26
+        select word_id, title, content, file_path, type, start_time, end_time, remark, del_flag, create_by, create_time, update_by, update_time, del_by, del_time from call_ivr_word
27
+    </sql>
28
+
29
+    <select id="selectCallIvrWordList" parameterType="CallIvrWord" resultMap="CallIvrWordResult">
30
+        <include refid="selectCallIvrWordVo"/>
31
+        <where>  
32
+            <if test="title != null  and title != ''"> and title = #{title}</if>
33
+            <if test="content != null  and content != ''"> and content = #{content}</if>
34
+            <if test="filePath != null  and filePath != ''"> and file_path = #{filePath}</if>
35
+            <if test="type != null "> and type = #{type}</if>
36
+            <if test="startTime != null "> and start_time = #{startTime}</if>
37
+            <if test="endTime != null "> and end_time = #{endTime}</if>
38
+            <if test="delBy != null  and delBy != ''"> and del_by = #{delBy}</if>
39
+            <if test="delTime != null "> and del_time = #{delTime}</if>
40
+        </where>
41
+    </select>
42
+    
43
+    <select id="selectCallIvrWordByWordId" parameterType="Long" resultMap="CallIvrWordResult">
44
+        <include refid="selectCallIvrWordVo"/>
45
+        where word_id = #{wordId}
46
+    </select>
47
+        
48
+    <insert id="insertCallIvrWord" parameterType="CallIvrWord" useGeneratedKeys="true" keyProperty="wordId">
49
+        insert into call_ivr_word
50
+        <trim prefix="(" suffix=")" suffixOverrides=",">
51
+            <if test="title != null">title,</if>
52
+            <if test="content != null">content,</if>
53
+            <if test="filePath != null">file_path,</if>
54
+            <if test="type != null">type,</if>
55
+            <if test="startTime != null">start_time,</if>
56
+            <if test="endTime != null">end_time,</if>
57
+            <if test="remark != null">remark,</if>
58
+            <if test="delFlag != null">del_flag,</if>
59
+            <if test="createBy != null">create_by,</if>
60
+            <if test="createTime != null">create_time,</if>
61
+            <if test="updateBy != null">update_by,</if>
62
+            <if test="updateTime != null">update_time,</if>
63
+            <if test="delBy != null">del_by,</if>
64
+            <if test="delTime != null">del_time,</if>
65
+         </trim>
66
+        <trim prefix="values (" suffix=")" suffixOverrides=",">
67
+            <if test="title != null">#{title},</if>
68
+            <if test="content != null">#{content},</if>
69
+            <if test="filePath != null">#{filePath},</if>
70
+            <if test="type != null">#{type},</if>
71
+            <if test="startTime != null">#{startTime},</if>
72
+            <if test="endTime != null">#{endTime},</if>
73
+            <if test="remark != null">#{remark},</if>
74
+            <if test="delFlag != null">#{delFlag},</if>
75
+            <if test="createBy != null">#{createBy},</if>
76
+            <if test="createTime != null">#{createTime},</if>
77
+            <if test="updateBy != null">#{updateBy},</if>
78
+            <if test="updateTime != null">#{updateTime},</if>
79
+            <if test="delBy != null">#{delBy},</if>
80
+            <if test="delTime != null">#{delTime},</if>
81
+         </trim>
82
+    </insert>
83
+
84
+    <update id="updateCallIvrWord" parameterType="CallIvrWord">
85
+        update call_ivr_word
86
+        <trim prefix="SET" suffixOverrides=",">
87
+            <if test="title != null">title = #{title},</if>
88
+            <if test="content != null">content = #{content},</if>
89
+            <if test="filePath != null">file_path = #{filePath},</if>
90
+            <if test="type != null">type = #{type},</if>
91
+            <if test="startTime != null">start_time = #{startTime},</if>
92
+            <if test="endTime != null">end_time = #{endTime},</if>
93
+            <if test="remark != null">remark = #{remark},</if>
94
+            <if test="delFlag != null">del_flag = #{delFlag},</if>
95
+            <if test="createBy != null">create_by = #{createBy},</if>
96
+            <if test="createTime != null">create_time = #{createTime},</if>
97
+            <if test="updateBy != null">update_by = #{updateBy},</if>
98
+            <if test="updateTime != null">update_time = #{updateTime},</if>
99
+            <if test="delBy != null">del_by = #{delBy},</if>
100
+            <if test="delTime != null">del_time = #{delTime},</if>
101
+        </trim>
102
+        where word_id = #{wordId}
103
+    </update>
104
+
105
+    <delete id="deleteCallIvrWordByWordId" parameterType="Long">
106
+        delete from call_ivr_word where word_id = #{wordId}
107
+    </delete>
108
+
109
+    <delete id="deleteCallIvrWordByWordIds" parameterType="String">
110
+        delete from call_ivr_word where word_id in 
111
+        <foreach item="wordId" collection="array" open="(" separator="," close=")">
112
+            #{wordId}
113
+        </foreach>
114
+    </delete>
115
+</mapper>