From 8ee0f637f45ce6f752422448b6b933e89cc037bd Mon Sep 17 00:00:00 2001 From: liuxiaoxu <1793812695@qq.com> Date: Fri, 19 Apr 2024 15:55:29 +0800 Subject: [PATCH] =?UTF-8?q?[fix]=E5=B7=A5=E7=A8=8B=E7=AE=A1=E7=90=86:=20?= =?UTF-8?q?=E4=BF=AE=E6=94=B9=E5=BC=80=E5=8F=91=E4=BF=AE=E6=94=B9=E5=8D=95?= =?UTF-8?q?=E7=9A=84=E5=B7=A5=E7=A8=8B=E5=91=98=E7=9A=84=E6=9F=A5=E8=AF=A2?= =?UTF-8?q?=E6=96=B9=E5=BC=8F=E3=80=82=E5=86=99=E4=B8=80=E4=B8=AA=E9=80=9A?= =?UTF-8?q?=E7=94=A8=E6=9F=A5=E8=AF=A2=EF=BC=8C=E9=80=9A=E8=BF=87=E6=8C=87?= =?UTF-8?q?=E5=AE=9AroleKey=E6=9F=A5=E8=AF=A2=E7=89=B9=E5=AE=9A=E8=A7=92?= =?UTF-8?q?=E8=89=B2=E7=9A=84=E7=94=A8=E6=88=B7=E9=9B=86=E5=90=88?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ErpDevelopModifyorderController.java | 17 ++++++++++ .../erp/ErpDevelopModifyorderMapper.xml | 23 +++++++------ .../templates/erp/developModifyOrder/add.html | 33 +++++++++++++++---- .../developModifyOrder.html | 2 +- .../ruoyi/system/mapper/SysUserMapper.java | 6 ++++ .../ruoyi/system/service/ISysUserService.java | 7 ++++ .../service/impl/SysUserServiceImpl.java | 11 +++++++ .../resources/mapper/system/SysUserMapper.xml | 8 +++++ 8 files changed, 89 insertions(+), 18 deletions(-) diff --git a/ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpDevelopModifyorderController.java b/ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpDevelopModifyorderController.java index 9b415c95..fc12d071 100644 --- a/ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpDevelopModifyorderController.java +++ b/ruoyi-admin/src/main/java/com/ruoyi/erp/controller/ErpDevelopModifyorderController.java @@ -1,6 +1,9 @@ package com.ruoyi.erp.controller; import java.util.List; + +import com.ruoyi.common.core.domain.entity.SysUser; +import com.ruoyi.system.service.ISysUserService; import org.apache.shiro.authz.annotation.RequiresPermissions; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Controller; @@ -31,6 +34,9 @@ public class ErpDevelopModifyorderController extends BaseController { private String prefix = "erp/developModifyOrder"; + @Autowired + private ISysUserService sysUserService; + @Autowired private IErpDevelopModifyorderService erpDevelopModifyorderService; @@ -54,6 +60,17 @@ public class ErpDevelopModifyorderController extends BaseController return getDataTable(list); } + + /** + * 查找所有的工程员 + * */ + @ResponseBody + @PostMapping("/getEngineerList") + public AjaxResult getEngineerList(String roleKey){ + List engineerList = sysUserService.getSpecificRoleList(roleKey); + return AjaxResult.success(engineerList); + } + /** * 导出开发修改单列表 */ diff --git a/ruoyi-admin/src/main/resources/mapper/erp/ErpDevelopModifyorderMapper.xml b/ruoyi-admin/src/main/resources/mapper/erp/ErpDevelopModifyorderMapper.xml index a9b45312..1494981f 100644 --- a/ruoyi-admin/src/main/resources/mapper/erp/ErpDevelopModifyorderMapper.xml +++ b/ruoyi-admin/src/main/resources/mapper/erp/ErpDevelopModifyorderMapper.xml @@ -32,18 +32,21 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" select develop_order_id, develop_oder_code, material_no, purchase_storage_status, quality_status, audit_status, complete_status, finsh_status, use_status, material_name, material_type, material_photo_url, material_unit, material_brand, material_describe, material_process_mode, user_id, create_by, create_time, user_name, update_by, update_time, remark from erp_develop_modifyorder - + + diff --git a/ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/add.html b/ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/add.html index b9b47853..8749cee5 100644 --- a/ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/add.html +++ b/ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/add.html @@ -111,17 +111,11 @@
-
-
- -
- -
-
@@ -137,6 +131,31 @@ focusCleanup: true }); + + + $(function () { + $.ajax({ + url: ctx + 'erp/developModifyOrder/getEngineerList', + type: 'post', + data: { roleKey: 'gcwyRole' }, + success: function (res) { + if (res.data.length > 0) { + var userData = res.data; + for (let i in userData) { + $("#userId_add").append( + "" // 显示用户姓名 + ); + } + $("userId_add").val(userData[i].userId).trigger("change"); + } else { + $.modal.msgError(res.msg); + } + } + }); + }) + + + function submitHandler() { if ($.validate.form()) { $.operate.save(prefix + "/add", $('#form-developModifyOrder-add').serialize()); diff --git a/ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/developModifyOrder.html b/ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/developModifyOrder.html index 69b643a6..deee2227 100644 --- a/ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/developModifyOrder.html +++ b/ruoyi-admin/src/main/resources/templates/erp/developModifyOrder/developModifyOrder.html @@ -150,7 +150,7 @@ }, { title: '工程员', - field: 'userId', + field: 'userName', }, { title: '料号', diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java index 1d88bd23..5f2d8abe 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/mapper/SysUserMapper.java @@ -127,6 +127,12 @@ public interface SysUserMapper public List selectAllUser(); + /** + * 查找所有工程员 + * */ + public List selectSpecificRoleList(String roleKey); + + @MapKey("id") List> selectUserSelList(String userName); } diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java index bc0eb107..85acd93d 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/ISysUserService.java @@ -77,6 +77,13 @@ public interface ISysUserService */ public List selectUserRoleByUserId(Long userId); + /** + * 查找所有工程员 + * + * @return 工程员列表 + */ + public List getSpecificRoleList(String roleKey); + /** * 通过用户ID删除用户 * diff --git a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java index 786d7139..345b5230 100644 --- a/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java +++ b/ruoyi-system/src/main/java/com/ruoyi/system/service/impl/SysUserServiceImpl.java @@ -151,6 +151,17 @@ public class SysUserServiceImpl implements ISysUserService return userRoleMapper.selectUserRoleByUserId(userId); } + /** + * 查找所有工程员 + * + * @return 工程员列表 + */ + @Override + public List getSpecificRoleList(String roleKey) { + List sysUsers = userMapper.selectSpecificRoleList(roleKey); + return sysUsers; + } + /** * 通过用户ID删除用户 * diff --git a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml index 7b16c3c3..d1fdd476 100644 --- a/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml +++ b/ruoyi-system/src/main/resources/mapper/system/SysUserMapper.xml @@ -228,6 +228,14 @@ PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" + +