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" + +