增加客服模块

This commit is contained in:
kuang.yife 2024-03-20 14:50:41 +08:00
parent 6d7ec25905
commit 0b7b690e8e
12 changed files with 764 additions and 0 deletions

View File

@ -0,0 +1,36 @@
package com.playlet.web.controller.app;
import com.playlet.common.core.domain.Result;
import com.playlet.system.domain.PlayletCustomerService;
import com.playlet.web.service.app.PlayletCustomerServiceAppService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import java.util.List;
@Slf4j
@Api(tags = "小程序*客服接口")
@RestController
@RequestMapping(value = "/app/customer")
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class PlayletCustomerServiceAppController {
private final PlayletCustomerServiceAppService playletCustomerServiceAppService;
/**
* 查询客服基础列表
*/
@ResponseBody
@PostMapping("/getCustomerList")
@ApiOperation(value = "查询客服列表")
public Result<List<PlayletCustomerService>> getCustomerList(@RequestBody PlayletCustomerService customerService) {
return Result.success(playletCustomerServiceAppService.getCustomerList(customerService));
}
}

View File

@ -0,0 +1,127 @@
package com.playlet.web.controller.system;
import java.util.List;
import org.apache.shiro.authz.annotation.RequiresPermissions;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.ModelMap;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import com.playlet.common.annotation.Log;
import com.playlet.common.enums.BusinessType;
import com.playlet.system.domain.PlayletCustomerService;
import com.playlet.system.service.IPlayletCustomerServiceService;
import com.playlet.common.core.controller.BaseController;
import com.playlet.common.core.domain.AjaxResult;
import com.playlet.common.utils.poi.ExcelUtil;
import com.playlet.common.core.page.TableDataInfo;
/**
* 短剧客服管理Controller
*
* @author ruoyi
* @date 2024-03-20
*/
@Controller
@RequestMapping("/system/playlet/service")
public class PlayletCustomerServiceController extends BaseController
{
private String prefix = "system/playlet/service";
@Autowired
private IPlayletCustomerServiceService playletCustomerServiceService;
@RequiresPermissions("playlet:service:view")
@GetMapping()
public String service()
{
return prefix + "/service";
}
/**
* 查询短剧客服管理列表
*/
@RequiresPermissions("playlet:service:list")
@PostMapping("/list")
@ResponseBody
public TableDataInfo list(PlayletCustomerService playletCustomerService)
{
startPage();
List<PlayletCustomerService> list = playletCustomerServiceService.selectPlayletCustomerServiceList(playletCustomerService);
return getDataTable(list);
}
/**
* 导出短剧客服管理列表
*/
@RequiresPermissions("playlet:service:export")
@Log(title = "短剧客服管理", businessType = BusinessType.EXPORT)
@PostMapping("/export")
@ResponseBody
public AjaxResult export(PlayletCustomerService playletCustomerService)
{
List<PlayletCustomerService> list = playletCustomerServiceService.selectPlayletCustomerServiceList(playletCustomerService);
ExcelUtil<PlayletCustomerService> util = new ExcelUtil<PlayletCustomerService>(PlayletCustomerService.class);
return util.exportExcel(list, "短剧客服管理数据");
}
/**
* 新增短剧客服管理
*/
@GetMapping("/add")
public String add()
{
return prefix + "/add";
}
/**
* 新增保存短剧客服管理
*/
@RequiresPermissions("playlet:service:add")
@Log(title = "短剧客服管理", businessType = BusinessType.INSERT)
@PostMapping("/add")
@ResponseBody
public AjaxResult addSave(PlayletCustomerService playletCustomerService)
{
return toAjax(playletCustomerServiceService.insertPlayletCustomerService(playletCustomerService));
}
/**
* 修改短剧客服管理
*/
@RequiresPermissions("playlet:service:edit")
@GetMapping("/edit/{id}")
public String edit(@PathVariable("id") Long id, ModelMap mmap)
{
PlayletCustomerService playletCustomerService = playletCustomerServiceService.selectPlayletCustomerServiceById(id);
mmap.put("playletCustomerService", playletCustomerService);
return prefix + "/edit";
}
/**
* 修改保存短剧客服管理
*/
@RequiresPermissions("playlet:service:edit")
@Log(title = "短剧客服管理", businessType = BusinessType.UPDATE)
@PostMapping("/edit")
@ResponseBody
public AjaxResult editSave(PlayletCustomerService playletCustomerService)
{
return toAjax(playletCustomerServiceService.updatePlayletCustomerService(playletCustomerService));
}
/**
* 删除短剧客服管理
*/
@RequiresPermissions("playlet:service:remove")
@Log(title = "短剧客服管理", businessType = BusinessType.DELETE)
@PostMapping( "/remove")
@ResponseBody
public AjaxResult remove(String ids)
{
return toAjax(playletCustomerServiceService.deletePlayletCustomerServiceByIds(ids));
}
}

