Browse Source

Merge remote-tracking branch 'origin/master' into master

laoyao 3 năm trước cách đây
mục cha
commit
9916da0704

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

+ 2 - 1
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/classSchedule/dao/ScheduleUserChangeMapper.java

@@ -6,6 +6,7 @@ import com.baomidou.mybatisplus.core.toolkit.Constants;
 import com.github.zuihou.base.mapper.SuperMapper;
 import com.github.zuihou.business.classSchedule.entity.ScheduleUserChange;
 
+import com.github.zuihou.database.mybatis.auth.DataScope;
 import org.apache.ibatis.annotations.Param;
 import org.springframework.stereotype.Repository;
 
@@ -24,5 +25,5 @@ public interface ScheduleUserChangeMapper extends SuperMapper<ScheduleUserChange
     /**
      * 分页
      */
-    IPage<ScheduleUserChange> pageList(IPage page, @Param(Constants.WRAPPER) Wrapper<ScheduleUserChange> queryWrapper);
+    IPage<ScheduleUserChange> pageList(IPage page, @Param(Constants.WRAPPER) Wrapper<ScheduleUserChange> queryWrapper, DataScope dataScope);
 }

+ 2 - 1
imcs-admin-boot/imcs-business-biz/src/main/java/com/github/zuihou/business/classSchedule/service/impl/ScheduleUserChangeServiceImpl.java

@@ -17,6 +17,7 @@ import com.github.zuihou.business.classSchedule.service.ScheduleUserChangeServic
 import com.github.zuihou.base.service.SuperServiceImpl;
 
 import com.github.zuihou.business.classSchedule.service.ScheduleUserDateService;
+import com.github.zuihou.database.mybatis.auth.DataScope;
 import com.github.zuihou.database.mybatis.conditions.Wraps;
 import com.github.zuihou.database.mybatis.conditions.query.LbqWrapper;
 import com.github.zuihou.injection.annonation.InjectionResult;
@@ -61,7 +62,7 @@ public class ScheduleUserChangeServiceImpl extends SuperServiceImpl<ScheduleUser
     // 启用属性自动注入
     @InjectionResult
     public IPage<ScheduleUserChange> pageList(IPage page, LbqWrapper<ScheduleUserChange> wrapper) {
-        return baseMapper.pageList(page, wrapper);
+        return baseMapper.pageList(page, wrapper, new DataScope());
     }
 
     @Override

+ 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;
@@ -337,6 +335,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");
                     //查出工序三坐标相关

+ 30 - 0
imcs-admin-boot/imcs-business-controller/src/main/java/com/github/zuihou/business/controller/classSchedule/ScheduleMonthController.java

@@ -1,5 +1,12 @@
 package com.github.zuihou.business.controller.classSchedule;
 
+import cn.hutool.core.bean.BeanUtil;
+import cn.hutool.core.collection.CollectionUtil;
+import com.baomidou.mybatisplus.core.metadata.IPage;
+import com.github.zuihou.authority.dto.auth.UserPageDTO;
+import com.github.zuihou.authority.entity.auth.User;
+import com.github.zuihou.authority.service.auth.UserService;
+import com.github.zuihou.base.request.PageParams;
 import com.github.zuihou.business.classSchedule.entity.ScheduleMonth;
 import com.github.zuihou.business.classSchedule.dto.ScheduleMonthSaveDTO;
 import com.github.zuihou.business.classSchedule.dto.ScheduleMonthUpdateDTO;
@@ -10,9 +17,13 @@ import java.util.Map;
 import java.util.stream.Collectors;
 import com.github.zuihou.base.controller.SuperController;
 import com.github.zuihou.base.R;
+import com.github.zuihou.context.BaseContextHandler;
+import com.github.zuihou.database.mybatis.conditions.query.QueryWrap;
 import io.swagger.annotations.Api;
 import io.swagger.annotations.ApiOperation;
 import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.compress.utils.Lists;
+import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.validation.annotation.Validated;
 import org.springframework.web.bind.annotation.PostMapping;
 import org.springframework.web.bind.annotation.RequestBody;
@@ -38,6 +49,9 @@ import org.springframework.web.bind.annotation.RestController;
 //@PreAuth(replace = "scheduleMonth:")
 public class ScheduleMonthController extends SuperController<ScheduleMonthService, Long, ScheduleMonth, ScheduleMonthPageDTO, ScheduleMonthSaveDTO, ScheduleMonthUpdateDTO> {
 
+    @Autowired
+    private UserService userService;
+
     /**
      * 添加
      * @param scheduleMonthSaveDTO
@@ -49,6 +63,22 @@ public class ScheduleMonthController extends SuperController<ScheduleMonthServic
         return success(scheduleMonth);
     }
 
+    @Override
+    public void query(PageParams<ScheduleMonthPageDTO> params, IPage<ScheduleMonth> page, Long defSize) {
+        ScheduleMonth model = BeanUtil.toBean(params.getModel(),ScheduleMonth.class);
+        QueryWrap<ScheduleMonth> wrapper = this.handlerWrapper(model, params);
+        BaseContextHandler.setTenant("0000");
+        Long userId = BaseContextHandler.getUserId();
+        Map<String, Object> orgMap = userService.getDataScopeById(userId);
+        List<Long> orgIds = orgMap.containsKey("orgIds")? (List)orgMap.get("orgIds") : Lists.newArrayList();
+        if(CollectionUtil.isNotEmpty(orgIds)){
+            wrapper.in("org_id", orgIds);
+        }
+        baseService.page(page, wrapper);
+    }
+
+
+
     @ApiOperation(value = "修改排班月份", notes = "修改排班月份")
     @PostMapping("/update")
     public R<ScheduleMonth> update(ScheduleMonthUpdateDTO model) {

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