From 5223213c86cf116805a7496776d425b2d1d92018 Mon Sep 17 00:00:00 2001 From: luyue123456 <1398150030@qq.com> Date: Mon, 16 Dec 2024 09:20:57 +0800 Subject: [PATCH] =?UTF-8?q?=E9=80=9A=E8=AE=AF=E5=BD=95=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ability/RwkAddressBookController.java | 147 +++++++++++++ .../RwkStaffInformationController.java | 5 - .../resources/static/ruoyi/css/address.css | 80 +++++++ .../main/resources/static/ruoyi/js/ry-ui.js | 52 +---- .../templates/system/addressbook/addbook.html | 59 +++++ .../system/addressbook/addgroup.html | 30 +++ .../system/addressbook/addressbook.html | 203 ++++++++++++++++++ .../addressbook2.html} | 101 +++++---- .../com/rwk/system/domain/RwkAddressBook.java | 130 +++++++++++ .../system/mapper/RwkAddressBookMapper.java | 61 ++++++ .../service/IRwkAddressBookService.java | 61 ++++++ .../impl/RwkAddressBookServiceImpl.java | 94 ++++++++ .../mapper/system/RwkAddressBookMapper.xml | 82 +++++++ 13 files changed, 1003 insertions(+), 102 deletions(-) create mode 100644 rwk-admin/src/main/java/com/rwk/web/controller/ability/RwkAddressBookController.java create mode 100644 rwk-admin/src/main/resources/static/ruoyi/css/address.css create mode 100644 rwk-admin/src/main/resources/templates/system/addressbook/addbook.html create mode 100644 rwk-admin/src/main/resources/templates/system/addressbook/addgroup.html create mode 100644 rwk-admin/src/main/resources/templates/system/addressbook/addressbook.html rename rwk-admin/src/main/resources/templates/system/{information/addressBook.html => addressbook/addressbook2.html} (61%) create mode 100644 rwk-system/src/main/java/com/rwk/system/domain/RwkAddressBook.java create mode 100644 rwk-system/src/main/java/com/rwk/system/mapper/RwkAddressBookMapper.java create mode 100644 rwk-system/src/main/java/com/rwk/system/service/IRwkAddressBookService.java create mode 100644 rwk-system/src/main/java/com/rwk/system/service/impl/RwkAddressBookServiceImpl.java create mode 100644 rwk-system/src/main/resources/mapper/system/RwkAddressBookMapper.xml diff --git a/rwk-admin/src/main/java/com/rwk/web/controller/ability/RwkAddressBookController.java b/rwk-admin/src/main/java/com/rwk/web/controller/ability/RwkAddressBookController.java new file mode 100644 index 0000000..b683390 --- /dev/null +++ b/rwk-admin/src/main/java/com/rwk/web/controller/ability/RwkAddressBookController.java @@ -0,0 +1,147 @@ +package com.rwk.web.controller.ability; + +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.rwk.common.annotation.Log; +import com.rwk.common.enums.BusinessType; +import com.rwk.system.domain.RwkAddressBook; +import com.rwk.system.service.IRwkAddressBookService; +import com.rwk.common.core.controller.BaseController; +import com.rwk.common.core.domain.AjaxResult; +import com.rwk.common.utils.poi.ExcelUtil; +import com.rwk.common.core.page.TableDataInfo; + +/** + * 通讯录主Controller + * + * @author ruoyi + * @date 2024-12-11 + */ +@Controller +@RequestMapping("/system/addressbook") +public class RwkAddressBookController extends BaseController +{ + private String prefix = "system/addressbook"; + + @Autowired + private IRwkAddressBookService rwkAddressBookService; + + @RequiresPermissions("system:addressbook:view") + @GetMapping() + public String book() + { + return prefix + "/addressbook"; + } + + /** + * 查询通讯录主列表 + */ + @RequiresPermissions("system:book:list") + @PostMapping("/list") + @ResponseBody + public TableDataInfo list(RwkAddressBook rwkAddressBook) + { + + List list = rwkAddressBookService.selectRwkAddressBookList(rwkAddressBook); + return getDataTable(list); + } + + + /** + * 导出通讯录主列表 + */ + @RequiresPermissions("system:book:export") + @Log(title = "通讯录主", businessType = BusinessType.EXPORT) + @PostMapping("/export") + @ResponseBody + public AjaxResult export(RwkAddressBook rwkAddressBook) + { + List list = rwkAddressBookService.selectRwkAddressBookList(rwkAddressBook); + ExcelUtil util = new ExcelUtil(RwkAddressBook.class); + return util.exportExcel(list, "通讯录主数据"); + } + + /** + * 新增通讯录人员 + */ + @GetMapping("/add") + public String add() + { + return prefix + "/add"; + } + + /** + * 新增通讯录分组 + */ + @GetMapping("/addgroup") + public String addgroup() + { + return prefix + "/addgroup"; + } + + + /** + * 新增通讯录分组 + */ + @GetMapping("/addbook") + public String addbook() + { + return prefix + "/addbook"; + } + + /** + * 新增保存通讯录 + */ + @RequiresPermissions("system:book:add") + @Log(title = "通讯录主", businessType = BusinessType.INSERT) + @PostMapping("/add") + @ResponseBody + public AjaxResult addSave(RwkAddressBook rwkAddressBook) + { + return toAjax(rwkAddressBookService.insertRwkAddressBook(rwkAddressBook)); + } + + /** + * 修改通讯录 + */ + @RequiresPermissions("system:book:edit") + @GetMapping("/edit/{id}") + public String edit(@PathVariable("id") Long id, ModelMap mmap) + { + RwkAddressBook rwkAddressBook = rwkAddressBookService.selectRwkAddressBookById(id); + mmap.put("rwkAddressBook", rwkAddressBook); + return prefix + "/edit"; + } + + /** + * 修改保存通讯录 + */ + @RequiresPermissions("system:book:edit") + @Log(title = "通讯录主", businessType = BusinessType.UPDATE) + @PostMapping("/edit") + @ResponseBody + public AjaxResult editSave(RwkAddressBook rwkAddressBook) + { + return toAjax(rwkAddressBookService.updateRwkAddressBook(rwkAddressBook)); + } + + /** + * 删除通讯录 + */ + @RequiresPermissions("system:book:remove") + @Log(title = "通讯录主", businessType = BusinessType.DELETE) + @PostMapping( "/remove") + @ResponseBody + public AjaxResult remove(String ids) + { + return toAjax(rwkAddressBookService.deleteRwkAddressBookByIds(ids)); + } +} diff --git a/rwk-admin/src/main/java/com/rwk/web/controller/ability/RwkStaffInformationController.java b/rwk-admin/src/main/java/com/rwk/web/controller/ability/RwkStaffInformationController.java index 21aec39..e439a13 100644 --- a/rwk-admin/src/main/java/com/rwk/web/controller/ability/RwkStaffInformationController.java +++ b/rwk-admin/src/main/java/com/rwk/web/controller/ability/RwkStaffInformationController.java @@ -57,11 +57,6 @@ public class RwkStaffInformationController extends BaseController return prefix + "/information"; } - @GetMapping("/addressBook") - public String addressBook() - { - return prefix + "/addressBook"; - } /** * 查看收文 diff --git a/rwk-admin/src/main/resources/static/ruoyi/css/address.css b/rwk-admin/src/main/resources/static/ruoyi/css/address.css new file mode 100644 index 0000000..96f2057 --- /dev/null +++ b/rwk-admin/src/main/resources/static/ruoyi/css/address.css @@ -0,0 +1,80 @@ +::-webkit-scrollbar{ + width:0px!important; + height: 0px!important; +} +.group-list { + margin-top: 25px; +} +.group-list ul{ + margin: 0; + padding: 0; +} +.group-list li{ + list-style-type: none; + padding: 5px 0 5px 20px; + margin: 5px 0; + cursor: pointer; +} +.group-list li:hover{ + background-color: #CECECE; +} + +.bootstrap-table .fixed-table-container.fixed-height:not(.has-footer){ + border: 0px!important; +} +.bootstrap-table .fixed-table-container.fixed-height .fixed-table-border{ + border: 0px!important; +} +.btn-style1{ + padding: 6px 20px; + border-radius: 5px 5px 0 0; + background-color: #EAF9FD; + color: #000000; +} +.btn-style2{ + padding: 6px 20px; + border-radius: 0; + color: #185EFF; + border-color: #185EFF; +} +.btn-style3{ + color: #417EFA; + padding: 0 10px; +} +.btn-style1:hover,.btn-style2:hover{ + background-color: #185EFF; + color: #ffffff; +} + +.address-btn layui-layer-title{ + background-color: #185EFF; + text-align: center; + font-size: 16px; +} + +.address-btn layui-layer-btn{ + text-align: center; +} + +.addgroup_frame{ + height: 32px; + width: 360px; +} +.layui-layer-btn{ + text-align: center!important; +} + +.address-from-left{ + height: 32px ; + width: 25%; + display: inline-block; + text-align: right; +} + +.address-from-right{ + height: 32px ; + width: 55%; + display: inline-block; + text-align: right; + margin-left: 14px; +} diff --git a/rwk-admin/src/main/resources/static/ruoyi/js/ry-ui.js b/rwk-admin/src/main/resources/static/ruoyi/js/ry-ui.js index 7a8fbf0..37c3008 100644 --- a/rwk-admin/src/main/resources/static/ruoyi/js/ry-ui.js +++ b/rwk-admin/src/main/resources/static/ruoyi/js/ry-ui.js @@ -52,15 +52,15 @@ var table = { toolbar: "toolbar", loadingFontSize: 13, striped: false, - escape: false, + escape: true, firstLoad: true, showFooter: false, search: false, - showSearch: false, + showSearch: true, showPageGo: false, - showRefresh: false, - showColumns: false, - showToggle: false, + showRefresh: true, + showColumns: true, + showToggle: true, showExport: false, showPrint: false, exportDataType: 'all', @@ -260,7 +260,6 @@ var table = { type: 1, closeBtn: true, shadeClose: true, - area: ['auto', 'auto'], content: "" }); } else if ($.common.equals("blank", target)) { @@ -504,26 +503,6 @@ var table = { } return distinct ? $.common.uniqueFn(rows) : rows; }, - // 查询表格指定列值 deDuplication(true去重、false不去重) - selectMoreColumns: function(columns, deDuplication) { - var distinct = $.common.isEmpty(deDuplication) ? false : deDuplication; - var data = $("#" + table.options.id).bootstrapTable('getSelections'); - var rows = data.map(item => { - const newItem = {}; - columns.forEach(column => { - if (item[column]) { // 确保字段存在 - newItem[column] = item[column]; - } - }); - return newItem; - }); - if (distinct){ - rows = rows.filter((item, index) => - rows.findIndex(obj => obj.userId === item.userId) === index - ); - } - return rows; - }, // 获取当前页选中或者取消的行ID affectedRowIds: function(rows) { var column = $.common.isEmpty(table.options.uniqueId) ? table.options.columns[1].field : table.options.uniqueId; @@ -572,23 +551,6 @@ var table = { } return actions.join(''); }, - // 回显数据字典单字符串 - selectDictLabelStr: function(datas, value) { - if ($.common.isEmpty(datas) || $.common.isEmpty(value)) { - return ''; - } - var actions = []; - $.each(datas, function(index, dict) { - if (dict.dictValue == value) { - actions.push($.common.sprintf("%s",dict.dictLabel)); - return false; - } - }); - if (actions.length === 0) { - return ''; - } - return actions.join(''); - }, // 回显数据字典(字符串数组) selectDictLabels: function(datas, value, separator) { if ($.common.isEmpty(datas) || $.common.isEmpty(value)) { @@ -889,7 +851,7 @@ var table = { url = "/404.html"; } if ($.common.isEmpty(width)) { - width = 1000; + width = 800; } if ($.common.isEmpty(height)) { height = ($(window).height() - 50); @@ -957,8 +919,10 @@ var table = { fix: false, area: [_width + 'px', _height + 'px'], content: _url, + closeBtn: $.common.isEmpty(options.closeBtn) ? 1 : options.closeBtn, shadeClose: $.common.isEmpty(options.shadeClose) ? true : options.shadeClose, skin: options.skin, + offset: options.offset, // options.btn设置为0表示不显示按钮 btn: $.common.isEmpty(options.btn) ? _btn : options.btn, yes: options.yes, diff --git a/rwk-admin/src/main/resources/templates/system/addressbook/addbook.html b/rwk-admin/src/main/resources/templates/system/addressbook/addbook.html new file mode 100644 index 0000000..aa55d5d --- /dev/null +++ b/rwk-admin/src/main/resources/templates/system/addressbook/addbook.html @@ -0,0 +1,59 @@ + + + + + + + + + + + + + + +
+
+
+
+ *姓名: +
+
+ +
+
+ +
+
+ 电话: +
+
+ +
+
+ +
+
+ Email: +
+
+ +
+
+ +
+
+ 分组归类: +
+
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/rwk-admin/src/main/resources/templates/system/addressbook/addgroup.html b/rwk-admin/src/main/resources/templates/system/addressbook/addgroup.html new file mode 100644 index 0000000..4c72490 --- /dev/null +++ b/rwk-admin/src/main/resources/templates/system/addressbook/addgroup.html @@ -0,0 +1,30 @@ + + + + + + + + + +
+ + + + + +
+
+ +
+ +
+
+
+
+ + + + \ No newline at end of file diff --git a/rwk-admin/src/main/resources/templates/system/addressbook/addressbook.html b/rwk-admin/src/main/resources/templates/system/addressbook/addressbook.html new file mode 100644 index 0000000..26bfd62 --- /dev/null +++ b/rwk-admin/src/main/resources/templates/system/addressbook/addressbook.html @@ -0,0 +1,203 @@ + + + + + + + + +
+
+
+
+
+
    +
  • + +
  • +
  • + + +
  • +
+
+
+
+ +
+
+
+
+
+
+
    +
  • 所有联系人(11)
  • +
  • 分组1(4)
  • +
  • 分组2(7)
  • +
  • 分组3(1)
  • +
  • 分组4(0)
  • +
  • 未分组联系人(1)
  • +
+
+
+
+
+
+
+
+
+ + + + + \ No newline at end of file diff --git a/rwk-admin/src/main/resources/templates/system/information/addressBook.html b/rwk-admin/src/main/resources/templates/system/addressbook/addressbook2.html similarity index 61% rename from rwk-admin/src/main/resources/templates/system/information/addressBook.html rename to rwk-admin/src/main/resources/templates/system/addressbook/addressbook2.html index 1f610f8..305d770 100644 --- a/rwk-admin/src/main/resources/templates/system/information/addressBook.html +++ b/rwk-admin/src/main/resources/templates/system/addressbook/addressbook2.html @@ -3,6 +3,7 @@ +