View File

@ -0,0 +1,11 @@
package com.playlet.web.service.app;
import com.playlet.system.domain.PlayletCustomerService;
import java.util.List;
public interface PlayletCustomerServiceAppService {
List<PlayletCustomerService> getCustomerList(PlayletCustomerService customerService);
}

View File

@ -0,0 +1,29 @@
package com.playlet.web.service.app.impl;
import com.playlet.system.domain.PlayletCustomerService;
import com.playlet.system.service.IPlayletCustomerServiceService;
import com.playlet.web.service.app.PlayletCustomerServiceAppService;
import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import java.util.List;
/**
* @author clunt
*/
@Slf4j
@Service
@RequiredArgsConstructor(onConstructor = @__(@Autowired))
public class PlayletCustomerServiceAppServiceImpl implements PlayletCustomerServiceAppService {
private final IPlayletCustomerServiceService iPlayletCustomerServiceService;
@Override
public List<PlayletCustomerService> getCustomerList(PlayletCustomerService customerService) {
return iPlayletCustomerServiceService.selectPlayletCustomerServiceList(customerService);
}
}

View File

@ -0,0 +1,43 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('新增短剧客服管理')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-service-add">
<div class="form-group">
<label class="col-sm-3 control-label">客服名称:</label>
<div class="col-sm-8">
<input name="name" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">添加图片地址:</label>
<div class="col-sm-8">
<input name="url" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<input name="remark" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "system/playlet/service"
$("#form-service-add").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/add", $('#form-service-add').serialize());
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,44 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
<th:block th:include="include :: header('修改短剧客服管理')" />
</head>
<body class="white-bg">
<div class="wrapper wrapper-content animated fadeInRight ibox-content">
<form class="form-horizontal m" id="form-service-edit" th:object="${playletCustomerService}">
<input name="id" th:field="*{id}" type="hidden">
<div class="form-group">
<label class="col-sm-3 control-label">客服名称:</label>
<div class="col-sm-8">
<input name="name" th:field="*{name}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">添加图片地址:</label>
<div class="col-sm-8">
<input name="url" th:field="*{url}" class="form-control" type="text">
</div>
</div>
<div class="form-group">
<label class="col-sm-3 control-label">备注:</label>
<div class="col-sm-8">
<input name="remark" th:field="*{remark}" class="form-control" type="text">
</div>
</div>
</form>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var prefix = ctx + "system/playlet/service";
$("#form-service-edit").validate({
focusCleanup: true
});
function submitHandler() {
if ($.validate.form()) {
$.operate.save(prefix + "/edit", $('#form-service-edit').serialize());
}
}
</script>
</body>
</html>

View File

