diff --git a/src/main/java/com/glxp/api/controller/auth/DeptUserController.java b/src/main/java/com/glxp/api/controller/auth/DeptUserController.java index 49a7d7882..a5eacf25f 100644 --- a/src/main/java/com/glxp/api/controller/auth/DeptUserController.java +++ b/src/main/java/com/glxp/api/controller/auth/DeptUserController.java @@ -57,6 +57,25 @@ public class DeptUserController { return ResultVOUtils.success(deptEntityPageSimpleResponse); } + @AuthRuleAnnotation("") + @GetMapping("udi/auth/dept/user/list") + public BaseResponse filterListByDeptCode(FilterDeptUserReqeust filterDeptUserReqeust) { + //获取部门id + String idByCode = filterDeptUserReqeust.getDeptCode(); + DeptEntity deptEntity = deptService.selectByCode(idByCode); + if (deptEntity.getLevel() == 1) { + filterDeptUserReqeust.setDeptId(null); + } else { + filterDeptUserReqeust.setDeptId(deptEntity.getId()); + } + List deptEntityList = deptUserService.selectJoinDeptUser(filterDeptUserReqeust); + PageInfo pageInfo = new PageInfo<>(deptEntityList); + PageSimpleResponse deptEntityPageSimpleResponse = new PageSimpleResponse<>(); + deptEntityPageSimpleResponse.setTotal(pageInfo.getTotal()); + deptEntityPageSimpleResponse.setList(deptEntityList); + return ResultVOUtils.success(deptEntityPageSimpleResponse); + } + @AuthRuleAnnotation("") @PostMapping("udi/auth/dept/user/delete") diff --git a/src/main/java/com/glxp/api/entity/auth/DeptEntity.java b/src/main/java/com/glxp/api/entity/auth/DeptEntity.java index ef180b7ea..1bab96c27 100644 --- a/src/main/java/com/glxp/api/entity/auth/DeptEntity.java +++ b/src/main/java/com/glxp/api/entity/auth/DeptEntity.java @@ -33,5 +33,6 @@ public class DeptEntity { private String thirdId4; private boolean spUse; + private boolean maintenance; } diff --git a/src/main/java/com/glxp/api/entity/dev/DeviceRepairEntity.java b/src/main/java/com/glxp/api/entity/dev/DeviceRepairEntity.java index 4fea05804..ef5feb4c4 100644 --- a/src/main/java/com/glxp/api/entity/dev/DeviceRepairEntity.java +++ b/src/main/java/com/glxp/api/entity/dev/DeviceRepairEntity.java @@ -73,6 +73,11 @@ public class DeviceRepairEntity { */ @TableField(value = "repairUserName") private String repairUserName; + /** + * 维修部门 + */ + @TableField(value = "repairDeptCode") + private String repairDeptCode; /** * 维修人联系方式 @@ -247,4 +252,4 @@ public class DeviceRepairEntity { */ @TableField(value = "confirmRemark") private String confirmRemark; -} \ No newline at end of file +} diff --git a/src/main/java/com/glxp/api/req/auth/FilterDeptUserReqeust.java b/src/main/java/com/glxp/api/req/auth/FilterDeptUserReqeust.java index 163b74e6d..f41a3b42d 100644 --- a/src/main/java/com/glxp/api/req/auth/FilterDeptUserReqeust.java +++ b/src/main/java/com/glxp/api/req/auth/FilterDeptUserReqeust.java @@ -8,5 +8,6 @@ public class FilterDeptUserReqeust extends ListPageRequest { private Long deptId; private Long userId; private String deptName; + private String deptCode; private String key; } diff --git a/src/main/java/com/glxp/api/req/auth/FilterInvWarehouseRequest.java b/src/main/java/com/glxp/api/req/auth/FilterInvWarehouseRequest.java index 59d24541b..c6bdc8cda 100644 --- a/src/main/java/com/glxp/api/req/auth/FilterInvWarehouseRequest.java +++ b/src/main/java/com/glxp/api/req/auth/FilterInvWarehouseRequest.java @@ -33,4 +33,5 @@ public class FilterInvWarehouseRequest extends ListPageRequest { private String subordinateCode;//下级 private String superiorPcode;//上级 private Integer type; + private Boolean maintenance; } diff --git a/src/main/java/com/glxp/api/req/dev/DeviceInfoDetailQuery.java b/src/main/java/com/glxp/api/req/dev/DeviceInfoDetailQuery.java index 007ccdd7f..202618519 100644 --- a/src/main/java/com/glxp/api/req/dev/DeviceInfoDetailQuery.java +++ b/src/main/java/com/glxp/api/req/dev/DeviceInfoDetailQuery.java @@ -14,7 +14,7 @@ public class DeviceInfoDetailQuery extends ListPageRequest { @NotNull(message = "缺少必要参数") private DeviceStatusEnum status; - @NotNull(message = "缺少必要参数") +// @NotNull(message = "缺少必要参数") private Boolean checkLock; /** @@ -26,7 +26,7 @@ public class DeviceInfoDetailQuery extends ListPageRequest { /** * 设备id */ - @NotNull(message = "缺少必要参数") +// @NotNull(message = "缺少必要参数") private Long productId; /** diff --git a/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyDetailDiagnosisParam.java b/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyDetailDiagnosisParam.java index e86d438e1..e7928a228 100644 --- a/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyDetailDiagnosisParam.java +++ b/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyDetailDiagnosisParam.java @@ -26,6 +26,8 @@ public class DeviceRepairApplyDetailDiagnosisParam { String repairUserName; + String repairDeptCode; + String repairUserPhone; public void valid() { @@ -33,6 +35,9 @@ public class DeviceRepairApplyDetailDiagnosisParam { if (innerFlag == null) { throw new JsonException("请选择维修方式"); } + if (StrUtil.isBlank(repairDeptCode)) { + throw new JsonException("维修部门不能为空"); + } if (StrUtil.isBlank(repairUserName)) { throw new JsonException("维修人姓名不能为空"); } @@ -43,6 +48,7 @@ public class DeviceRepairApplyDetailDiagnosisParam { innerFlag = null; repairUserName = null; repairUserPhone = null; + repairDeptCode = null; } } diff --git a/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyQuery.java b/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyQuery.java index 80aeec994..9e3d81ae5 100644 --- a/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyQuery.java +++ b/src/main/java/com/glxp/api/req/dev/DeviceRepairApplyQuery.java @@ -24,4 +24,13 @@ public class DeviceRepairApplyQuery extends ListPageRequest { */ Long confirmUserId; + /** + * 受理信息 + */ + String acceptInfo; + /** + * 报修信息 + */ + String repairInfo; + } diff --git a/src/main/java/com/glxp/api/res/auth/InvSubWarehouseResponse.java b/src/main/java/com/glxp/api/res/auth/InvSubWarehouseResponse.java index d1e4f314f..44bc17e59 100644 --- a/src/main/java/com/glxp/api/res/auth/InvSubWarehouseResponse.java +++ b/src/main/java/com/glxp/api/res/auth/InvSubWarehouseResponse.java @@ -26,4 +26,5 @@ public class InvSubWarehouseResponse { private Boolean lyInvType; private Boolean sgInvType; + private Boolean maintenance; } diff --git a/src/main/java/com/glxp/api/service/dev/impl/DeviceRepairApplyDetailServiceImpl.java b/src/main/java/com/glxp/api/service/dev/impl/DeviceRepairApplyDetailServiceImpl.java index 4e7c3eedd..204783339 100644 --- a/src/main/java/com/glxp/api/service/dev/impl/DeviceRepairApplyDetailServiceImpl.java +++ b/src/main/java/com/glxp/api/service/dev/impl/DeviceRepairApplyDetailServiceImpl.java @@ -87,7 +87,7 @@ public class DeviceRepairApplyDetailServiceImpl extends ServiceImpl pageList(DeviceRepairApplyQuery query) { + String acceptInfo = query.getAcceptInfo(); + String repairInfo = query.getRepairInfo(); if (query.getPage() != null) { PageHelper.startPage(query.getPage(), query.getLimit()); } - List list = super.list(Wrappers.lambdaQuery(DeviceRepairApplyEntity.class) - .eq(query.getApplyId() != null, DeviceRepairApplyEntity::getId, query.getApplyId()) + LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(DeviceRepairApplyEntity.class); + wrapper.eq(query.getApplyId() != null, DeviceRepairApplyEntity::getId, query.getApplyId()) .eq(query.getStatus() != null, DeviceRepairApplyEntity::getStatus, query.getStatus()) .eq(query.getConfirmUserId() != null, DeviceRepairApplyEntity::getConfirmUserId, query.getConfirmUserId()) .eq(StrUtil.isNotBlank(query.getApplyDeptCode()), DeviceRepairApplyEntity::getApplyDeptCode, query.getApplyDeptCode()) - .orderByDesc(DeviceRepairApplyEntity::getStatus, DeviceRepairApplyEntity::getApplyTime) - ); + .orderByDesc(DeviceRepairApplyEntity::getStatus, DeviceRepairApplyEntity::getApplyTime); + if (StringUtils.isNotBlank(acceptInfo)){ + wrapper.and(warpper->warpper.like(DeviceRepairApplyEntity::getConfirmDeptCode, acceptInfo) + .or() + .like(DeviceRepairApplyEntity::getConfirmDeptName, acceptInfo) + .or() + .like(DeviceRepairApplyEntity::getConfirmUserId, acceptInfo) + .or() + .like(DeviceRepairApplyEntity::getConfirmUserName, acceptInfo) + .or() + .like(DeviceRepairApplyEntity::getConfirmPhone, acceptInfo)); + } + if (StringUtils.isNotBlank(repairInfo)){ + wrapper.and(warpper->warpper.like(DeviceRepairApplyEntity::getApplyDeptCode, repairInfo) + .or() + .like(DeviceRepairApplyEntity::getApplyDeptName, repairInfo) + .or() + .like(DeviceRepairApplyEntity::getApplyUserId, repairInfo) + .or() + .like(DeviceRepairApplyEntity::getApplyUserName, repairInfo) + .or() + .like(DeviceRepairApplyEntity::getApplyUserPhone, repairInfo) + .or() + .like(DeviceRepairApplyEntity::getId, repairInfo)); + } + + List list = super.list(wrapper); return list; } diff --git a/src/main/resources/mybatis/mapper/auth/DeptDao.xml b/src/main/resources/mybatis/mapper/auth/DeptDao.xml index d9c175d16..dfdf4751d 100644 --- a/src/main/resources/mybatis/mapper/auth/DeptDao.xml +++ b/src/main/resources/mybatis/mapper/auth/DeptDao.xml @@ -38,6 +38,9 @@ AND a.spUse = #{spUse} + + AND a.maintenance = #{maintenance} + @@ -197,7 +200,7 @@ replace INTO auth_dept (id,pid, code, `name`, advanceType, isDefault, - status, updateTime, remark,`level`,pcode,spUse, thirdId, thirdId1, thirdId2, thirdId3, thirdId4) + status, updateTime, remark,`level`,pcode,spUse, thirdId, thirdId1, thirdId2, thirdId3, thirdId4,maintenance) values ( #{id}, #{pid}, @@ -215,7 +218,8 @@ #{thirdId1}, #{thirdId2}, #{thirdId3}, - #{thirdId4} + #{thirdId4}, + #{maintenance} ) @@ -245,6 +249,7 @@ remark=#{thirdId3}, remark=#{thirdId4}, spUse=#{spUse}, + maintenance=#{maintenance}, diff --git a/src/main/resources/schemas/schema_v2.4.sql b/src/main/resources/schemas/schema_v2.4.sql index 9655a8976..f05419a5d 100644 --- a/src/main/resources/schemas/schema_v2.4.sql +++ b/src/main/resources/schemas/schema_v2.4.sql @@ -2462,6 +2462,20 @@ CALL Pro_Temp_ColumnWork('device_info', 'assetReserveType', CALL Pro_Temp_ColumnWork('device_plan', 'status', 'tinyint NULL DEFAULT NULL COMMENT ''设备巡检计划状态 :1:草稿;2.已提交''', 1); +INSERT ignore INTO auth_menu(`menu_id`, `menu_name`, `parent_id`, `order_num`, `path`, `component`, `query_param`, `is_frame`, `is_cache`, `menu_type`, + `visible`, `status`, `perms`, `icon`, `create_by`, `create_time`, `update_by`, `update_time`, `remark`) + VALUES (2094, '我的报修单', 1703, 11, '/dev/deviceRepairApplyMy', 'dev/deviceRepairApplyMy', + NULL, 1, 0, 'C', '0', '0', NULL, NULL, '超级用户', '2023-11-29 18:00:49', NULL, NULL, NULL); + + +CALL Pro_Temp_ColumnWork('auth_dept', 'maintenance', + ' tinyint(0) ZEROFILL NULL COMMENT''是否为维修部门''', + 1); + +CALL Pro_Temp_ColumnWork('device_repair', 'repairDeptCode', + 'varchar(100) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL COMMENT''维修部门''', + 1); + CALL Pro_Temp_ColumnWork('device_check_detail', 'normalFlag', 'tinyint NULL DEFAULT NULL COMMENT ''巡检状态 :0:异常;1.正常''', 1);