浏览代码

前端查询过滤系统管理员角色和账号

oyq28 3 年之前
父节点
当前提交
61ac8f9d92

+ 9 - 0
imcs-admin-boot/imcs-authority-controller/src/main/java/com/github/zuihou/authority/controller/auth/RoleController.java

@@ -1,5 +1,6 @@
 package com.github.zuihou.authority.controller.auth;
 
+import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.github.zuihou.authority.dto.auth.*;
 import com.github.zuihou.authority.entity.auth.Role;
 import com.github.zuihou.authority.entity.auth.RoleAuthority;
@@ -11,6 +12,9 @@ import com.github.zuihou.authority.service.auth.RoleService;
 import com.github.zuihou.authority.service.auth.UserRoleService;
 import com.github.zuihou.base.R;
 import com.github.zuihou.base.controller.SuperCacheController;
+import com.github.zuihou.base.request.PageParams;
+import com.github.zuihou.business.classSchedule.dto.AuthUserPageDTO;
+import com.github.zuihou.business.classSchedule.entity.AuthUser;
 import com.github.zuihou.database.mybatis.auth.DataScopeType;
 import com.github.zuihou.database.mybatis.conditions.Wraps;
 import com.github.zuihou.log.annotation.SysLog;
@@ -50,6 +54,11 @@ public class RoleController extends SuperCacheController<RoleService, Long, Role
     @Autowired
     private UserRoleService userRoleService;
 
+    @Override
+    public void handlerQueryParams(PageParams<RolePageDTO> params){
+        params.getModel().setReadonly(false);
+    }
+
 
     /**
      * 查询角色

+ 2 - 8
imcs-admin-boot/imcs-authority-controller/src/main/java/com/github/zuihou/authority/controller/auth/UserController.java

@@ -9,14 +9,7 @@ import cn.hutool.core.util.StrUtil;
 import com.alibaba.fastjson.JSONObject;
 import com.baomidou.mybatisplus.core.metadata.IPage;
 import com.github.zuihou.authority.controller.poi.ExcelUserVerifyHandlerImpl;
-import com.github.zuihou.authority.dto.auth.UserExcelVO;
-import com.github.zuihou.authority.dto.auth.UserPageDTO;
-import com.github.zuihou.authority.dto.auth.UserRoleDTO;
-import com.github.zuihou.authority.dto.auth.UserSaveDTO;
-import com.github.zuihou.authority.dto.auth.UserUpdateAvatarDTO;
-import com.github.zuihou.authority.dto.auth.UserUpdateBaseInfoDTO;
-import com.github.zuihou.authority.dto.auth.UserUpdateDTO;
-import com.github.zuihou.authority.dto.auth.UserUpdatePasswordDTO;
+import com.github.zuihou.authority.dto.auth.*;
 import com.github.zuihou.authority.entity.auth.User;
 import com.github.zuihou.authority.entity.core.Org;
 import com.github.zuihou.authority.service.auth.UserService;
@@ -397,6 +390,7 @@ public class UserController extends SuperCacheController<UserService, Long, User
                 .eq(User::getEducation, userPage.getEducation())
                 .eq(userPage.getNation() != null && StrUtil.isNotEmpty(userPage.getNation().getKey()), User::getNation, userPage.getNation())
                 .eq(User::getSex, userPage.getSex())
+                .eq(User::getReadonly, false)
                 .eq(User::getStatus, userPage.getStatus());
         baseService.findPage(page, wrapper);
     }

+ 8 - 0
imcs-admin-boot/imcs-authority-entity/src/main/java/com/github/zuihou/authority/dto/auth/UserPageDTO.java

@@ -93,6 +93,14 @@ public class UserPageDTO implements Serializable {
     @ApiModelProperty(value = "手机")
     @Length(max = 20, message = "手机长度不能超过20")
     private String mobile;
+
+    /**
+     * 是否内置用户
+     */
+    @ApiModelProperty(value = "是否内置用户")
+    private Boolean readonly;
+
+
     /**
      * 性别
      * #Sex{W:女;M:男;N:未知}

+ 10 - 1
imcs-admin-boot/imcs-authority-entity/src/main/java/com/github/zuihou/authority/entity/auth/User.java

@@ -137,6 +137,14 @@ public class User extends Entity<Long> {
     @Excel(name = "状态", replace = {"启用_true", "禁用_false", "_null"})
     private Boolean status;
 
+    /**
+     * 是否内置用户
+     */
+    @ApiModelProperty(value = "是否内置用户")
+    @TableField("readonly")
+    @Excel(name = "是否内置用户", replace = {"是_true", "否_false", "_null"})
+    private Boolean readonly;
+
     /**
      * 头像
      */
