Merge pull request 'master' (#4) from master into prod
All checks were successful
Build and Push to Target Registry / 构建并推送镜像到目标仓库 (push) Successful in 18m10s

Reviewed-on: #4
This commit is contained in:
2025-08-29 23:30:39 +08:00
5 changed files with 43 additions and 7 deletions

View File

@@ -41,6 +41,10 @@ public class ServiceWorkOrdersType extends TenantEntity {
* 运作模式(0派单+抢单,1派单,2自动派单) * 运作模式(0派单+抢单,1派单,2自动派单)
*/ */
private String operationMode; private String operationMode;
/**
*部门id
*/
private Long deptId;
/** /**
* 排序值 * 排序值

View File

@@ -36,7 +36,11 @@ public class ServiceWorkOrdersTypeBo extends BaseEntity {
*/ */
@NotNull(message = "工单类型名称不能为空", groups = { AddGroup.class, EditGroup.class }) @NotNull(message = "工单类型名称不能为空", groups = { AddGroup.class, EditGroup.class })
private String orderTypeName; private String orderTypeName;
/**
*部门id
*/
@NotNull(message = "部门id", groups = { EditGroup.class })
private Long deptId;
/** /**
* 运作模式 * 运作模式
*/ */

View File

@@ -44,6 +44,14 @@ public class ServiceWorkOrdersTypeVo implements Serializable {
*/ */
@ExcelProperty(value = "工单类型名称") @ExcelProperty(value = "工单类型名称")
private String orderTypeName; private String orderTypeName;
/**
*部门id
*/
private Long deptId;
/**
*部门名称
*/
private String deptName;
/** /**
* 运作模式 * 运作模式

View File

@@ -227,7 +227,7 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService {
boolean flags = workOrdersRecordMapper.insert(serviceWorkOrdersRecord) > 0; boolean flags = workOrdersRecordMapper.insert(serviceWorkOrdersRecord) > 0;
if (flags) { if (flags) {
if (serviceWorkOrdersType.getOperationMode().equals(OrderTypeOperationEnum.AUTOMATE_DISPATCH.getValue())) { 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(); LocalDate today = LocalDate.now();
// 1. 获取今日排班人员(优先查缓存,未命中则查询数据库并缓存) // 1. 获取今日排班人员(优先查缓存,未命中则查询数据库并缓存)
List<AttendanceUserGroup> attendanceUserGroups = RedisUtils.getCacheList(DateUtil.today()); List<AttendanceUserGroup> attendanceUserGroups = RedisUtils.getCacheList(DateUtil.today());
@@ -243,7 +243,7 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService {
new LambdaQueryWrapper<AttendanceUserGroup>() new LambdaQueryWrapper<AttendanceUserGroup>()
.le(AttendanceUserGroup::getStartDate, today) .le(AttendanceUserGroup::getStartDate, today)
.ge(AttendanceUserGroup::getEndDate, today) .ge(AttendanceUserGroup::getEndDate, today)
.eq(AttendanceUserGroup::getDeptId, serviceWorkOrders.getCreateDept()) .eq(AttendanceUserGroup::getDeptId, serviceWorkOrdersType.getCreateDept())
.orderByAsc(AttendanceUserGroup::getStartDate) .orderByAsc(AttendanceUserGroup::getStartDate)
); );
if (CollUtil.isEmpty(attendanceUserGroups)|| attendanceUserGroups.size() != attendanceUserGroupList.size()) { if (CollUtil.isEmpty(attendanceUserGroups)|| attendanceUserGroups.size() != attendanceUserGroupList.size()) {
@@ -591,7 +591,7 @@ public class ServiceWorkOrdersServiceImpl implements IServiceWorkOrdersService {
boolean flags = workOrdersRecordMapper.insert(serviceWorkOrdersRecord) > 0; boolean flags = workOrdersRecordMapper.insert(serviceWorkOrdersRecord) > 0;
if (flags) { if (flags) {
if (serviceWorkOrdersType.getOperationMode().equals(OrderTypeOperationEnum.AUTOMATE_DISPATCH.getValue())) { if (serviceWorkOrdersType.getOperationMode().equals(OrderTypeOperationEnum.AUTOMATE_DISPATCH.getValue())) {
handleServiceWorkOrder(add); handleServiceWorkOrder(add,serviceWorkOrdersType);
} }
} }
} }

View File

@@ -3,6 +3,7 @@ package org.dromara.property.service.impl;
import cn.hutool.core.util.IdUtil; import cn.hutool.core.util.IdUtil;
import cn.hutool.core.util.ObjectUtil; import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import org.apache.dubbo.config.annotation.DubboReference;
import org.dromara.common.core.exception.ServiceException; import org.dromara.common.core.exception.ServiceException;
import org.dromara.common.core.utils.MapstructUtils; import org.dromara.common.core.utils.MapstructUtils;
import org.dromara.common.core.utils.StringUtils; import org.dromara.common.core.utils.StringUtils;
@@ -18,6 +19,8 @@ import org.dromara.property.domain.bo.ServiceWorkOrdersTypeBo;
import org.dromara.property.domain.vo.ServiceWorkOrdersTypeVo; import org.dromara.property.domain.vo.ServiceWorkOrdersTypeVo;
import org.dromara.property.mapper.ServiceWorkOrdersTypeMapper; import org.dromara.property.mapper.ServiceWorkOrdersTypeMapper;
import org.dromara.property.service.IServiceWorkOrdersTypeService; import org.dromara.property.service.IServiceWorkOrdersTypeService;
import org.dromara.system.api.RemoteDeptService;
import org.dromara.system.api.domain.vo.RemoteDeptVo;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@@ -39,6 +42,8 @@ public class ServiceWorkOrdersTypeServiceImpl implements IServiceWorkOrdersTypeS
private final ServiceWorkOrdersTypeMapper baseMapper; private final ServiceWorkOrdersTypeMapper baseMapper;
@DubboReference
private RemoteDeptService remoteDeptService;
/** /**
* 查询【工单类型】 * 查询【工单类型】
* *
@@ -47,7 +52,11 @@ public class ServiceWorkOrdersTypeServiceImpl implements IServiceWorkOrdersTypeS
*/ */
@Override @Override
public ServiceWorkOrdersTypeVo queryById(Long id) { public ServiceWorkOrdersTypeVo queryById(Long id) {
return baseMapper.selectVoById(id); ServiceWorkOrdersTypeVo serviceWorkOrdersTypeVo= baseMapper.selectVoById(id);
Long deptId = serviceWorkOrdersTypeVo.getDeptId();
RemoteDeptVo remoteDeptVo = remoteDeptService.selectDeptVoById(deptId);
serviceWorkOrdersTypeVo.setDeptName(remoteDeptVo.getDeptName());
return serviceWorkOrdersTypeVo;
} }
/** /**
@@ -61,6 +70,11 @@ public class ServiceWorkOrdersTypeServiceImpl implements IServiceWorkOrdersTypeS
public TableDataInfo<ServiceWorkOrdersTypeVo> queryPageList(ServiceWorkOrdersTypeBo bo, PageQuery pageQuery) { public TableDataInfo<ServiceWorkOrdersTypeVo> queryPageList(ServiceWorkOrdersTypeBo bo, PageQuery pageQuery) {
LambdaQueryWrapper<ServiceWorkOrdersType> lqw = buildQueryWrapper(bo); LambdaQueryWrapper<ServiceWorkOrdersType> lqw = buildQueryWrapper(bo);
Page<ServiceWorkOrdersTypeVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); Page<ServiceWorkOrdersTypeVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
result.getRecords().stream().forEach(vo -> {
Long deptId = vo.getDeptId();
RemoteDeptVo remoteDeptVo = remoteDeptService.selectDeptVoById(deptId);
vo.setDeptName(remoteDeptVo.getDeptName());
});
return TableDataInfo.build(result); return TableDataInfo.build(result);
} }
@@ -73,7 +87,13 @@ public class ServiceWorkOrdersTypeServiceImpl implements IServiceWorkOrdersTypeS
@Override @Override
public List<ServiceWorkOrdersTypeVo> queryList(ServiceWorkOrdersTypeBo bo) { public List<ServiceWorkOrdersTypeVo> queryList(ServiceWorkOrdersTypeBo bo) {
LambdaQueryWrapper<ServiceWorkOrdersType> lqw = buildQueryWrapper(bo); LambdaQueryWrapper<ServiceWorkOrdersType> lqw = buildQueryWrapper(bo);
return baseMapper.selectVoList(lqw); List<ServiceWorkOrdersTypeVo> serviceWorkOrdersTypeVoList= baseMapper.selectVoList(lqw);
serviceWorkOrdersTypeVoList.stream().forEach(vo -> {
Long deptId = vo.getDeptId();
RemoteDeptVo remoteDeptVo = remoteDeptService.selectDeptVoById(deptId);
vo.setDeptName(remoteDeptVo.getDeptName());
});
return serviceWorkOrdersTypeVoList;
} }
private LambdaQueryWrapper<ServiceWorkOrdersType> buildQueryWrapper(ServiceWorkOrdersTypeBo bo) { private LambdaQueryWrapper<ServiceWorkOrdersType> buildQueryWrapper(ServiceWorkOrdersTypeBo bo) {