Browse Source

音广播预发布内容

develop
王兴琳 7 months ago
parent
commit
a6f1884c18
  1. 138
      zc-business/src/main/java/com/zc/business/controller/DcVoiceBroadcastController.java
  2. 72
      zc-business/src/main/java/com/zc/business/domain/DcVoiceBroadcast.java
  3. 64
      zc-business/src/main/java/com/zc/business/mapper/DcVoiceBroadcastMapper.java
  4. 64
      zc-business/src/main/java/com/zc/business/service/IDcVoiceBroadcastService.java
  5. 102
      zc-business/src/main/java/com/zc/business/service/impl/DcVoiceBroadcastServiceImpl.java
  6. 78
      zc-business/src/main/resources/mapper/business/DcVoiceBroadcastMapper.xml

138
zc-business/src/main/java/com/zc/business/controller/DcVoiceBroadcastController.java

@ -0,0 +1,138 @@
package com.zc.business.controller;
import java.util.List;
import javax.servlet.http.HttpServletResponse;
import com.zc.business.domain.DcVoiceBroadcast;
import com.zc.business.service.IDcVoiceBroadcastService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.security.access.prepost.PreAuthorize;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.DeleteMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.ruoyi.common.annotation.Log;
import com.ruoyi.common.core.controller.BaseController;
import com.ruoyi.common.core.domain.AjaxResult;
import com.ruoyi.common.enums.BusinessType;
import com.ruoyi.common.utils.poi.ExcelUtil;
import com.ruoyi.common.core.page.TableDataInfo;
/**
* 语音广播预发布Controller
*
* @author ruoyi
* @date 2024-04-19
*/
@RestController
@RequestMapping("/system/broadcast")
@Api(tags = "语音广播预发布")
public class DcVoiceBroadcastController extends BaseController
{
@Autowired
private IDcVoiceBroadcastService dcVoiceBroadcastService;
/**
* 查询语音广播预发布列表
*/
@ApiOperation("查询语音广播预发布列表")
@PreAuthorize("@ss.hasPermi('system:broadcast:list')")
@GetMapping("/list")
public TableDataInfo list(DcVoiceBroadcast dcVoiceBroadcast)
{
startPage();
List<DcVoiceBroadcast> list = dcVoiceBroadcastService.selectDcVoiceBroadcastList(dcVoiceBroadcast);
return getDataTable(list);
}
/**
* 查询语音广播预发布列表
*/
@ApiOperation("无分页查询语音广播预发布列表")
@PreAuthorize("@ss.hasPermi('system:broadcast:listAll')")
@GetMapping("/listAll")
public TableDataInfo listAll(DcVoiceBroadcast dcVoiceBroadcast)
{
List<DcVoiceBroadcast> list = dcVoiceBroadcastService.selectDcVoiceBroadcastList(dcVoiceBroadcast);
return getDataTable(list);
}
/**
* 根据模版类型查询查询语音广播预发布列表
*/
@ApiOperation("根据模版类型查询查询语音广播预发布列表")
@PreAuthorize("@ss.hasPermi('system:broadcast:listId')")
@GetMapping("/listAll/{category}")
public TableDataInfo listByCategory(@PathVariable("category") String category)
{
List<DcVoiceBroadcast> list = dcVoiceBroadcastService.selectDcVoiceBroadcastListByCategory(category);
return getDataTable(list);
}
/**
* 导出语音广播预发布列表
*/
@ApiOperation("导出语音广播预发布列表")
@PreAuthorize("@ss.hasPermi('system:broadcast:export')")
@Log(title = "语音广播预发布", businessType = BusinessType.EXPORT)
@PostMapping("/export")
public void export(HttpServletResponse response, DcVoiceBroadcast dcVoiceBroadcast)
{
List<DcVoiceBroadcast> list = dcVoiceBroadcastService.selectDcVoiceBroadcastList(dcVoiceBroadcast);
ExcelUtil<DcVoiceBroadcast> util = new ExcelUtil<>(DcVoiceBroadcast.class);
util.exportExcel(response, list, "语音广播预发布数据");
}
/**
* 获取语音广播预发布详细信息
*/
@ApiOperation("根据id获取语音广播预发布详细信息")
@PreAuthorize("@ss.hasPermi('system:broadcast:query')")
@GetMapping(value = "/{id}")
public AjaxResult getInfo(@PathVariable("id") Long id)
{
return AjaxResult.success(dcVoiceBroadcastService.selectDcVoiceBroadcastById(id));
}
/**
* 新增语音广播预发布
*/
@ApiOperation("新增语音广播预发布")
@PreAuthorize("@ss.hasPermi('system:broadcast:add')")
@Log(title = "语音广播预发布", businessType = BusinessType.INSERT)
@PostMapping
public AjaxResult add(@RequestBody DcVoiceBroadcast dcVoiceBroadcast)
{
return toAjax(dcVoiceBroadcastService.insertDcVoiceBroadcast(dcVoiceBroadcast));
}
/**
* 修改语音广播预发布
*/
@ApiOperation("修改语音广播预发布")
@PreAuthorize("@ss.hasPermi('system:broadcast:edit')")
@Log(title = "语音广播预发布", businessType = BusinessType.UPDATE)
@PutMapping
public AjaxResult edit(@RequestBody DcVoiceBroadcast dcVoiceBroadcast)
{
return toAjax(dcVoiceBroadcastService.updateDcVoiceBroadcast(dcVoiceBroadcast));
}
/**
* 删除语音广播预发布
*/
@ApiOperation("删除语音广播预发布")
@PreAuthorize("@ss.hasPermi('system:broadcast:remove')")
@Log(title = "语音广播预发布", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}")
public AjaxResult remove(@PathVariable Long[] ids)
{
return toAjax(dcVoiceBroadcastService.deleteDcVoiceBroadcastByIds(ids));
}
}