@@ -238,7 +246,7 @@ public class User extends Entity<Long> {
     @Builder
     public User(Long id, Long createUser, LocalDateTime createTime, Long updateUser, LocalDateTime updateTime,
                 String account, String name, RemoteData<Long, Org> orgId, RemoteData<Long, String> stationId, String email,
-                String mobile, Sex sex, Boolean status, String avatar, RemoteData<String, String> nation, RemoteData<String, String> education,
+                String mobile, Sex sex, Boolean status, String avatar, Boolean readonly, RemoteData<String, String> nation, RemoteData<String, String> education,
                 RemoteData<String, String> positionStatus, String workDescribe, LocalDateTime passwordErrorLastTime, Integer passwordErrorNum, LocalDateTime passwordExpireTime, String password, LocalDateTime lastLoginTime) {
         this.id = id;
         this.createUser = createUser;
@@ -252,6 +260,7 @@ public class User extends Entity<Long> {
         this.email = email;
         this.mobile = mobile;
         this.sex = sex;
+        this.readonly = readonly;
         this.status = status;
         this.avatar = avatar;
         this.nation = nation;

+ 26 - 26
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/mq/TaskWorkNode.java

@@ -38,6 +38,7 @@ import com.github.zuihou.common.constant.BizConstant;
 import com.github.zuihou.common.constant.CacheKey;
 import com.github.zuihou.common.constant.DictionaryKey;
 import com.github.zuihou.common.constant.UrlConfConstant;
+import com.github.zuihou.common.enums.HandModeTypeEnum;
 import com.github.zuihou.common.util.StringUtil;
 import com.github.zuihou.context.BaseContextHandler;
 import com.github.zuihou.database.mybatis.conditions.Wraps;
@@ -266,26 +267,16 @@ public class TaskWorkNode {
      */
     public String getInterfaceUrl(TaskNode taskNode) {
         String autoProgrameUrl = "";
-//        if (DictionaryKey.INTERFACETYPE_PLC.equals(taskNode.getInterfaceType())) {//总控
-//            autoProgrameUrl = UrlConfConstant.plcURL;
-//        } else if (DictionaryKey.INTERFACETYPE_PRO.equals(taskNode.getInterfaceType())) {
-////            autoProgrameUrl = parameterService.getValue(ParameterKey.AUTOPROGRAMEURL, null);
-//            autoProgrameUrl = UrlConfConstant.plcURL;
-//        } else if (DictionaryKey.INTERFACETYPE_AGV.equals(taskNode.getInterfaceType())) {
-////            autoProgrameUrl = parameterService.getValue(ParameterKey.AGVPROGRAMEURL, null);
-//            autoProgrameUrl = UrlConfConstant.agvURL;
-//        } else if (DictionaryKey.INTERFACETYPE_WMS.equals(taskNode.getInterfaceType())) {
-////            autoProgrameUrl = parameterService.getValue(ParameterKey.AGVPROGRAMEURL, null);
-//            // autoProgrameUrl = agvURL;
-//            autoProgrameUrl = UrlConfConstant.url;
-//        }
-        //根据设备类型关联接口
-        if("1".equals(taskNode.getAutoNode().getCategory()) || "3".equals(taskNode.getAutoNode().getCategory())){
+        if (DictionaryKey.INTERFACETYPE_PLC.equals(taskNode.getInterfaceType())) {//总控
+            autoProgrameUrl = UrlConfConstant.plcURL;
+        } else if (DictionaryKey.INTERFACETYPE_PRO.equals(taskNode.getInterfaceType())) {
+            //autoProgrameUrl = parameterService.getValue(ParameterKey.AUTOPROGRAMEURL, null);
             autoProgrameUrl = UrlConfConstant.plcURL;
-        }else if("2".equals(taskNode.getAutoNode().getCategory())){
+        } else if (DictionaryKey.INTERFACETYPE_AGV.equals(taskNode.getInterfaceType())) {
+            //autoProgrameUrl = parameterService.getValue(ParameterKey.AGVPROGRAMEURL, null);
             autoProgrameUrl = UrlConfConstant.agvURL;
-        }else if("4".equals(taskNode.getAutoNode().getCategory())){
-            //目前默认是wms
+        } else if (DictionaryKey.INTERFACETYPE_WMS.equals(taskNode.getInterfaceType())) {
+            // autoProgrameUrl = parameterService.getValue(ParameterKey.AGVPROGRAMEURL, null);
             autoProgrameUrl = UrlConfConstant.url;
         }
         //正式调试的时候注释掉
@@ -319,15 +310,28 @@ public class TaskWorkNode {
         //jsonObject.put("businessType", taskNode.getAutoNodeCode());
         jsonObject.put("taskId", taskNode.getTaskId());
         jsonObject.put("taskNodeId", taskNode.getId());
-        jsonObject.put("uid", taskNode.getId() + "");
+        jsonObject.put("uid", taskNode.getCreateUser() + "");
+        //jsonParam.put("url",deviceUrl);
+        //jsonParam.put("port",devicePort);
+        jsonObject.put("url", taskNode.getTaskId());
+        jsonObject.put("port", taskNode.getTaskId());
+
         //业务回调数据
         JSONObject bizJsonObject = new JSONObject();
         if (StringUtil.isNotEmpty(stockType)) {
+            //设定出入库类型
             bizJsonObject.put(DemoLineConstant.DEMOLINE_STOCK_TYPE, stockType);
         }
 
         //机器上下料相关
         if (DictionaryKey.INTERFACETYPE_PLC.equals(taskNode.getInterfaceType())) {
+            //String location = conMap.get("location").toString();
+            nodeOperationService = new RobotNodeServiceImpl();
+            Map map = nodeOperationService.operation(jsonObject, bizJsonObject, conMap);
+            jsonObject = (JSONObject) map.get("jsonObject");
+            bizJsonObject = (JSONObject) map.get("bizJsonObject");
+
+            /*
             String zoneNo = msgUtil.redis_get(DemoCacheKey.DEMOLINE_WORKOP_ZONE + task.getCompleteBatchNo()) == null ? ""
                     : msgUtil.redis_get(DemoCacheKey.DEMOLINE_WORKOP_ZONE + task.getCompleteBatchNo()).toString();
             //总控IP
@@ -335,10 +339,7 @@ public class TaskWorkNode {
             jsonObject.put("url", zkIp);
             jsonObject.put("port", ZK_port);
             jsonObject.put("IsCallBackFlag", "1");
-//            if (bizType.equals(BizConstant.MQ_TASK_NODE_TYPE_COMMON) ||//线边库轮询搬运
-//                    DemoLineConstant.DEMOLINE_OP01_03.equals(taskNode.getNodeNo()) || DemoLineConstant.DEMOLINE_OP01_04.equals(taskNode.getNodeNo())//机器人放子盘夹具到上下料站(从子盘到机械手)//机器人放子盘夹具到上下料站(从机械手到上下料站)
-//                    || DemoLineConstant.DEMOLINE_OP01_06.equals(taskNode.getNodeNo()) || DemoLineConstant.DEMOLINE_OP01_07.equals(taskNode.getNodeNo())
-//                    || DemoLineConstant.DEMOLINE_OP02_01.equals(taskNode.getNodeNo())|| DemoLineConstant.DEMOLINE_OP02_02.equals(taskNode.getNodeNo())) {//上料
+
             Storge fstorge = (Storge) conMap.get("fromStorge");
             Storge tstorge = (Storge) conMap.get("toStorge");
             //线边库标志
@@ -397,12 +398,12 @@ public class TaskWorkNode {
                 bizJsonObject.put(DemoLineConstant.DEMOLINE_XBKFLAG, xbkFlag);
                 bizJsonObject.put(DemoLineConstant.DEMOLINE_XBK_TYPE, xbkType);
                 bizJsonObject.put(DemoLineConstant.DEMOLINE_XBK_CARRY_TYPE, carryType);
-            }
+            } */
+
         }
         else if (DictionaryKey.INTERFACETYPE_PRO.equals(taskNode.getInterfaceType())) {
             //生产加工
             nodeOperationService = new MachineNodeServiceImpl();
-            conMap.put("NO_WMS", true);
             Map map = nodeOperationService.operation(jsonObject, bizJsonObject, conMap);
             jsonObject = (JSONObject) map.get("jsonObject");
             bizJsonObject = (JSONObject) map.get("bizJsonObject");
@@ -769,6 +770,5 @@ public class TaskWorkNode {
         }
         return map;
     }
-
 }
 

+ 9 - 3
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/operationManagementCenter/service/impl/TaskNodeServiceImpl.java

@@ -37,9 +37,7 @@ import com.github.zuihou.business.productionResourceCenter.service.ZZoneService;
 import com.github.zuihou.business.util.DynamicRabbitMq;
 import com.github.zuihou.business.util.ManualTaskOperatorUtil;
 import com.github.zuihou.business.util.MsgUtil;
-import com.github.zuihou.common.constant.BizConstant;
-import com.github.zuihou.common.constant.CacheKey;
-import com.github.zuihou.common.constant.CodeRuleModule;
+import com.github.zuihou.common.constant.*;
 import com.github.zuihou.common.util.StringUtil;
 import com.github.zuihou.context.BaseContextHandler;
 import com.github.zuihou.database.mybatis.conditions.Wraps;
@@ -331,6 +329,14 @@ public class TaskNodeServiceImpl extends SuperServiceImpl<TaskNodeMapper, TaskNo
 //                    if (autoNode.getInterfaceType() != null) {
 //                        taskNode.setInterfaceType(autoNode.getInterfaceType().getKey());
 //                    }
+                        //依据设备类型判断调用接口类型
+                        if("1".equals(taskNode.getAutoNode().getCategory()) || "3".equals(taskNode.getAutoNode().getCategory())){
+                            taskNode.setInterfaceType(DictionaryKey.INTERFACETYPE_PLC);
+                        }else if("2".equals(taskNode.getAutoNode().getCategory())){
+                            taskNode.setInterfaceType(DictionaryKey.INTERFACETYPE_AGV);
+                        }else if("4".equals(taskNode.getAutoNode().getCategory())){
+                            taskNode.setInterfaceType(DictionaryKey.INTERFACETYPE_WMS);
+                        }
                         taskNode.setCompleteBatchSort(i);
                         taskNodeList.add(taskNode);
                         i++;

+ 3 - 3
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/productionResourceCenter/service/impl/MachineNodeServiceImpl.java

@@ -253,7 +253,7 @@ public class MachineNodeServiceImpl implements NodeOperationService {
                 break;
 
             case "打标机":
-                if("DBJ_PRINT".equals(functionName)){
+                if("print".equals(functionName)){
                     //打标
                     map.put("zkIp", ZK_ip_rxx);
                     map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "print");
@@ -353,7 +353,7 @@ public class MachineNodeServiceImpl implements NodeOperationService {
 
                 break;
             case "清洗烘干机":
-                if ("RX_CLEAN".equals(functionName)) {
+                if ("clean".equals(functionName)) {
                     //清洗,PLC接口
                     map.put("zkIp", ZK_ip_rxx);
                     map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "Clean");
@@ -361,7 +361,7 @@ public class MachineNodeServiceImpl implements NodeOperationService {
                 }
                 break;
             case "三坐标检测仪":
-                if ("SZB_CHECK".equals(functionName)) {
+                if ("measuring".equals(functionName)) {
                     map.put("zkIp", ZK_ip_zlzx);
                     map.put(DemoLineConstant.DEMOLINE_BIZ_TYPE, "testwork");
                     //查出工序三坐标相关

+ 12 - 0
imcs-admin-boot/imcs-business-entity/pom.xml

@@ -37,6 +37,18 @@
             <groupId>com.github.zuihou</groupId>
             <artifactId>zuihou-injection-starter</artifactId>
         </dependency>
+        <dependency>
+            <groupId>com.github.zuihou</groupId>
+            <artifactId>imcs-authority-entity</artifactId>
+            <version>b.2.5-SNAPSHOT</version>
+            <scope>compile</scope>
+        </dependency>
+        <dependency>
+            <groupId>com.github.zuihou</groupId>
+            <artifactId>imcs-authority-entity</artifactId>
+            <version>b.2.5-SNAPSHOT</version>
+            <scope>compile</scope>
+        </dependency>
     </dependencies>