diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/ServiceWorkOrdersType.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/ServiceWorkOrdersType.java index 118998aa..7dd4c22c 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/ServiceWorkOrdersType.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/ServiceWorkOrdersType.java @@ -41,6 +41,10 @@ public class ServiceWorkOrdersType extends TenantEntity { * 运作模式(0派单+抢单,1派单,2自动派单) */ private String operationMode; + /** + *部门id + */ + private Long deptId; /** * 排序值 diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/ServiceWorkOrdersTypeBo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/ServiceWorkOrdersTypeBo.java index a9a15f6c..5e97ec4b 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/ServiceWorkOrdersTypeBo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/bo/ServiceWorkOrdersTypeBo.java @@ -36,7 +36,11 @@ public class ServiceWorkOrdersTypeBo extends BaseEntity { */ @NotNull(message = "工单类型名称不能为空", groups = { AddGroup.class, EditGroup.class }) private String orderTypeName; - + /** + *部门id + */ + @NotNull(message = "部门id", groups = { EditGroup.class }) + private Long deptId; /** * 运作模式 */ diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/ServiceWorkOrdersTypeVo.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/ServiceWorkOrdersTypeVo.java index 9b44e8a4..29d10cfb 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/ServiceWorkOrdersTypeVo.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/domain/vo/ServiceWorkOrdersTypeVo.java @@ -44,6 +44,10 @@ public class ServiceWorkOrdersTypeVo implements Serializable { */ @ExcelProperty(value = "工单类型名称") private String orderTypeName; + /** + *部门id + */ + private Long deptId; /** * 运作模式 diff --git a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/ServiceWorkOrdersServiceImpl.java b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/ServiceWorkOrdersServiceImpl.java index 2d4e25aa..fe199976 100644 --- a/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/ServiceWorkOrdersServiceImpl.java +++ b/ruoyi-modules/Property/src/main/java/org/dromara/property/service/impl/ServiceWorkOrdersServiceImpl.java @@ -227,7 +227,7 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService { boolean flags = workOrdersRecordMapper.insert(serviceWorkOrdersRecord) > 0; if (flags) { if (serviceWorkOrdersType.getOperationMode().equals(OrderTypeOperationEnum.AUTOMATE_DISPATCH.getValue())) { - handleServiceWorkOrder(add); + handleServiceWorkOrder(add,serviceWorkOrdersType); } } } @@ -235,7 +235,7 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService { } //自动派单 - private void handleServiceWorkOrder(ServiceWorkOrders serviceWorkOrders) { + private void handleServiceWorkOrder(ServiceWorkOrders serviceWorkOrders,ServiceWorkOrdersType serviceWorkOrdersType) { LocalDate today = LocalDate.now(); // 1. 获取今日排班人员(优先查缓存,未命中则查询数据库并缓存) List attendanceUserGroups = RedisUtils.getCacheList(DateUtil.today()); @@ -243,7 +243,7 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService { new LambdaQueryWrapper() .le(AttendanceUserGroup::getStartDate, today) .ge(AttendanceUserGroup::getEndDate, today) - //.eq(AttendanceUserGroup::getDeptId, serviceWorkOrders.getCreateDept()) + .eq(AttendanceUserGroup::getDeptId, serviceWorkOrdersType.getCreateDept()) .orderByAsc(AttendanceUserGroup::getStartDate) ); if (CollUtil.isEmpty(attendanceUserGroups)|| attendanceUserGroups.size() != attendanceUserGroupList.size()) { @@ -591,7 +591,7 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService { boolean flags = workOrdersRecordMapper.insert(serviceWorkOrdersRecord) > 0; if (flags) { if (serviceWorkOrdersType.getOperationMode().equals(OrderTypeOperationEnum.AUTOMATE_DISPATCH.getValue())) { - handleServiceWorkOrder(add); + handleServiceWorkOrder(add,serviceWorkOrdersType); } } }