修改了工单bug
All checks were successful
Build and Push to Target Registry / 构建并推送镜像到目标仓库 (push) Successful in 6m25s

This commit is contained in:
yuyongle 2025-08-21 17:35:28 +08:00
parent 37966e73c1
commit 2a143bb147
12 changed files with 135 additions and 62 deletions

View File

@ -62,7 +62,7 @@ public class ApplicationController extends BaseController {
* *
* @param id 主键 * @param id 主键
*/ */
//@SaCheckPermission("property:application:query") @SaCheckPermission("property:application:query")
@GetMapping("/{id}") @GetMapping("/{id}")
public R<ApplicationVo> getInfo(@NotNull(message = "主键不能为空") public R<ApplicationVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable("id") Long id) { @PathVariable("id") Long id) {

View File

@ -40,7 +40,7 @@ public class CostItemsController extends BaseController {
/** /**
* 查询费用项设置列表 * 查询费用项设置列表
*/ */
@SaCheckPermission("property:costItems:list") @SaCheckPermission("property:costItemSetting:list")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo<CostItemsVo> list(CostItemsBo bo, PageQuery pageQuery) { public TableDataInfo<CostItemsVo> list(CostItemsBo bo, PageQuery pageQuery) {
return costItemsService.queryPageList(bo, pageQuery); return costItemsService.queryPageList(bo, pageQuery);
@ -49,7 +49,7 @@ public class CostItemsController extends BaseController {
/** /**
* 导出费用项设置列表 * 导出费用项设置列表
*/ */
@SaCheckPermission("property:costItems:export") @SaCheckPermission("property:costItemSetting:export")
@Log(title = "费用项设置", businessType = BusinessType.EXPORT) @Log(title = "费用项设置", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
public void export(CostItemsBo bo, HttpServletResponse response) { public void export(CostItemsBo bo, HttpServletResponse response) {
@ -62,7 +62,7 @@ public class CostItemsController extends BaseController {
* *
* @param id 主键 * @param id 主键
*/ */
@SaCheckPermission("property:costItems:query") @SaCheckPermission("property:costItemSetting:query")
@GetMapping("/{id}") @GetMapping("/{id}")
public R<CostItemsVo> getInfo(@NotNull(message = "主键不能为空") public R<CostItemsVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable("id") Long id) { @PathVariable("id") Long id) {
@ -72,7 +72,7 @@ public class CostItemsController extends BaseController {
/** /**
* 新增费用项设置 * 新增费用项设置
*/ */
@SaCheckPermission("property:costItems:add") @SaCheckPermission("property:costItemSetting:add")
@Log(title = "费用项设置", businessType = BusinessType.INSERT) @Log(title = "费用项设置", businessType = BusinessType.INSERT)
@RepeatSubmit() @RepeatSubmit()
@PostMapping() @PostMapping()
@ -83,7 +83,7 @@ public class CostItemsController extends BaseController {
/** /**
* 修改费用项设置 * 修改费用项设置
*/ */
@SaCheckPermission("property:costItems:edit") @SaCheckPermission("property:costItemSetting:edit")
@Log(title = "费用项设置", businessType = BusinessType.UPDATE) @Log(title = "费用项设置", businessType = BusinessType.UPDATE)
@RepeatSubmit() @RepeatSubmit()
@PutMapping() @PutMapping()
@ -96,7 +96,7 @@ public class CostItemsController extends BaseController {
* *
* @param ids 主键串 * @param ids 主键串
*/ */
@SaCheckPermission("property:costItems:remove") @SaCheckPermission("property:costItemSetting:remove")
@Log(title = "费用项设置", businessType = BusinessType.DELETE) @Log(title = "费用项设置", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public R<Void> remove(@NotEmpty(message = "主键不能为空") public R<Void> remove(@NotEmpty(message = "主键不能为空")

View File

@ -40,7 +40,7 @@ public class CostMeterWaterController extends BaseController {
/** /**
* 查询费用-水电抄列表 * 查询费用-水电抄列表
*/ */
@SaCheckPermission("system:meterWater:list") @SaCheckPermission("property:costMeterWater:list")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo<CostMeterWaterVo> list(CostMeterWaterBo bo, PageQuery pageQuery) { public TableDataInfo<CostMeterWaterVo> list(CostMeterWaterBo bo, PageQuery pageQuery) {
return costMeterWaterService.queryPageList(bo, pageQuery); return costMeterWaterService.queryPageList(bo, pageQuery);
@ -49,7 +49,7 @@ public class CostMeterWaterController extends BaseController {
/** /**
* 导出费用-水电抄列表 * 导出费用-水电抄列表
*/ */
@SaCheckPermission("system:meterWater:export") @SaCheckPermission("property:costMeterWater:export")
@Log(title = "费用-水电抄", businessType = BusinessType.EXPORT) @Log(title = "费用-水电抄", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
public void export(CostMeterWaterBo bo, HttpServletResponse response) { public void export(CostMeterWaterBo bo, HttpServletResponse response) {
@ -62,7 +62,7 @@ public class CostMeterWaterController extends BaseController {
* *
* @param id 主键 * @param id 主键
*/ */
@SaCheckPermission("system:meterWater:query") @SaCheckPermission("property:costMeterWater:query")
@GetMapping("/{id}") @GetMapping("/{id}")
public R<CostMeterWaterVo> getInfo(@NotNull(message = "主键不能为空") public R<CostMeterWaterVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable("id") Long id) { @PathVariable("id") Long id) {
@ -82,7 +82,7 @@ public class CostMeterWaterController extends BaseController {
/** /**
* 新增费用-水电抄 * 新增费用-水电抄
*/ */
@SaCheckPermission("system:meterWater:add") @SaCheckPermission("property:costMeterWater:add")
@Log(title = "费用-水电抄", businessType = BusinessType.INSERT) @Log(title = "费用-水电抄", businessType = BusinessType.INSERT)
@RepeatSubmit() @RepeatSubmit()
@PostMapping() @PostMapping()
@ -93,7 +93,7 @@ public class CostMeterWaterController extends BaseController {
/** /**
* 修改费用-水电抄 * 修改费用-水电抄
*/ */
@SaCheckPermission("system:meterWater:edit") @SaCheckPermission("property:costMeterWater:edit")
@Log(title = "费用-水电抄", businessType = BusinessType.UPDATE) @Log(title = "费用-水电抄", businessType = BusinessType.UPDATE)
@RepeatSubmit() @RepeatSubmit()
@PutMapping() @PutMapping()
@ -106,7 +106,7 @@ public class CostMeterWaterController extends BaseController {
* *
* @param ids 主键串 * @param ids 主键串
*/ */
@SaCheckPermission("system:meterWater:remove") @SaCheckPermission("property:costMeterWater:remove")
@Log(title = "费用-水电抄", businessType = BusinessType.DELETE) @Log(title = "费用-水电抄", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public R<Void> remove(@NotEmpty(message = "主键不能为空") public R<Void> remove(@NotEmpty(message = "主键不能为空")

View File

@ -33,4 +33,15 @@ public class EnumFetcherController {
List<Map<Object, Object>> map = enumFetcherService.getEnumValues(name); List<Map<Object, Object>> map = enumFetcherService.getEnumValues(name);
return R.ok(map); return R.ok(map);
} }
/**
* 根据工单类型或部门下的排班人员
* @param type
* @return
*/
@GetMapping("/enum-getShiftScheduler/{type}")
public R<List<Map<Object, Object>>> getShiftScheduler(@PathVariable("type") String type) {
List<Map<Object, Object>> map = enumFetcherService.getShiftScheduler(type);
return R.ok(map);
}
} }

View File

@ -40,7 +40,7 @@ public class InspectionItemController extends BaseController {
/** /**
* 查询巡检项目列表 * 查询巡检项目列表
*/ */
@SaCheckPermission("system:item:list") @SaCheckPermission("property:inspectionItem:list")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo<InspectionItemVo> list(InspectionItemBo bo, PageQuery pageQuery) { public TableDataInfo<InspectionItemVo> list(InspectionItemBo bo, PageQuery pageQuery) {
return inspectionItemService.queryPageList(bo, pageQuery); return inspectionItemService.queryPageList(bo, pageQuery);
@ -49,7 +49,7 @@ public class InspectionItemController extends BaseController {
/** /**
* 导出巡检项目列表 * 导出巡检项目列表
*/ */
@SaCheckPermission("system:item:export") @SaCheckPermission("property:inspectionItem:export")
@Log(title = "巡检项目", businessType = BusinessType.EXPORT) @Log(title = "巡检项目", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
public void export(InspectionItemBo bo, HttpServletResponse response) { public void export(InspectionItemBo bo, HttpServletResponse response) {
@ -62,7 +62,7 @@ public class InspectionItemController extends BaseController {
* *
* @param id 主键 * @param id 主键
*/ */
@SaCheckPermission("system:item:query") @SaCheckPermission("property:inspectionItem:query")
@GetMapping("/{id}") @GetMapping("/{id}")
public R<InspectionItemVo> getInfo(@NotNull(message = "主键不能为空") public R<InspectionItemVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable("id") Long id) { @PathVariable("id") Long id) {
@ -72,7 +72,7 @@ public class InspectionItemController extends BaseController {
/** /**
* 新增巡检项目 * 新增巡检项目
*/ */
@SaCheckPermission("system:item:add") @SaCheckPermission("property:inspectionItem:add")
@Log(title = "巡检项目", businessType = BusinessType.INSERT) @Log(title = "巡检项目", businessType = BusinessType.INSERT)
@RepeatSubmit() @RepeatSubmit()
@PostMapping() @PostMapping()
@ -83,7 +83,7 @@ public class InspectionItemController extends BaseController {
/** /**
* 修改巡检项目 * 修改巡检项目
*/ */
@SaCheckPermission("system:item:edit") @SaCheckPermission("property:inspectionItem:edit")
@Log(title = "巡检项目", businessType = BusinessType.UPDATE) @Log(title = "巡检项目", businessType = BusinessType.UPDATE)
@RepeatSubmit() @RepeatSubmit()
@PutMapping() @PutMapping()
@ -96,7 +96,7 @@ public class InspectionItemController extends BaseController {
* *
* @param ids 主键串 * @param ids 主键串
*/ */
@SaCheckPermission("system:item:remove") @SaCheckPermission("property:inspectionItem:remove")
@Log(title = "巡检项目", businessType = BusinessType.DELETE) @Log(title = "巡检项目", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public R<Void> remove(@NotEmpty(message = "主键不能为空") public R<Void> remove(@NotEmpty(message = "主键不能为空")

View File

@ -40,7 +40,7 @@ public class InspectionPointController extends BaseController {
/** /**
* 查询巡检点列表 * 查询巡检点列表
*/ */
@SaCheckPermission("system:point:list") @SaCheckPermission("property:inspectionPoint:list")
@GetMapping("/list") @GetMapping("/list")
public TableDataInfo<InspectionPointVo> list(InspectionPointBo bo, PageQuery pageQuery) { public TableDataInfo<InspectionPointVo> list(InspectionPointBo bo, PageQuery pageQuery) {
return inspectionPointService.queryPageList(bo, pageQuery); return inspectionPointService.queryPageList(bo, pageQuery);
@ -49,7 +49,7 @@ public class InspectionPointController extends BaseController {
/** /**
* 导出巡检点列表 * 导出巡检点列表
*/ */
@SaCheckPermission("system:point:export") @SaCheckPermission("property:inspectionPoint:export")
@Log(title = "巡检点", businessType = BusinessType.EXPORT) @Log(title = "巡检点", businessType = BusinessType.EXPORT)
@PostMapping("/export") @PostMapping("/export")
public void export(InspectionPointBo bo, HttpServletResponse response) { public void export(InspectionPointBo bo, HttpServletResponse response) {
@ -62,7 +62,7 @@ public class InspectionPointController extends BaseController {
* *
* @param id 主键 * @param id 主键
*/ */
@SaCheckPermission("system:point:query") @SaCheckPermission("property:inspectionPoint:query")
@GetMapping("/{id}") @GetMapping("/{id}")
public R<InspectionPointVo> getInfo(@NotNull(message = "主键不能为空") public R<InspectionPointVo> getInfo(@NotNull(message = "主键不能为空")
@PathVariable("id") Long id) { @PathVariable("id") Long id) {
@ -72,7 +72,7 @@ public class InspectionPointController extends BaseController {
/** /**
* 新增巡检点 * 新增巡检点
*/ */
@SaCheckPermission("system:point:add") @SaCheckPermission("property:inspectionPoint:add")
@Log(title = "巡检点", businessType = BusinessType.INSERT) @Log(title = "巡检点", businessType = BusinessType.INSERT)
@RepeatSubmit() @RepeatSubmit()
@PostMapping() @PostMapping()
@ -83,7 +83,7 @@ public class InspectionPointController extends BaseController {
/** /**
* 修改巡检点 * 修改巡检点
*/ */
@SaCheckPermission("system:point:edit") @SaCheckPermission("property:inspectionPoint:edit")
@Log(title = "巡检点", businessType = BusinessType.UPDATE) @Log(title = "巡检点", businessType = BusinessType.UPDATE)
@RepeatSubmit() @RepeatSubmit()
@PutMapping() @PutMapping()
@ -96,7 +96,7 @@ public class InspectionPointController extends BaseController {
* *
* @param ids 主键串 * @param ids 主键串
*/ */
@SaCheckPermission("system:point:remove") @SaCheckPermission("property:inspectionPoint:remove")
@Log(title = "巡检点", businessType = BusinessType.DELETE) @Log(title = "巡检点", businessType = BusinessType.DELETE)
@DeleteMapping("/{ids}") @DeleteMapping("/{ids}")
public R<Void> remove(@NotEmpty(message = "主键不能为空") public R<Void> remove(@NotEmpty(message = "主键不能为空")

View File

@ -145,6 +145,7 @@ public class TbVisitorManagementController extends BaseController {
if (info==null){ if (info==null){
return R.fail("请确认Qr码有效"); return R.fail("请确认Qr码有效");
} }
bo.setType(0);
return toAjax(tbVisitorManagementService.insertByBo(bo)); return toAjax(tbVisitorManagementService.insertByBo(bo));
} }
@ -156,6 +157,7 @@ public class TbVisitorManagementController extends BaseController {
@RepeatSubmit() @RepeatSubmit()
@PostMapping @PostMapping
public R<Void> addVistorManagement(@Validated(AddGroup.class) @RequestBody TbVisitorManagementBo bo) { public R<Void> addVistorManagement(@Validated(AddGroup.class) @RequestBody TbVisitorManagementBo bo) {
bo.setType(1);
return toAjax(tbVisitorManagementService.insertVistorManagementByBo(bo)); return toAjax(tbVisitorManagementService.insertVistorManagementByBo(bo));
} }

View File

@ -3,6 +3,7 @@ package org.dromara.property.controller.mobile;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.dromara.common.core.domain.R; import org.dromara.common.core.domain.R;
import org.dromara.common.core.validate.AddGroup; import org.dromara.common.core.validate.AddGroup;
import org.dromara.common.core.validate.EditGroup;
import org.dromara.common.idempotent.annotation.RepeatSubmit; import org.dromara.common.idempotent.annotation.RepeatSubmit;
import org.dromara.common.log.annotation.Log; import org.dromara.common.log.annotation.Log;
import org.dromara.common.log.enums.BusinessType; import org.dromara.common.log.enums.BusinessType;
@ -46,4 +47,13 @@ public class MServiceWorkOrdersController extends BaseController {
public TableDataInfo<ServiceWorkOrdersVo> list(ServiceWorkOrdersBo bo, PageQuery pageQuery) { public TableDataInfo<ServiceWorkOrdersVo> list(ServiceWorkOrdersBo bo, PageQuery pageQuery) {
return serviceWorkOrdersService.queryPageList(bo, pageQuery); return serviceWorkOrdersService.queryPageList(bo, pageQuery);
} }
/**
* 修改工单处理
*/
@Log(title = "【工单处理】", businessType = BusinessType.UPDATE)
@RepeatSubmit()
@PutMapping()
public R<Void> edit(@Validated(EditGroup.class) @RequestBody ServiceWorkOrdersBo bo) {
return toAjax(serviceWorkOrdersService.updateByBo(bo));
}
} }

View File

@ -15,4 +15,12 @@ public interface EnumFetcherService {
* @return * @return
*/ */
List<Map<Object, Object>> getEnumValues(String type); List<Map<Object, Object>> getEnumValues(String type);
/**
* 获取排班信息人员下拉
* @param type
* @return
*/
List<Map<Object, Object>> getShiftScheduler(String type);
} }

View File

@ -1,17 +1,25 @@
package org.dromara.property.service.impl; package org.dromara.property.service.impl;
import cn.hutool.core.collection.CollUtil;
import cn.hutool.core.util.ObjectUtil;
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import org.apache.dubbo.config.annotation.DubboReference; import org.apache.dubbo.config.annotation.DubboReference;
import org.dromara.property.domain.AttendanceUserGroup;
import org.dromara.property.domain.ServiceWorkOrdersType;
import org.dromara.property.domain.enums.BookingPayStatusEnum; import org.dromara.property.domain.enums.BookingPayStatusEnum;
import org.dromara.property.domain.enums.BookingStatusEnum; import org.dromara.property.domain.enums.BookingStatusEnum;
import org.dromara.property.domain.enums.MeetAttachStatusEnum; import org.dromara.property.domain.enums.MeetAttachStatusEnum;
import org.dromara.property.domain.enums.MeetStatusEnum; import org.dromara.property.domain.enums.MeetStatusEnum;
import org.dromara.property.mapper.ServiceWorkOrdersTypeMapper;
import org.dromara.property.mapper.attendanceMapper.AttendanceUserGroupMapper;
import org.dromara.property.service.*; import org.dromara.property.service.*;
import org.dromara.system.api.RemoteUserService; import org.dromara.system.api.RemoteUserService;
import org.dromara.system.api.domain.vo.RemoteUserVo; import org.dromara.system.api.domain.vo.RemoteUserVo;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import java.time.LocalDate;
import java.util.*; import java.util.*;
import java.util.stream.Collectors; import java.util.stream.Collectors;
@ -34,6 +42,11 @@ public class EnumFetcherServiceImpl implements EnumFetcherService {
@DubboReference @DubboReference
private RemoteUserService remoteUserService; private RemoteUserService remoteUserService;
@Autowired
private ServiceWorkOrdersTypeMapper serviceWorkOrdersTypeMapper;
@Autowired
private AttendanceUserGroupMapper attendanceUserGroupMapper;
@Override @Override
public List<Map<Object, Object>> getEnumValues(String type) { public List<Map<Object, Object>> getEnumValues(String type) {
switch (type) { switch (type) {
@ -57,15 +70,15 @@ public class EnumFetcherServiceImpl implements EnumFetcherService {
return getMeetBookingStatus(); return getMeetBookingStatus();
case "getServiceWorkOrdersHandler": case "getServiceWorkOrdersHandler":
return serviceWorkOrdersService.getServiceWorkOrdersHandler(type); return serviceWorkOrdersService.getServiceWorkOrdersHandler(type);
case "getAccount":
return getAccount();
default: default:
throw new IllegalArgumentException("Unknown type: " + type); throw new IllegalArgumentException("Unknown type: " + type);
} }
} }
/**
* 获取会议室状态枚举接口
*/ /**
* 获取会议室状态枚举接口
*/
List<Map<Object, Object>> getMeetStatus() { List<Map<Object, Object>> getMeetStatus() {
return Arrays.stream(MeetStatusEnum.values()) return Arrays.stream(MeetStatusEnum.values())
.map(e -> { .map(e -> {
@ -110,15 +123,35 @@ public class EnumFetcherServiceImpl implements EnumFetcherService {
}) })
.collect(Collectors.toList()); .collect(Collectors.toList());
} }
@Override
public List<Map<Object, Object>> getShiftScheduler(String type) {
ServiceWorkOrdersType serviceWorkOrdersType = serviceWorkOrdersTypeMapper.selectById(type);
LocalDate today = LocalDate.now();
List<AttendanceUserGroup> attendanceUserGroups = attendanceUserGroupMapper.selectList(
new LambdaQueryWrapper<AttendanceUserGroup>()
//查询今天上班的人员
.eq(AttendanceUserGroup::getStartDate, today)
.eq(ObjectUtil.isNotNull(serviceWorkOrdersType),AttendanceUserGroup::getDeptId, serviceWorkOrdersType.getCreateDept())
);
if (CollUtil.isEmpty(attendanceUserGroups)) {
return List.of();
}
// 收集用户id
List<Long> userIdList = attendanceUserGroups.stream().map(AttendanceUserGroup::getEmployeeId).toList();
return getAccount(userIdList);
}
/** /**
* 获取账户信息 * 获取账户信息
*/ */
List<Map<Object, Object>> getAccount() { List<Map<Object, Object>> getAccount(List<Long> userIdList) {
List<RemoteUserVo> remoteUserVos = remoteUserService.selectUserList(new ArrayList<>()); List<RemoteUserVo> remoteUserVos = remoteUserService.selectUserList(userIdList);
return remoteUserVos.stream() return remoteUserVos.stream()
.map(e -> { .map(e -> {
Map<Object, Object> map = new HashMap<>(); Map<Object, Object> map = new HashMap<>();
map.put("value", e.getUserName()); map.put("value", e.getUserId());
map.put("name", e.getNickName()); map.put("name", e.getNickName());
return map; return map;
}) })

View File

@ -9,6 +9,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import lombok.RequiredArgsConstructor; import lombok.RequiredArgsConstructor;
import lombok.extern.slf4j.Slf4j; import lombok.extern.slf4j.Slf4j;
import org.apache.dubbo.config.annotation.DubboReference;
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;
import org.dromara.common.mybatis.core.page.PageQuery; import org.dromara.common.mybatis.core.page.PageQuery;
@ -19,6 +20,8 @@ import org.dromara.property.domain.bo.MeetBookingBo;
import org.dromara.property.domain.vo.*; import org.dromara.property.domain.vo.*;
import org.dromara.property.mapper.*; import org.dromara.property.mapper.*;
import org.dromara.property.service.IMeetBookingService; import org.dromara.property.service.IMeetBookingService;
import org.dromara.system.api.RemoteUserService;
import org.dromara.system.api.domain.vo.RemoteUserVo;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
@ -46,6 +49,8 @@ public class MeetBookingServiceImpl implements IMeetBookingService {
private final TbRoomMapper roomMapper; private final TbRoomMapper roomMapper;
private final MeetMapper meetMapper; private final MeetMapper meetMapper;
private final ResidentUnitMapper residentUnitMapper; private final ResidentUnitMapper residentUnitMapper;
@DubboReference
private RemoteUserService remoteUserService;
/** /**
* 查询会议预约 * 查询会议预约
@ -80,8 +85,8 @@ public class MeetBookingServiceImpl implements IMeetBookingService {
LambdaQueryWrapper<MeetBooking> lqw = buildQueryWrapper(bo); LambdaQueryWrapper<MeetBooking> lqw = buildQueryWrapper(bo);
Page<MeetBookingVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw); Page<MeetBookingVo> result = baseMapper.selectVoPage(pageQuery.build(), lqw);
List<ResidentUnitVo> residentUnitVolist = residentUnitMapper.selectVoList(); List<ResidentUnitVo> residentUnitVolist = residentUnitMapper.selectVoList();
List<ResidentPersonVo> residentPersonsVolist = residentPersonMapper.selectVoList(); List<Long> userId = result.getRecords().stream().map(vo -> vo.getPerson()).distinct().map(Long::parseLong).collect(Collectors.toList());
List<RemoteUserVo> remoteUserVos = remoteUserService.selectListByIds(userId);
List<MeetBookingVo> meetBookingVoList = new ArrayList<>(); List<MeetBookingVo> meetBookingVoList = new ArrayList<>();
result.getRecords().stream().forEach(s -> { result.getRecords().stream().forEach(s -> {
if (CollUtil.isNotEmpty(residentUnitVolist)) { if (CollUtil.isNotEmpty(residentUnitVolist)) {
@ -89,11 +94,11 @@ public class MeetBookingServiceImpl implements IMeetBookingService {
.filter(vo -> vo.getId() != null && String.valueOf(vo.getId()).equals(s.getUnit())).findFirst().orElse(null); .filter(vo -> vo.getId() != null && String.valueOf(vo.getId()).equals(s.getUnit())).findFirst().orElse(null);
s.setUnitName(ObjectUtil.isNotEmpty(residentUnitVo) ? residentUnitVo.getName() : null); s.setUnitName(ObjectUtil.isNotEmpty(residentUnitVo) ? residentUnitVo.getName() : null);
} }
if (CollUtil.isNotEmpty(residentPersonsVolist)) { if (CollUtil.isNotEmpty(remoteUserVos)) {
ResidentPersonVo residentPersonVo = residentPersonsVolist.stream() RemoteUserVo remoteUserVo = remoteUserVos.stream()
.filter(vo -> vo.getId() != null && String.valueOf(vo.getId()).equals(s.getPerson())).findFirst().orElse(null); .filter(vo -> vo.getUserId() != null && String.valueOf(vo.getUserId()).equals(s.getPerson())).findFirst().orElse(null);
s.setPersonName(ObjectUtil.isNotEmpty(residentPersonVo) ? residentPersonVo.getUserName() : null); s.setPersonName(ObjectUtil.isNotEmpty(remoteUserVo) ? remoteUserVo.getNickName() : null);
s.setPhone(ObjectUtil.isNotEmpty(residentPersonVo) ? residentPersonVo.getPhone() : null); s.setPhone(ObjectUtil.isNotEmpty(remoteUserVo) ? remoteUserVo.getPhonenumber() : null);
} }
meetBookingVoList.add(s); meetBookingVoList.add(s);
}); });
@ -122,7 +127,8 @@ public class MeetBookingServiceImpl implements IMeetBookingService {
List<MeetBookingAppointmentVo> meetBookingAppointmentVoList = BeanUtil.copyToList(meetBookings, MeetBookingAppointmentVo.class); List<MeetBookingAppointmentVo> meetBookingAppointmentVoList = BeanUtil.copyToList(meetBookings, MeetBookingAppointmentVo.class);
SimpleDateFormat df = new SimpleDateFormat("HH"); SimpleDateFormat df = new SimpleDateFormat("HH");
List<ResidentUnitVo> residentUnitVolist = residentUnitMapper.selectVoList(); List<ResidentUnitVo> residentUnitVolist = residentUnitMapper.selectVoList();
List<ResidentPersonVo> residentPersonsVolist = residentPersonMapper.selectVoList(); List<Long> userId = meetBookingAppointmentVoList.stream().map(vo -> vo.getPerson()).distinct().map(Long::parseLong).collect(Collectors.toList());
List<RemoteUserVo> remoteUserVos = remoteUserService.selectListByIds(userId);
meetBookingAppointmentVoList.stream().forEach( meetBookingAppointmentVoList.stream().forEach(
s -> { s -> {
if (CollUtil.isNotEmpty(residentUnitVolist)) { if (CollUtil.isNotEmpty(residentUnitVolist)) {
@ -130,11 +136,11 @@ public class MeetBookingServiceImpl implements IMeetBookingService {
.filter(vo -> vo.getId() != null && String.valueOf(vo.getId()).equals(s.getUnit())).findFirst().orElse(null); .filter(vo -> vo.getId() != null && String.valueOf(vo.getId()).equals(s.getUnit())).findFirst().orElse(null);
s.setUnitName(residentUnitVo.getName()); s.setUnitName(residentUnitVo.getName());
} }
if (CollUtil.isNotEmpty(residentPersonsVolist)) { if (CollUtil.isNotEmpty(remoteUserVos)) {
ResidentPersonVo residentPersonVo = residentPersonsVolist.stream() RemoteUserVo remoteUserVo = remoteUserVos.stream()
.filter(vo -> vo.getId() != null && String.valueOf(vo.getId()).equals(s.getPerson())).findFirst().orElse(null); .filter(vo -> vo.getUserId() != null && String.valueOf(vo.getUserId()).equals(s.getPerson())).findFirst().orElse(null);
s.setPersonName(residentPersonVo.getUserName()); s.setPersonName(ObjectUtil.isNotEmpty(remoteUserVo) ? remoteUserVo.getNickName() : null);
s.setPhone(residentPersonVo.getPhone()); s.setPhone(ObjectUtil.isNotEmpty(remoteUserVo) ? remoteUserVo.getPhonenumber() : null);
} }
String str = df.format(s.getScheduledStarttime()); String str = df.format(s.getScheduledStarttime());
int a = Integer.parseInt(str); int a = Integer.parseInt(str);
@ -181,17 +187,18 @@ public class MeetBookingServiceImpl implements IMeetBookingService {
List<MeetBookingWeekVo> meetBookingWeekList = new ArrayList<>(); List<MeetBookingWeekVo> meetBookingWeekList = new ArrayList<>();
SimpleDateFormat df = new SimpleDateFormat("HH"); SimpleDateFormat df = new SimpleDateFormat("HH");
List<ResidentUnitVo> residentUnitVolist = residentUnitMapper.selectVoList(); List<ResidentUnitVo> residentUnitVolist = residentUnitMapper.selectVoList();
List<ResidentPersonVo> residentPersonsVolist = residentPersonMapper.selectVoList(); List<Long> userId = meetBookingWeekVoList.stream().map(vo -> vo.getPerson()).distinct().map(Long::parseLong).collect(Collectors.toList());
List<RemoteUserVo> remoteUserVos = remoteUserService.selectListByIds(userId);
meetBookingWeekVoList.stream().forEach(s -> { meetBookingWeekVoList.stream().forEach(s -> {
if (CollUtil.isNotEmpty(residentUnitVolist)) { if (CollUtil.isNotEmpty(residentUnitVolist)) {
ResidentUnitVo residentUnitVo = residentUnitVolist.stream() ResidentUnitVo residentUnitVo = residentUnitVolist.stream()
.filter(vo -> vo.getId() != null && String.valueOf(vo.getId()).equals(s.getUnit())).findFirst().orElse(null); .filter(vo -> vo.getId() != null && String.valueOf(vo.getId()).equals(s.getUnit())).findFirst().orElse(null);
s.setUnitName(residentUnitVo.getName()); s.setUnitName(residentUnitVo.getName());
} }
if (CollUtil.isNotEmpty(residentPersonsVolist)) { if (CollUtil.isNotEmpty(remoteUserVos)) {
ResidentPersonVo residentPersonVo = residentPersonsVolist.stream() RemoteUserVo remoteUserVo = remoteUserVos.stream()
.filter(vo -> vo.getId() != null && String.valueOf(vo.getId()).equals(s.getPerson())).findFirst().orElse(null); .filter(vo -> vo.getUserId() != null && String.valueOf(vo.getUserId()).equals(s.getPerson())).findFirst().orElse(null);
s.setPersonName(residentPersonVo.getUserName()); s.setPersonName(ObjectUtil.isNotEmpty(remoteUserVo) ? remoteUserVo.getNickName() : null);
} }
//设置指定的Date对象不设置默认返回当天的星期 //设置指定的Date对象不设置默认返回当天的星期
calendar.setTime(s.getScheduledStarttime()); calendar.setTime(s.getScheduledStarttime());

View File

@ -21,6 +21,8 @@ import org.springframework.scheduling.annotation.Scheduled;
import java.time.LocalDate; import java.time.LocalDate;
import java.util.Date; import java.util.Date;
import java.util.List; import java.util.List;
import org.springframework.stereotype.Component;
import org.springframework.transaction.annotation.Transactional; import org.springframework.transaction.annotation.Transactional;
import org.springframework.web.bind.annotation.RequestMapping; import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController; import org.springframework.web.bind.annotation.RestController;
@ -31,12 +33,12 @@ import org.springframework.web.bind.annotation.RestController;
* @Description:自动派单 * @Description:自动派单
**/ **/
@Slf4j @Slf4j
//@Component @Component
//@RequiredArgsConstructor
@RequiredArgsConstructor @RequiredArgsConstructor
@RestController
@RequestMapping("/serviceWorkOrderTasks") //@RequiredArgsConstructor
//@RestController
//@RequestMapping("/serviceWorkOrderTasks")
public class ServiceWorkOrderTasks { public class ServiceWorkOrderTasks {
private ServiceWorkOrdersMapper workOrdersMapper; private ServiceWorkOrdersMapper workOrdersMapper;
private ServiceWorkOrdersRecordMapper workOrdersRecordMapper; private ServiceWorkOrdersRecordMapper workOrdersRecordMapper;
@ -53,13 +55,13 @@ public class ServiceWorkOrderTasks {
new LambdaQueryWrapper<ServiceWorkOrders>() new LambdaQueryWrapper<ServiceWorkOrders>()
.eq(ServiceWorkOrders::getStatus, WorkOrderStatusEnum.CREATE_ORDER.getValue())); .eq(ServiceWorkOrders::getStatus, WorkOrderStatusEnum.CREATE_ORDER.getValue()));
if(CollUtil.isNotEmpty(serviceWorkOrderList)){ if(CollUtil.isNotEmpty(serviceWorkOrderList)){
LocalDate today = LocalDate.now();
List<AttendanceUserGroup> attendanceUserGroups = attendanceUserGroupMapper.selectList(
new LambdaQueryWrapper<AttendanceUserGroup>()
//查询今天上班的人员
.eq(AttendanceUserGroup::getStartDate, today)
);
serviceWorkOrderList.stream().forEach(s->{ serviceWorkOrderList.stream().forEach(s->{
//查询今天上班的人员
LocalDate today = LocalDate.now();
List<AttendanceUserGroup> attendanceUserGroups = attendanceUserGroupMapper.selectList(
new LambdaQueryWrapper<AttendanceUserGroup>()
.eq(AttendanceUserGroup::getStartDate, today)
);
if(CollUtil.isNotEmpty(attendanceUserGroups)){ if(CollUtil.isNotEmpty(attendanceUserGroups)){
attendanceUserGroups.stream().forEach(s1->{ attendanceUserGroups.stream().forEach(s1->{
ServiceWorkOrdersRecord serviceWorkOrdersRecord = new ServiceWorkOrdersRecord(); ServiceWorkOrdersRecord serviceWorkOrdersRecord = new ServiceWorkOrdersRecord();