72
zc-business/src/main/java/com/zc/business/domain/DcVoiceBroadcast.java

@ -0,0 +1,72 @@
package com.zc.business.domain;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import org.apache.commons.lang3.builder.ToStringBuilder;
import org.apache.commons.lang3.builder.ToStringStyle;
import com.ruoyi.common.annotation.Excel;
import com.ruoyi.common.core.domain.BaseEntity;
/**
* 语音广播预发布对象 dc_voice_broadcast
*
* @author ruoyi
* @date 2024-04-19
*/
@ApiModel("语音广播预发布对象")
public class DcVoiceBroadcast extends BaseEntity
{
private static final long serialVersionUID = 1L;
/** id */
private Long id;
@ApiModelProperty("模板分组")
/** 模板分组 */
@Excel(name = "模板分组")
private String category;
/** 内容 */
@Excel(name = "内容")
private String content;
public void setId(Long id)
{
this.id = id;
}
public Long getId()
{
return id;
}
public void setCategory(String category)
{
this.category = category;
}
public String getCategory()
{
return category;
}
public void setContent(String content)
{
this.content = content;
}
public String getContent()
{
return content;
}
@Override
public String toString() {
return new ToStringBuilder(this,ToStringStyle.MULTI_LINE_STYLE)
.append("id", getId())
.append("category", getCategory())
.append("content", getContent())
.append("remark", getRemark())
.append("createTime", getCreateTime())
.append("updateTime", getUpdateTime())
.toString();
}
}

64
zc-business/src/main/java/com/zc/business/mapper/DcVoiceBroadcastMapper.java

@ -0,0 +1,64 @@
package com.zc.business.mapper;
import com.zc.business.domain.DcVoiceBroadcast;
import java.util.List;
/**
* 语音广播预发布Mapper接口
*
* @author ruoyi
* @date 2024-04-19
*/
public interface DcVoiceBroadcastMapper
{
/**
* 查询语音广播预发布
*
* @param id 语音广播预发布主键
* @return 语音广播预发布
*/
public DcVoiceBroadcast selectDcVoiceBroadcastById(Long id);
/**
* 查询语音广播预发布列表
*
* @param dcVoiceBroadcast 语音广播预发布
* @return 语音广播预发布集合
*/
List<DcVoiceBroadcast> selectDcVoiceBroadcastList(DcVoiceBroadcast dcVoiceBroadcast);
/**
* 新增语音广播预发布
*
* @param dcVoiceBroadcast 语音广播预发布
* @return 结果
*/
int insertDcVoiceBroadcast(DcVoiceBroadcast dcVoiceBroadcast);
/**
* 修改语音广播预发布
*
* @param dcVoiceBroadcast 语音广播预发布
* @return 结果
*/
int updateDcVoiceBroadcast(DcVoiceBroadcast dcVoiceBroadcast);
/**
* 删除语音广播预发布
*
* @param id 语音广播预发布主键
* @return 结果
*/
int deleteDcVoiceBroadcastById(Long id);
/**
* 批量删除语音广播预发布
*
* @param ids 需要删除的数据主键集合
* @return 结果
*/
int deleteDcVoiceBroadcastByIds(Long[] ids);
List<DcVoiceBroadcast> selectDcVoiceBroadcastListByCategory(String category);
}