@ -0,0 +1,114 @@
<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:shiro="http://www.pollix.at/thymeleaf/shiro">
<head>
<th:block th:include="include :: header('短剧客服管理列表')" />
</head>
<body class="gray-bg">
<div class="container-div">
<div class="row">
<div class="col-sm-12 search-collapse">
<form id="formId">
<div class="select-list">
<ul>
<li>
<label>客服名称:</label>
<input type="text" name="name"/>
</li>
<li>
<a class="btn btn-primary btn-rounded btn-sm" onclick="$.table.search()"><i class="fa fa-search"></i>&nbsp;搜索</a>
<a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i>&nbsp;重置</a>
</li>
</ul>
</div>
</form>
</div>
<div class="btn-group-sm" id="toolbar" role="group">
<a class="btn btn-success" onclick="$.operate.add()" shiro:hasPermission="playlet:service:add">
<i class="fa fa-plus"></i> 添加
</a>
<a class="btn btn-primary single disabled" onclick="$.operate.edit()" shiro:hasPermission="playlet:service:edit">
<i class="fa fa-edit"></i> 修改
</a>
<a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" shiro:hasPermission="playlet:service:remove">
<i class="fa fa-remove"></i> 删除
</a>
<a class="btn btn-warning" onclick="$.table.exportExcel()" shiro:hasPermission="playlet:service:export">
<i class="fa fa-download"></i> 导出
</a>
</div>
<div class="col-sm-12 select-table table-striped">
<table id="bootstrap-table"></table>
</div>
</div>
</div>
<th:block th:include="include :: footer" />
<script th:inline="javascript">
var editFlag = [[${@permission.hasPermi('playlet:service:edit')}]];
var removeFlag = [[${@permission.hasPermi('playlet:service:remove')}]];
var prefix = ctx + "system/playlet/service";
$(function() {
var options = {
url: prefix + "/list",
createUrl: prefix + "/add",
updateUrl: prefix + "/edit/{id}",
removeUrl: prefix + "/remove",
exportUrl: prefix + "/export",
modalName: "短剧客服管理",
columns: [{
checkbox: true
},
{
field: 'id',
title: '主键',
visible: false
},
{
field: 'name',
title: '客服名称'
},
{
field: 'url',
title: '添加图片地址'
},
{
field: 'status',
title: '启用状态'
},
{
field: 'createBy',
title: '创建人'
},
{
field: 'createTime',
title: '创建时间'
},
{
field: 'updateBy',
title: '更新人'
},
{
field: 'updateTime',
title: '更新时间'
},
{
field: 'remark',
title: '备注'
},
{
title: '操作',
align: 'center',
formatter: function(value, row, index) {
var actions = [];
actions.push('<a class="btn btn-success btn-xs ' + editFlag + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.id + '\')"><i class="fa fa-edit"></i>编辑</a> ');
actions.push('<a class="btn btn-danger btn-xs ' + removeFlag + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>');
return actions.join('');
}
}]
};
$.table.init(options);
});
</script>
</body>
</html>

View File

@ -0,0 +1,46 @@
package com.playlet.system.domain;
import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.playlet.common.core.domain.BaseEntity;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.EqualsAndHashCode;
import com.playlet.common.annotation.Excel;
/**
* 短剧客服管理对象 playlet_customer_service
*
* @author ruoyi
* @date 2024-03-20
*/
@Data
@EqualsAndHashCode(callSuper = false)
@TableName(value = "playlet_customer_service")
@ApiModel(value = "短剧客服管理对象")
public class PlayletCustomerService extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** 主键 */
@TableId(value = "id", type = IdType.AUTO)
private Long id;
/** 客服名称 */
@Excel(name = "客服名称")
@ApiModelProperty(value = "客服名称")
private String name;
/** 添加图片地址 */
@Excel(name = "添加图片地址")
@ApiModelProperty(value = "添加图片地址")
private String url;
/** 启用状态 */
@Excel(name = "启用状态")
@ApiModelProperty(value = "启用状态")
private String status;
}

View File

