From a6f1884c18133bca75d5b169a4b07e485aadc445 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=8E=8B=E5=85=B4=E7=90=B3?= <1911390090@qq.com> Date: Fri, 19 Apr 2024 10:01:52 +0800 Subject: [PATCH] =?UTF-8?q?=E9=9F=B3=E5=B9=BF=E6=92=AD=E9=A2=84=E5=8F=91?= =?UTF-8?q?=E5=B8=83=E5=86=85=E5=AE=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../DcVoiceBroadcastController.java | 138 ++++++++++++++++++ .../zc/business/domain/DcVoiceBroadcast.java | 72 +++++++++ .../mapper/DcVoiceBroadcastMapper.java | 64 ++++++++ .../service/IDcVoiceBroadcastService.java | 64 ++++++++ .../impl/DcVoiceBroadcastServiceImpl.java | 102 +++++++++++++ .../business/DcVoiceBroadcastMapper.xml | 78 ++++++++++ 6 files changed, 518 insertions(+) create mode 100644 zc-business/src/main/java/com/zc/business/controller/DcVoiceBroadcastController.java create mode 100644 zc-business/src/main/java/com/zc/business/domain/DcVoiceBroadcast.java create mode 100644 zc-business/src/main/java/com/zc/business/mapper/DcVoiceBroadcastMapper.java create mode 100644 zc-business/src/main/java/com/zc/business/service/IDcVoiceBroadcastService.java create mode 100644 zc-business/src/main/java/com/zc/business/service/impl/DcVoiceBroadcastServiceImpl.java create mode 100644 zc-business/src/main/resources/mapper/business/DcVoiceBroadcastMapper.xml diff --git a/zc-business/src/main/java/com/zc/business/controller/DcVoiceBroadcastController.java b/zc-business/src/main/java/com/zc/business/controller/DcVoiceBroadcastController.java new file mode 100644 index 00000000..75ad8f47 --- /dev/null +++ b/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 list = dcVoiceBroadcastService.selectDcVoiceBroadcastList(dcVoiceBroadcast); + return getDataTable(list); + } + /** + * 查询语音广播预发布列表 + */ + @ApiOperation("无分页查询语音广播预发布列表") + @PreAuthorize("@ss.hasPermi('system:broadcast:listAll')") + @GetMapping("/listAll") + public TableDataInfo listAll(DcVoiceBroadcast dcVoiceBroadcast) + { + List 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 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 list = dcVoiceBroadcastService.selectDcVoiceBroadcastList(dcVoiceBroadcast); + ExcelUtil 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)); + } +} diff --git a/zc-business/src/main/java/com/zc/business/domain/DcVoiceBroadcast.java b/zc-business/src/main/java/com/zc/business/domain/DcVoiceBroadcast.java new file mode 100644 index 00000000..51cfc018 --- /dev/null +++ b/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(); + } +} diff --git a/zc-business/src/main/java/com/zc/business/mapper/DcVoiceBroadcastMapper.java b/zc-business/src/main/java/com/zc/business/mapper/DcVoiceBroadcastMapper.java new file mode 100644 index 00000000..7785db4b --- /dev/null +++ b/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 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 selectDcVoiceBroadcastListByCategory(String category); +} diff --git a/zc-business/src/main/java/com/zc/business/service/IDcVoiceBroadcastService.java b/zc-business/src/main/java/com/zc/business/service/IDcVoiceBroadcastService.java new file mode 100644 index 00000000..2cdb249a --- /dev/null +++ b/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 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 selectDcVoiceBroadcastListByCategory(String category); +} diff --git a/zc-business/src/main/java/com/zc/business/service/impl/DcVoiceBroadcastServiceImpl.java b/zc-business/src/main/java/com/zc/business/service/impl/DcVoiceBroadcastServiceImpl.java new file mode 100644 index 00000000..8709e93e --- /dev/null +++ b/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 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 selectDcVoiceBroadcastListByCategory(String category) { + return dcVoiceBroadcastMapper.selectDcVoiceBroadcastListByCategory(category); + } +} diff --git a/zc-business/src/main/resources/mapper/business/DcVoiceBroadcastMapper.xml b/zc-business/src/main/resources/mapper/business/DcVoiceBroadcastMapper.xml new file mode 100644 index 00000000..45b14aa3 --- /dev/null +++ b/zc-business/src/main/resources/mapper/business/DcVoiceBroadcastMapper.xml @@ -0,0 +1,78 @@ + + + + + + + + + + + + + + + select id, category, content, remark, create_time, update_time from dc_voice_broadcast + + + + + + + + + + insert into dc_voice_broadcast + + category, + content, + remark, + create_time, + update_time, + + + #{category}, + #{content}, + #{remark}, + #{createTime}, + #{updateTime}, + + + + + update dc_voice_broadcast + + category = #{category}, + content = #{content}, + remark = #{remark}, + create_time = #{createTime}, + update_time = #{updateTime}, + + where id = #{id} + + + + delete from dc_voice_broadcast where id = #{id} + + + + delete from dc_voice_broadcast where id in + + #{id} + + + \ No newline at end of file