64
zc-business/src/main/java/com/zc/business/service/IDcVoiceBroadcastService.java

@ -0,0 +1,64 @@
package com.zc.business.service;
import com.zc.business.domain.DcVoiceBroadcast;
import java.util.List;
/**
* 语音广播预发布Service接口
*
* @author ruoyi
* @date 2024-04-19
*/
public interface IDcVoiceBroadcastService
{
/**
* 查询语音广播预发布
*
* @param id 语音广播预发布主键
* @return 语音广播预发布
*/
public DcVoiceBroadcast selectDcVoiceBroadcastById(Long id);
/**
* 查询语音广播预发布列表
*
* @param dcVoiceBroadcast 语音广播预发布
* @return 语音广播预发布集合
*/
List<DcVoiceBroadcast> selectDcVoiceBroadcastList(DcVoiceBroadcast dcVoiceBroadcast);
/**
* 新增语音广播预发布
*
* @param dcVoiceBroadcast 语音广播预发布
* @return 结果
*/
int insertDcVoiceBroadcast(DcVoiceBroadcast dcVoiceBroadcast);
/**
* 修改语音广播预发布
*
* @param dcVoiceBroadcast 语音广播预发布
* @return 结果
*/
int updateDcVoiceBroadcast(DcVoiceBroadcast dcVoiceBroadcast);
/**
* 批量删除语音广播预发布
*
* @param ids 需要删除的语音广播预发布主键集合
* @return 结果
*/
int deleteDcVoiceBroadcastByIds(Long[] ids);
/**
* 删除语音广播预发布信息
*
* @param id 语音广播预发布主键
* @return 结果
*/
int deleteDcVoiceBroadcastById(Long id);
List<DcVoiceBroadcast> selectDcVoiceBroadcastListByCategory(String category);
}

102
zc-business/src/main/java/com/zc/business/service/impl/DcVoiceBroadcastServiceImpl.java

@ -0,0 +1,102 @@
package com.zc.business.service.impl;
import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.zc.business.domain.DcVoiceBroadcast;
import com.zc.business.mapper.DcVoiceBroadcastMapper;
import com.zc.business.service.IDcVoiceBroadcastService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
/**
* 语音广播预发布Service业务层处理
*
* @author ruoyi
* @date 2024-04-19
*/
@Service
public class DcVoiceBroadcastServiceImpl implements IDcVoiceBroadcastService
{
@Autowired
private DcVoiceBroadcastMapper dcVoiceBroadcastMapper;
/**
* 查询语音广播预发布
*
* @param id 语音广播预发布主键
* @return 语音广播预发布
*/
@Override
public DcVoiceBroadcast selectDcVoiceBroadcastById(Long id)
{
return dcVoiceBroadcastMapper.selectDcVoiceBroadcastById(id);
}
/**
* 查询语音广播预发布列表
*
* @param dcVoiceBroadcast 语音广播预发布
* @return 语音广播预发布
*/
@Override
public List<DcVoiceBroadcast> selectDcVoiceBroadcastList(DcVoiceBroadcast dcVoiceBroadcast)
{
return dcVoiceBroadcastMapper.selectDcVoiceBroadcastList(dcVoiceBroadcast);
}
/**
* 新增语音广播预发布
*
* @param dcVoiceBroadcast 语音广播预发布
* @return 结果
*/
@Override
public int insertDcVoiceBroadcast(DcVoiceBroadcast dcVoiceBroadcast)
{
dcVoiceBroadcast.setCreateTime(DateUtils.getNowDate());
return dcVoiceBroadcastMapper.insertDcVoiceBroadcast(dcVoiceBroadcast);
}
/**
* 修改语音广播预发布
*
* @param dcVoiceBroadcast 语音广播预发布
* @return 结果
*/
@Override
public int updateDcVoiceBroadcast(DcVoiceBroadcast dcVoiceBroadcast)
{
dcVoiceBroadcast.setUpdateTime(DateUtils.getNowDate());
return dcVoiceBroadcastMapper.updateDcVoiceBroadcast(dcVoiceBroadcast);
}
/**
* 批量删除语音广播预发布
*
* @param ids 需要删除的语音广播预发布主键
* @return 结果
*/
@Override
public int deleteDcVoiceBroadcastByIds(Long[] ids)
{
return dcVoiceBroadcastMapper.deleteDcVoiceBroadcastByIds(ids);
}
/**
* 删除语音广播预发布信息
*
* @param id 语音广播预发布主键
* @return 结果
*/
@Override
public int deleteDcVoiceBroadcastById(Long id)
{
return dcVoiceBroadcastMapper.deleteDcVoiceBroadcastById(id);
}
@Override
public List<DcVoiceBroadcast> selectDcVoiceBroadcastListByCategory(String category) {
return dcVoiceBroadcastMapper.selectDcVoiceBroadcastListByCategory(category);
}
}