@ -0,0 +1,62 @@
package com.playlet.system.mapper;
import java.util.List;
import com.playlet.system.domain.PlayletCustomerService;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
/**
* 短剧客服管理Mapper接口
*
* @author ruoyi
* @date 2024-03-20
*/
public interface PlayletCustomerServiceMapper extends BaseMapper<PlayletCustomerService>
{
/**
* 查询短剧客服管理
*
* @param id 短剧客服管理主键
* @return 短剧客服管理
*/
public PlayletCustomerService selectPlayletCustomerServiceById(Long id);
/**
* 查询短剧客服管理列表
*
* @param playletCustomerService 短剧客服管理
* @return 短剧客服管理集合
*/
public List<PlayletCustomerService> selectPlayletCustomerServiceList(PlayletCustomerService playletCustomerService);
/**
* 新增短剧客服管理
*
* @param playletCustomerService 短剧客服管理
* @return 结果
*/
public int insertPlayletCustomerService(PlayletCustomerService playletCustomerService);
/**
* 修改短剧客服管理
*
* @param playletCustomerService 短剧客服管理
* @return 结果
*/
public int updatePlayletCustomerService(PlayletCustomerService playletCustomerService);
/**
* 删除短剧客服管理
*
* @param id 短剧客服管理主键
* @return 结果
*/
public int deletePlayletCustomerServiceById(Long id);
/**
* 批量删除短剧客服管理
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
public int deletePlayletCustomerServiceByIds(String[] ids);
}

View File

@ -0,0 +1,62 @@
package com.playlet.system.service;
import java.util.List;
import com.playlet.system.domain.PlayletCustomerService;
import com.baomidou.mybatisplus.extension.service.IService;
/**
* 短剧客服管理Service接口
*
* @author ruoyi
* @date 2024-03-20
*/
public interface IPlayletCustomerServiceService extends IService<PlayletCustomerService>
{
/**
* 查询短剧客服管理
*
* @param id 短剧客服管理主键
* @return 短剧客服管理
*/
public PlayletCustomerService selectPlayletCustomerServiceById(Long id);
/**
* 查询短剧客服管理列表
*
* @param playletCustomerService 短剧客服管理
* @return 短剧客服管理集合
*/
public List<PlayletCustomerService> selectPlayletCustomerServiceList(PlayletCustomerService playletCustomerService);
/**
* 新增短剧客服管理
*
* @param playletCustomerService 短剧客服管理
* @return 结果
*/
public int insertPlayletCustomerService(PlayletCustomerService playletCustomerService);
/**
* 修改短剧客服管理
*
* @param playletCustomerService 短剧客服管理
* @return 结果
*/
public int updatePlayletCustomerService(PlayletCustomerService playletCustomerService);
/**
* 批量删除短剧客服管理
*
* @param ids 需要删除的短剧客服管理主键集合
* @return 结果
*/
public int deletePlayletCustomerServiceByIds(String ids);
/**
* 删除短剧客服管理信息
*
* @param id 短剧客服管理主键
* @return 结果
*/
public int deletePlayletCustomerServiceById(Long id);
}

View File

@ -0,0 +1,98 @@
package com.playlet.system.service.impl;
import java.util.List;
import com.playlet.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.playlet.system.mapper.PlayletCustomerServiceMapper;
import com.playlet.system.domain.PlayletCustomerService;
import com.playlet.system.service.IPlayletCustomerServiceService;
import com.playlet.common.core.text.Convert;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
/**
* 短剧客服管理Service业务层处理
*
* @author ruoyi
* @date 2024-03-20
*/
@Service
public class PlayletCustomerServiceServiceImpl extends ServiceImpl<PlayletCustomerServiceMapper, PlayletCustomerService> implements IPlayletCustomerServiceService
{
@Autowired
private PlayletCustomerServiceMapper playletCustomerServiceMapper;
/**
* 查询短剧客服管理
*
* @param id 短剧客服管理主键
* @return 短剧客服管理
*/
@Override
public PlayletCustomerService selectPlayletCustomerServiceById(Long id)
{
return playletCustomerServiceMapper.selectPlayletCustomerServiceById(id);
}
/**
* 查询短剧客服管理列表
*
* @param playletCustomerService 短剧客服管理
* @return 短剧客服管理
*/
@Override
public List<PlayletCustomerService> selectPlayletCustomerServiceList(PlayletCustomerService playletCustomerService)
{
return playletCustomerServiceMapper.selectPlayletCustomerServiceList(playletCustomerService);
}
/**
* 新增短剧客服管理
*
* @param playletCustomerService 短剧客服管理
* @return 结果
*/
@Override
public int insertPlayletCustomerService(PlayletCustomerService playletCustomerService)
{
playletCustomerService.setCreateTime(DateUtils.getNowDate());
return playletCustomerServiceMapper.insertPlayletCustomerService(playletCustomerService);
}
/**
* 修改短剧客服管理
*
* @param playletCustomerService 短剧客服管理
* @return 结果
*/
@Override
public int updatePlayletCustomerService(PlayletCustomerService playletCustomerService)
{
playletCustomerService.setUpdateTime(DateUtils.getNowDate());
return playletCustomerServiceMapper.updatePlayletCustomerService(playletCustomerService);
}
/**
* 批量删除短剧客服管理
*
* @param ids 需要删除的短剧客服管理主键
* @return 结果
*/
@Override
public int deletePlayletCustomerServiceByIds(String ids)
{
return playletCustomerServiceMapper.deletePlayletCustomerServiceByIds(Convert.toStrArray(ids));
}
/**
* 删除短剧客服管理信息
*
* @param id 短剧客服管理主键
* @return 结果
*/
@Override
public int deletePlayletCustomerServiceById(Long id)
{
return playletCustomerServiceMapper.deletePlayletCustomerServiceById(id);
}
}

View File

@ -0,0 +1,92 @@
<?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.playlet.system.mapper.PlayletCustomerServiceMapper">
<resultMap type="PlayletCustomerService" id="PlayletCustomerServiceResult">
<result property="id" column="ID" />
<result property="name" column="name" />
<result property="url" column="url" />
<result property="status" column="status" />
<result property="createBy" column="CREATE_BY" />
<result property="createTime" column="CREATE_TIME" />
<result property="updateBy" column="UPDATE_BY" />
<result property="updateTime" column="UPDATE_TIME" />
<result property="remark" column="REMARK" />
</resultMap>
<sql id="selectPlayletCustomerServiceVo">
select ID, name, url, status, CREATE_BY, CREATE_TIME, UPDATE_BY, UPDATE_TIME, REMARK from playlet_customer_service
</sql>
<select id="selectPlayletCustomerServiceList" parameterType="PlayletCustomerService" resultMap="PlayletCustomerServiceResult">
<include refid="selectPlayletCustomerServiceVo"/>
<where>
<if test="name != null and name != ''"> and name like concat('%', #{name}, '%')</if>
<if test="url != null and url != ''"> and url = #{url}</if>
<if test="status != null and status != ''"> and status = #{status}</if>
<if test="createBy != null and createBy != ''"> and CREATE_BY = #{createBy}</if>
<if test="createTime != null "> and CREATE_TIME = #{createTime}</if>
<if test="updateBy != null and updateBy != ''"> and UPDATE_BY = #{updateBy}</if>
<if test="updateTime != null "> and UPDATE_TIME = #{updateTime}</if>
<if test="remark != null and remark != ''"> and REMARK = #{remark}</if>
</where>
</select>
<select id="selectPlayletCustomerServiceById" parameterType="Long" resultMap="PlayletCustomerServiceResult">
<include refid="selectPlayletCustomerServiceVo"/>
where ID = #{id}
</select>
<insert id="insertPlayletCustomerService" parameterType="PlayletCustomerService" useGeneratedKeys="true" keyProperty="id">
insert into playlet_customer_service
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="name != null">name,</if>
<if test="url != null">url,</if>
<if test="status != null">status,</if>
<if test="createBy != null">CREATE_BY,</if>
<if test="createTime != null">CREATE_TIME,</if>
<if test="updateBy != null">UPDATE_BY,</if>
<if test="updateTime != null">UPDATE_TIME,</if>
<if test="REMARK != null">REMARK,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="name != null">#{name},</if>
<if test="url != null">#{url},</if>
<if test="status != null">#{status},</if>
<if test="createBy != null">#{createBy},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateBy != null">#{updateBy},</if>
<if test="updateTime != null">#{updateTime},</if>
<if test="REMARK != null">#{remark},</if>
</trim>
</insert>
<update id="updatePlayletCustomerService" parameterType="PlayletCustomerService">
update playlet_customer_service
<trim prefix="SET" suffixOverrides=",">
<if test="name != null">name = #{name},</if>
<if test="url != null">url = #{url},</if>
<if test="status != null">status = #{status},</if>
<if test="createBy != null">CREATE_BY = #{createBy},</if>
<if test="createTime != null">CREATE_TIME = #{createTime},</if>
<if test="updateBy != null">UPDATE_BY = #{updateBy},</if>
<if test="updateTime != null">UPDATE_TIME = #{updateTime},</if>
<if test="remark != null">REMARK = #{remark},</if>
</trim>
where ID = #{id}
</update>
<delete id="deletePlayletCustomerServiceById" parameterType="Long">
delete from playlet_customer_service where ID = #{id}
</delete>
<delete id="deletePlayletCustomerServiceByIds" parameterType="String">
delete from playlet_customer_service where ID in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>