| | |
| | | @TableField("dept_id") |
| | | private String deptId; |
| | | |
| | | @Column(name = "batch_name", columnDefinition = "varchar(40) COMMENT '班次名称'") |
| | | @TableField("batch_name") |
| | | @Column(name = "name", columnDefinition = "varchar(40) COMMENT '班次名称'") |
| | | @TableField("name") |
| | | private String name; |
| | | |
| | | @Column(name = "user_name", columnDefinition = "varchar(40) COMMENT '巡逻人'") |
| | | @Column(name = "user_id", columnDefinition = "varchar(200) COMMENT '巡逻人账号'") |
| | | @TableField("user_id") |
| | | private String userId; |
| | | |
| | | @Column(name = "user_name", columnDefinition = "varchar(200) COMMENT '巡逻人'") |
| | | @TableField("user_name") |
| | | private String userName; |
| | | |
| | |
| | | |
| | | import com.fzzy.igds.domain.PatrolConf; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import com.fzzy.sys.manager.common.CommonManager; |
| | | import com.fzzy.sys.manager.security.PatrolConfManager; |
| | | import com.ruoyi.common.annotation.Log; |
| | | import com.ruoyi.common.core.controller.BaseController; |
| | | import com.ruoyi.common.core.domain.AjaxResult; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.core.page.TableDataInfo; |
| | | import com.ruoyi.common.enums.BusinessType; |
| | | import com.ruoyi.common.utils.ShiroUtils; |
| | |
| | | |
| | | @Resource |
| | | private PatrolConfManager patrolConfManager; |
| | | |
| | | @Resource |
| | | private CommonManager commonManager; |
| | | |
| | | /** |
| | | * 巡更配置页面 |
| | |
| | | */ |
| | | @GetMapping("/add") |
| | | public String add(ModelMap mmap) { |
| | | //巡逻人列表 |
| | | mmap.put("userList", commonManager.listUserData()); |
| | | return prefix + "/add"; |
| | | } |
| | | |
| | |
| | | public String edit(@PathVariable("id") String id, ModelMap mmap) { |
| | | PatrolConf record = patrolConfManager.selectById(id); |
| | | mmap.put("patrolConf", record); |
| | | //巡逻人列表 |
| | | mmap.put("userList", commonManager.listUserData()); |
| | | return prefix + "/edit"; |
| | | } |
| | | |
| | |
| | | import com.fzzy.igds.service.DicService; |
| | | import com.fzzy.igds.utils.ContextUtil; |
| | | import com.ruoyi.common.core.domain.entity.SysDictData; |
| | | import com.ruoyi.common.core.domain.entity.SysUser; |
| | | import com.ruoyi.common.utils.StringUtils; |
| | | import com.ruoyi.system.service.ISysUserService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import javax.annotation.Resource; |
| | | import java.util.List; |
| | | |
| | |
| | | @Slf4j |
| | | @Component |
| | | public class CommonManager { |
| | | |
| | | @Resource |
| | | private DepotService depotService; |
| | | @Resource |
| | |
| | | @Resource |
| | | private CoreDeptService coreDeptService; |
| | | |
| | | @Autowired |
| | | private ISysUserService userService; |
| | | |
| | | /** |
| | | * 根据字典类型获取字典列表 |
| | | * |
| | | * @param parentCode |
| | | * @param companyId |
| | | * @return |
| | |
| | | * |
| | | * @author sgj |
| | | * @date 2025/12/12 |
| | | |
| | | */ |
| | | public List<Dept> listDeptData() { |
| | | return coreDeptService.getDeptData(); |
| | |
| | | |
| | | /** |
| | | * 根据仓库编码获取仓库类型 |
| | | * |
| | | * @param depotId |
| | | * @return |
| | | */ |
| | |
| | | |
| | | return depotType; |
| | | } |
| | | |
| | | /** |
| | | * 获取用户列表 |
| | | * |
| | | * @author sgj |
| | | * @date 2025/12/12 |
| | | */ |
| | | public List<SysUser> listUserData() { |
| | | SysUser user = new SysUser() ; |
| | | user.setCompanyId(ContextUtil.getCompanyId()); |
| | | user.setDeptId(Long.valueOf(ContextUtil.subDeptId(null))); |
| | | return userService.selectUserList(user); |
| | | } |
| | | } |
| | |
| | | <body> |
| | | <div class="main-content"> |
| | | <form id="form-patrol-add" class="form-horizontal"> |
| | | <input name="deptId" type="hidden" id="treeId"/> |
| | | <input name="userId" type="hidden" id="userId"/> |
| | | |
| | | <div class="row"> |
| | | <div class="col-sm-6"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-4 control-label is-required">班次名称:</label> |
| | | <div class="col-sm-8"> |
| | | <input name="batchName" id="batchName" placeholder="请输入" class="form-control " type="text" |
| | | <input name="name" id="name" placeholder="请输入" class="form-control " type="text" |
| | | maxlength="30" required> |
| | | </div> |
| | | </div> |
| | |
| | | <div class="form-group"> |
| | | <label class="col-sm-4 control-label is-required">巡逻人:</label> |
| | | <div class="col-sm-8"> |
| | | <input name="userName" id="userName" placeholder="请输入" class="form-control " type="text" |
| | | maxlength="30" required> |
| | | <select name="userName" id="userName" class="form-control select2" multiple required onchange="changeUser(this)"> |
| | | <option value="">请选择巡逻人</option> |
| | | <option th:each="user : ${userList}" th:value="${user.userName}" th:data-userid="${user.userId}" th:text="${user.userName}"></option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="row"> |
| | | <div class="col-sm-6"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-4 control-label is-required">开始时间:</label> |
| | | <div class="col-sm-8"> |
| | | <input name="start" placeholder="请选择开始时间" data-type="datetime" class="form-control time-input" type="text" |
| | | required> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-6"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-4 control-label is-required">结束时间:</label> |
| | | <div class="col-sm-8"> |
| | | <input name="end" placeholder="请选择结束时间" data-type="datetime" class="form-control time-input" type="text" |
| | | required> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | </div> |
| | | <th:block th:include="include :: footer"/> |
| | | <th:block th:include="include :: select2-js"/> |
| | | <script> |
| | | <script type="text/javascript"> |
| | | var prefix = ctx + "security/patrol/patrolConf"; |
| | | |
| | | $("#form-cabinet-add").validate({ |
| | |
| | | } |
| | | } |
| | | |
| | | function changeUser(selectElement) { |
| | | var selectedOptions = Array.from(selectElement.selectedOptions); |
| | | var userIds = selectedOptions.map(option => option.getAttribute('data-userid')).filter(id => id); |
| | | var userIdStr = userIds.join(','); |
| | | $("#userId").val(userIdStr); |
| | | } |
| | | |
| | | |
| | | </script> |
| | | </body> |
| | |
| | | <body class="white-bg"> |
| | | <div class="wrapper wrapper-content animated fadeInRight ibox-content"> |
| | | <form class="form-horizontal m" id="form-patrol-edit" th:object="${patrolConf}"> |
| | | <input id="id" name="id" th:field="*{batchId}" type="hidden"> |
| | | <input id="id" name="id" th:field="*{id}" type="hidden"> |
| | | <input name="userId" type="hidden" th:field="*{userId}" id="userId"/> |
| | | <div class="row"> |
| | | <div class="col-sm-6"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-4 control-label is-required">班次名称:</label> |
| | | <div class="col-sm-8"> |
| | | <input name="batchName" id="batchName" th:field="*{batchName}" placeholder="请输入" class="form-control " |
| | | <input name="name" id="name" th:field="*{name}" placeholder="请输入" class="form-control " |
| | | type="text" |
| | | maxlength="30" required> |
| | | </div> |
| | |
| | | <div class="form-group"> |
| | | <label class="col-sm-4 control-label is-required">巡逻人:</label> |
| | | <div class="col-sm-8"> |
| | | <input name="userName" id="userName" th:field="*{userName}" placeholder="请输入" class="form-control " |
| | | type="text" |
| | | maxlength="30" required> |
| | | <select name="userName" id="userName" class="form-control select2" multiple required onchange="changeUser(this)"> |
| | | <option value="">请选择巡逻人</option> |
| | | <option th:each="user : ${userList}" |
| | | th:value="${user.userName}" |
| | | th:text="${user.userName}" |
| | | th:data-userid="${user.userId}" |
| | | th:selected="${#strings.contains(patrolConf.userId, user.userId)}"></option> |
| | | </select> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | |
| | | |
| | | </div> |
| | | <div class="row"> |
| | | <div class="col-sm-6"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-4 control-label is-required">开始时间:</label> |
| | | <div class="col-sm-8"> |
| | | <input id="start" name="startTime" th:value="*{#dates.format(start, 'yyyy-MM-dd HH:mm:ss')}" data-type="datetime" placeholder="请选择开始时间" class="form-control time-input" type="text" required> |
| | | </div> |
| | | </div> |
| | | </div> |
| | | <div class="col-sm-6"> |
| | | <div class="form-group"> |
| | | <label class="col-sm-4 control-label is-required">结束时间:</label> |
| | | <div class="col-sm-8"> |
| | | <input id="end" name="endTime" th:value="*{#dates.format(end, 'yyyy-MM-dd HH:mm:ss')}" data-type="datetime" placeholder="请选择结束时间" class="form-control time-input" type="text" required> |
| | | </div> |
| | | </div> |
| | | </div> |
| | |
| | | <th:block th:include="include :: footer"/> |
| | | <th:block th:include="include :: select2-js"/> |
| | | <script type="text/javascript"> |
| | | |
| | | var prefix = ctx + "security/patrol/patrolConf"; |
| | | |
| | | |
| | |
| | | $.operate.save(prefix + "/edit", $('#form-patrol-edit').serialize()); |
| | | } |
| | | } |
| | | |
| | | function changeUser(selectElement) { |
| | | var selectedOptions = Array.from(selectElement.selectedOptions); |
| | | var userIds = selectedOptions.map(option => option.getAttribute('data-userid')).filter(id => id); |
| | | var userIdStr = userIds.join(','); |
| | | $("#userId").val(userIdStr); |
| | | } |
| | | |
| | | </script> |
| | | </body> |
| | | </html> |
| | |
| | | <body class="gray-bg"> |
| | | <div class="container-div"> |
| | | <div class="row"> |
| | | <div class="col-sm-12 search-collapse"> |
| | | <form id="property-form"> |
| | | <div class="select-list"> |
| | | <ul> |
| | | <li> |
| | | 名称:<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> 搜索</a> |
| | | <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a> |
| | | </li> |
| | | </ul> |
| | | </div> |
| | | </form> |
| | | </div> |
| | | <!-- <div class="col-sm-12 search-collapse">--> |
| | | <!-- <form id="property-form">--> |
| | | <!-- <div class="select-list">--> |
| | | <!-- <ul>--> |
| | | <!-- <li>--> |
| | | <!-- 名称:<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> 搜索</a>--> |
| | | <!-- <a class="btn btn-warning btn-rounded btn-sm" onclick="$.form.reset()"><i class="fa fa-refresh"></i> 重置</a>--> |
| | | <!-- </li>--> |
| | | <!-- </ul>--> |
| | | <!-- </div>--> |
| | | <!-- </form>--> |
| | | <!-- </div>--> |
| | | |
| | | <div class="btn-group-sm" id="toolbar" role="group"> |
| | | <a class="btn btn-success" onclick="$.operate.add()" > |
| | |
| | | <a class="btn btn-danger multiple disabled" onclick="$.operate.removeAll()" > |
| | | <i class="fa fa-remove"></i> 删除 |
| | | </a> |
| | | <a class="btn btn-warning" onclick="$.table.exportExcel()" > |
| | | <i class="fa fa-download"></i> 导出 |
| | | </a> |
| | | <!-- <a class="btn btn-warning" onclick="$.table.exportExcel()" >--> |
| | | <!-- <i class="fa fa-download"></i> 导出--> |
| | | <!-- </a>--> |
| | | </div> |
| | | <div class="col-sm-12 select-table table-striped"> |
| | | <table id="bootstrap-table"></table> |
| | |
| | | updateUrl: prefix + "/edit/{id}", |
| | | removeUrl: prefix + "/remove", |
| | | exportUrl: prefix + "/export", |
| | | sortName: "batchId", |
| | | sortName: "id", |
| | | sortOrder: "asc", |
| | | modalName: "参数", |
| | | showSearch:false, |
| | | showRefresh:false, |
| | | showColumns:false, |
| | | showToggle:false, |
| | | columns: [{ |
| | | checkbox: true |
| | | }, |
| | | { |
| | | field: 'batchId', |
| | | field: 'id', |
| | | title: '主键', |
| | | visible: false, |
| | | }, |
| | | { |
| | | field: 'batchName', |
| | | field: 'name', |
| | | title: '班次名称', |
| | | align: 'left', |
| | | // formatter: function(value, row, index) { |
| | |
| | | align: 'center', |
| | | formatter: function(value, row, index) { |
| | | var actions = []; |
| | | actions.push('<a class="btn btn-success btn-xs ' + '" href="javascript:void(0)" onclick="$.operate.edit(\'' + row.batchId + '\')"><i class="fa fa-edit"></i>编辑</a> '); |
| | | actions.push('<a class="btn btn-danger btn-xs ' + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.batchId + '\')"><i class="fa fa-remove"></i>删除</a>'); |
| | | actions.push('<a class="btn btn-success btn-xs ' + '" 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 ' + '" href="javascript:void(0)" onclick="$.operate.remove(\'' + row.id + '\')"><i class="fa fa-remove"></i>删除</a>'); |
| | | return actions.join(''); |
| | | } |
| | | }] |