78
zc-business/src/main/resources/mapper/business/DcVoiceBroadcastMapper.xml

@ -0,0 +1,78 @@
<?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.zc.business.mapper.DcVoiceBroadcastMapper">
<resultMap type="com.zc.business.domain.DcVoiceBroadcast" id="DcVoiceBroadcastResult">
<result property="id" column="id" />
<result property="category" column="category" />
<result property="content" column="content" />
<result property="remark" column="remark" />
<result property="createTime" column="create_time" />
<result property="updateTime" column="update_time" />
</resultMap>
<sql id="selectDcVoiceBroadcastVo">
select id, category, content, remark, create_time, update_time from dc_voice_broadcast
</sql>
<select id="selectDcVoiceBroadcastList" parameterType="com.zc.business.domain.DcVoiceBroadcast" resultMap="DcVoiceBroadcastResult">
<include refid="selectDcVoiceBroadcastVo"/>
<where>
<if test="category != null and category != ''"> and category = #{category}</if>
<if test="content != null and content != ''"> and content = #{content}</if>
</where>
</select>
<select id="selectDcVoiceBroadcastById" parameterType="Long" resultMap="DcVoiceBroadcastResult">
<include refid="selectDcVoiceBroadcastVo"/>
where id = #{id}
</select>
<select id="selectDcVoiceBroadcastListByCategory" parameterType="string" resultMap="DcVoiceBroadcastResult">
<include refid="selectDcVoiceBroadcastVo"/>
where category = #{category}
</select>
<insert id="insertDcVoiceBroadcast" parameterType="com.zc.business.domain.DcVoiceBroadcast" useGeneratedKeys="true" keyProperty="id">
insert into dc_voice_broadcast
<trim prefix="(" suffix=")" suffixOverrides=",">
<if test="category != null">category,</if>
<if test="content != null">content,</if>
<if test="remark != null">remark,</if>
<if test="createTime != null">create_time,</if>
<if test="updateTime != null">update_time,</if>
</trim>
<trim prefix="values (" suffix=")" suffixOverrides=",">
<if test="category != null">#{category},</if>
<if test="content != null">#{content},</if>
<if test="remark != null">#{remark},</if>
<if test="createTime != null">#{createTime},</if>
<if test="updateTime != null">#{updateTime},</if>
</trim>
</insert>
<update id="updateDcVoiceBroadcast" parameterType="com.zc.business.domain.DcVoiceBroadcast">
update dc_voice_broadcast
<trim prefix="SET" suffixOverrides=",">
<if test="category != null">category = #{category},</if>
<if test="content != null">content = #{content},</if>
<if test="remark != null">remark = #{remark},</if>
<if test="createTime != null">create_time = #{createTime},</if>
<if test="updateTime != null">update_time = #{updateTime},</if>
</trim>
where id = #{id}
</update>
<delete id="deleteDcVoiceBroadcastById" parameterType="Long">
delete from dc_voice_broadcast where id = #{id}
</delete>
<delete id="deleteDcVoiceBroadcastByIds" parameterType="String">
delete from dc_voice_broadcast where id in
<foreach item="id" collection="array" open="(" separator="," close=")">
#{id}
</foreach>
</delete>
</mapper>
Loading…
Cancel
Save