diff --git a/pjcloud-integrated/pjcloud-integrated-biz/src/main/java/com/bsd/pjcloud/integrated/controller/MeetingBookingController.java b/pjcloud-integrated/pjcloud-integrated-biz/src/main/java/com/bsd/pjcloud/integrated/controller/MeetingBookingController.java index 003d62e82..1fb539577 100644 --- a/pjcloud-integrated/pjcloud-integrated-biz/src/main/java/com/bsd/pjcloud/integrated/controller/MeetingBookingController.java +++ b/pjcloud-integrated/pjcloud-integrated-biz/src/main/java/com/bsd/pjcloud/integrated/controller/MeetingBookingController.java @@ -1,244 +1,244 @@ -package com.bsd.pjcloud.integrated.controller; - -import cn.hutool.core.util.StrUtil; -import cn.hutool.core.util.ArrayUtil; -import cn.hutool.core.collection.CollUtil; -import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; -import com.baomidou.mybatisplus.core.toolkit.Wrappers; -import com.baomidou.mybatisplus.extension.plugins.pagination.Page; -import com.bsd.pjcloud.common.core.util.R; -import com.bsd.pjcloud.common.log.annotation.SysLog; -import com.bsd.pjcloud.common.security.util.SecurityUtils; -import com.bsd.pjcloud.integrated.entity.MeetingBookingEntity; -import com.bsd.pjcloud.integrated.service.MeetingBookingService; -import org.springframework.security.access.prepost.PreAuthorize; -import com.bsd.pjcloud.common.excel.annotation.ResponseExcel; -import io.swagger.v3.oas.annotations.security.SecurityRequirement; -import org.springdoc.core.annotations.ParameterObject; -import org.springframework.http.HttpHeaders; -import io.swagger.v3.oas.annotations.tags.Tag; -import io.swagger.v3.oas.annotations.Operation; -import lombok.RequiredArgsConstructor; -import org.springframework.web.bind.annotation.*; -import com.bsd.pjcloud.integrated.entity.MeetingRoomEntity; -import com.bsd.pjcloud.integrated.service.MeetingRoomService; -import com.bsd.pjcloud.flow.task.api.feign.RemoteFlowApiFlowService; -import com.bsd.pjcloud.flow.task.constant.TaskCheckStatusEnum; -import com.bsd.pjcloud.flow.task.dto.ProcessInstanceParamDto; -import com.bsd.pjcloud.flow.task.entity.Process; -import com.bsd.pjcloud.integrated.constant.IntegratedFlowConstant; -import com.bsd.pjcloud.integrated.dto.flow.MeetingFlowDto; -import cn.hutool.core.bean.BeanUtil; -import com.bsd.pjcloud.common.core.constant.enums.YesNoEnum; -import com.bsd.pjcloud.common.core.exception.ServiceException; -import org.springframework.transaction.annotation.Transactional; -import java.time.LocalDate; -import java.time.LocalTime; -import java.util.Map; - -import java.util.List; -import java.util.Objects; -import com.bsd.pjcloud.integrated.dto.meeting.MeetingBookingSaveDto; -import com.bsd.pjcloud.integrated.vo.meeting.MeetingBookingPageVo; -import java.util.HashMap; - -/** - * 会议室预约 - * - * @author zjf - * @date 2025-05-20 10:51:29 - */ -@RestController -@RequiredArgsConstructor -@RequestMapping("/meetingBooking" ) -@Tag(description = "meetingBooking" , name = "会议室预约管理" ) -@SecurityRequirement(name = HttpHeaders.AUTHORIZATION) -public class MeetingBookingController { - - private final MeetingBookingService meetingBookingService; - private final MeetingRoomService meetingRoomService; - private final RemoteFlowApiFlowService remoteFlowApiFlowService; - - /** - * 分页查询 - * @param page 分页对象 - * @param meetingBooking 会议室预约 - * @return - */ - @Operation(summary = "分页查询", description = "分页查询") - @GetMapping("/page") - @PreAuthorize("@pms.hasPermission('integrated_meetingBooking_view')") - public R> getMeetingBookingPage(@ParameterObject Page page, @ParameterObject MeetingBookingEntity meetingBooking) { - LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(); - wrapper.eq(StrUtil.isNotBlank(meetingBooking.getTitle()), MeetingBookingEntity::getTitle, meetingBooking.getTitle()); - Page entityPage = meetingBookingService.pageScope(page, wrapper); - - // 批量查会议室名称,避免N+1 - List roomIds = entityPage.getRecords().stream().map(MeetingBookingEntity::getRoomId).distinct().toList(); - Map roomNameMap = new HashMap<>(); - if (!roomIds.isEmpty()) { - List rooms = meetingRoomService.listByIds(roomIds); - for (MeetingRoomEntity room : rooms) { - roomNameMap.put(room.getId(), room.getRoomName()); - } - } - - // 转VO - List voList = entityPage.getRecords().stream().map(e -> { - MeetingBookingPageVo vo = new MeetingBookingPageVo(); - vo.setId(e.getId()); - vo.setTitle(e.getTitle()); - vo.setRoomId(e.getRoomId()); - vo.setRoomName(roomNameMap.get(e.getRoomId())); - vo.setBookingDate(e.getBookingDate()); - vo.setStartTime(e.getStartTime()); - vo.setEndTime(e.getEndTime()); - vo.setApplicantId(e.getApplicantId()); - vo.setAssigneeName(e.getAssigneeName()); - vo.setCheckStatus(e.getCheckStatus()); - vo.setCheckReason(e.getCheckReason()); - vo.setCreateTime(e.getCreateTime()); - vo.setCreateBy(e.getCreateBy()); - vo.setDescription(e.getDescription()); - return vo; - }).toList(); - - Page voPage = new Page<>(entityPage.getCurrent(), entityPage.getSize(), entityPage.getTotal()); - voPage.setRecords(voList); - return R.ok(voPage); - } - - - /** - * 通过id查询会议室预约 - * @param id id - * @return R - */ - @Operation(summary = "通过id查询" , description = "通过id查询" ) - @GetMapping("/{id}" ) - @PreAuthorize("@pms.hasPermission('integrated_meetingBooking_view')" ) - public R getById(@PathVariable("id" ) Long id) { - return R.ok(meetingBookingService.getById(id)); - } - - /** - * 新增会议室预约(PC端,逻辑与手机端一致) - * @param dto 预约参数 - * @return R - */ - @Operation(summary = "新增会议室预约", description = "新增会议室预约") - @SysLog("新增会议室预约") - @PostMapping - @PreAuthorize("@pms.hasPermission('integrated_meetingBooking_add')") - @Transactional - public R save(@RequestBody MeetingBookingSaveDto dto) { - // 1. 参数转换 - MeetingBookingEntity meetingBooking = new MeetingBookingEntity(); - meetingBooking.setTitle(dto.getTitle()); - meetingBooking.setRoomId(dto.getRoomId()); - meetingBooking.setDescription(dto.getDescription()); - meetingBooking.setBookingDate(LocalDate.parse(dto.getBookingDate())); - meetingBooking.setStartTime(LocalTime.parse(dto.getStartTime())); - meetingBooking.setEndTime(LocalTime.parse(dto.getEndTime())); - // 2. 验证会议室是否存在 - MeetingRoomEntity room = meetingRoomService.getById(meetingBooking.getRoomId()); - if (room == null) { - return R.failed("会议室不存在"); - } - // 3. 验证会议室状态 - if (!YesNoEnum.NO.getCode().equals(room.getStatus())) { - return R.failed("会议室当前不可用"); - } - // 4. 校验时间 - LocalDate bookingDate = meetingBooking.getBookingDate(); - LocalTime startTime = meetingBooking.getStartTime(); - LocalTime endTime = meetingBooking.getEndTime(); - if (startTime == null || endTime == null || bookingDate == null) { - return R.failed("预约日期和时间不能为空"); - } - if (startTime.isAfter(endTime)) { - return R.failed("开始时间不能晚于结束时间"); - } - LocalTime availableStart = LocalTime.of(8, 0); - LocalTime availableEnd = LocalTime.of(18, 0); - if (startTime.isBefore(availableStart) || endTime.isAfter(availableEnd)) { - return R.failed("预约时间必须在8:00-18:00之间"); - } - // 5. 检查时间段是否已被预约 - var existingBookings = meetingBookingService.list( - Wrappers.lambdaQuery() - .eq(MeetingBookingEntity::getRoomId, meetingBooking.getRoomId()) - .eq(MeetingBookingEntity::getBookingDate, bookingDate) - .eq(MeetingBookingEntity::getCheckStatus, TaskCheckStatusEnum.RESULT.getCode()) - ); - for (MeetingBookingEntity booking : existingBookings) { - LocalTime bookingStart = booking.getStartTime(); - LocalTime bookingEnd = booking.getEndTime(); - if (!(endTime.compareTo(bookingStart) <= 0 || startTime.compareTo(bookingEnd) >= 0)) { - return R.failed("该时间段已被预约"); - } - } - // 6. 设置预约人、部门 - meetingBooking.setApplicantId(SecurityUtils.getUser().getId()); - meetingBooking.setDeptId(SecurityUtils.getUser().getDeptId()); - // 7. 发起流程 - var processByBusinessKey = remoteFlowApiFlowService.getProcessByBusinessKey(IntegratedFlowConstant.INTEGRATED_MEETING_BOOKING); - if (!processByBusinessKey.isOk() || processByBusinessKey.getData() == null) { - throw new ServiceException("流程配置获取失败: " + processByBusinessKey.getMsg()); - } - Process process = processByBusinessKey.getData(); - MeetingFlowDto meetingFlowDto = new MeetingFlowDto(); - meetingFlowDto.setRoomName(room.getRoomName()); - meetingFlowDto.setApplicantName(SecurityUtils.getUser().getUsername()); - meetingFlowDto.setMeetingTime(bookingDate + " " + startTime + "-" + endTime); - Map stringObjectMap = BeanUtil.beanToMap(meetingFlowDto); - ProcessInstanceParamDto processInstanceParamDto = new ProcessInstanceParamDto(); - processInstanceParamDto.setFlowId(process.getFlowId()); - processInstanceParamDto.setParamMap(stringObjectMap); - var stringR = remoteFlowApiFlowService.startProcessInstance(processInstanceParamDto); - meetingBooking.setCheckStatus(TaskCheckStatusEnum.PADDING.getCode()); - meetingBooking.setProcessInstanceId(stringR.getData()); - boolean success = meetingBookingService.save(meetingBooking); - return R.ok(success); - } - - /** - * 修改会议室预约 - * @param meetingBooking 会议室预约 - * @return R - */ - @Operation(summary = "修改会议室预约" , description = "修改会议室预约" ) - @SysLog("修改会议室预约" ) - @PutMapping - @PreAuthorize("@pms.hasPermission('integrated_meetingBooking_edit')" ) - public R updateById(@RequestBody MeetingBookingEntity meetingBooking) { - return R.ok(meetingBookingService.updateById(meetingBooking)); - } - - /** - * 通过id删除会议室预约 - * @param ids id列表 - * @return R - */ - @Operation(summary = "通过id删除会议室预约" , description = "通过id删除会议室预约" ) - @SysLog("通过id删除会议室预约" ) - @DeleteMapping - @PreAuthorize("@pms.hasPermission('integrated_meetingBooking_del')" ) - public R removeById(@RequestBody Long[] ids) { - return R.ok(meetingBookingService.removeBatchByIds(CollUtil.toList(ids))); - } - - - /** - * 导出excel 表格 - * @param meetingBooking 查询条件 - * @param ids 导出指定ID - * @return excel 文件流 - */ - @ResponseExcel - @GetMapping("/export") - @PreAuthorize("@pms.hasPermission('integrated_meetingBooking_export')" ) - public List export(MeetingBookingEntity meetingBooking,Long[] ids) { - return meetingBookingService.list(Wrappers.lambdaQuery(meetingBooking).in(ArrayUtil.isNotEmpty(ids), MeetingBookingEntity::getId, ids)); - } -} \ No newline at end of file +//package com.bsd.pjcloud.integrated.controller; +// +//import cn.hutool.core.util.StrUtil; +//import cn.hutool.core.util.ArrayUtil; +//import cn.hutool.core.collection.CollUtil; +//import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; +//import com.baomidou.mybatisplus.core.toolkit.Wrappers; +//import com.baomidou.mybatisplus.extension.plugins.pagination.Page; +//import com.bsd.pjcloud.common.core.util.R; +//import com.bsd.pjcloud.common.log.annotation.SysLog; +//import com.bsd.pjcloud.common.security.util.SecurityUtils; +//import com.bsd.pjcloud.integrated.entity.MeetingBookingEntity; +//import com.bsd.pjcloud.integrated.service.MeetingBookingService; +//import org.springframework.security.access.prepost.PreAuthorize; +//import com.bsd.pjcloud.common.excel.annotation.ResponseExcel; +//import io.swagger.v3.oas.annotations.security.SecurityRequirement; +//import org.springdoc.core.annotations.ParameterObject; +//import org.springframework.http.HttpHeaders; +//import io.swagger.v3.oas.annotations.tags.Tag; +//import io.swagger.v3.oas.annotations.Operation; +//import lombok.RequiredArgsConstructor; +//import org.springframework.web.bind.annotation.*; +//import com.bsd.pjcloud.integrated.entity.MeetingRoomEntity; +//import com.bsd.pjcloud.integrated.service.MeetingRoomService; +//import com.bsd.pjcloud.flow.task.api.feign.RemoteFlowApiFlowService; +//import com.bsd.pjcloud.flow.task.constant.TaskCheckStatusEnum; +//import com.bsd.pjcloud.flow.task.dto.ProcessInstanceParamDto; +//import com.bsd.pjcloud.flow.task.entity.Process; +//import com.bsd.pjcloud.integrated.constant.IntegratedFlowConstant; +//import com.bsd.pjcloud.integrated.dto.flow.MeetingFlowDto; +//import cn.hutool.core.bean.BeanUtil; +//import com.bsd.pjcloud.common.core.constant.enums.YesNoEnum; +//import com.bsd.pjcloud.common.core.exception.ServiceException; +//import org.springframework.transaction.annotation.Transactional; +//import java.time.LocalDate; +//import java.time.LocalTime; +//import java.util.Map; +// +//import java.util.List; +//import java.util.Objects; +//import com.bsd.pjcloud.integrated.dto.meeting.MeetingBookingSaveDto; +//import com.bsd.pjcloud.integrated.vo.meeting.MeetingBookingPageVo; +//import java.util.HashMap; +// +///** +// * 会议室预约 +// * +// * @author zjf +// * @date 2025-05-20 10:51:29 +// */ +//@RestController +//@RequiredArgsConstructor +//@RequestMapping("/meetingBooking" ) +//@Tag(description = "meetingBooking" , name = "会议室预约管理" ) +//@SecurityRequirement(name = HttpHeaders.AUTHORIZATION) +//public class MeetingBookingController { +// +// private final MeetingBookingService meetingBookingService; +// private final MeetingRoomService meetingRoomService; +// private final RemoteFlowApiFlowService remoteFlowApiFlowService; +// +// /** +// * 分页查询 +// * @param page 分页对象 +// * @param meetingBooking 会议室预约 +// * @return +// */ +// @Operation(summary = "分页查询", description = "分页查询") +// @GetMapping("/page") +// @PreAuthorize("@pms.hasPermission('integrated_meetingBooking_view')") +// public R> getMeetingBookingPage(@ParameterObject Page page, @ParameterObject MeetingBookingEntity meetingBooking) { +// LambdaQueryWrapper wrapper = Wrappers.lambdaQuery(); +// wrapper.eq(StrUtil.isNotBlank(meetingBooking.getTitle()), MeetingBookingEntity::getTitle, meetingBooking.getTitle()); +// Page entityPage = meetingBookingService.pageScope(page, wrapper); +// +// // 批量查会议室名称,避免N+1 +// List roomIds = entityPage.getRecords().stream().map(MeetingBookingEntity::getRoomId).distinct().toList(); +// Map roomNameMap = new HashMap<>(); +// if (!roomIds.isEmpty()) { +// List rooms = meetingRoomService.listByIds(roomIds); +// for (MeetingRoomEntity room : rooms) { +// roomNameMap.put(room.getId(), room.getRoomName()); +// } +// } +// +// // 转VO +// List voList = entityPage.getRecords().stream().map(e -> { +// MeetingBookingPageVo vo = new MeetingBookingPageVo(); +// vo.setId(e.getId()); +// vo.setTitle(e.getTitle()); +// vo.setRoomId(e.getRoomId()); +// vo.setRoomName(roomNameMap.get(e.getRoomId())); +// vo.setBookingDate(e.getBookingDate()); +// vo.setStartTime(e.getStartTime()); +// vo.setEndTime(e.getEndTime()); +// vo.setApplicantId(e.getApplicantId()); +// vo.setAssigneeName(e.getAssigneeName()); +// vo.setCheckStatus(e.getCheckStatus()); +// vo.setCheckReason(e.getCheckReason()); +// vo.setCreateTime(e.getCreateTime()); +// vo.setCreateBy(e.getCreateBy()); +// vo.setDescription(e.getDescription()); +// return vo; +// }).toList(); +// +// Page voPage = new Page<>(entityPage.getCurrent(), entityPage.getSize(), entityPage.getTotal()); +// voPage.setRecords(voList); +// return R.ok(voPage); +// } +// +// +// /** +// * 通过id查询会议室预约 +// * @param id id +// * @return R +// */ +// @Operation(summary = "通过id查询" , description = "通过id查询" ) +// @GetMapping("/{id}" ) +// @PreAuthorize("@pms.hasPermission('integrated_meetingBooking_view')" ) +// public R getById(@PathVariable("id" ) Long id) { +// return R.ok(meetingBookingService.getById(id)); +// } +// +// /** +// * 新增会议室预约(PC端,逻辑与手机端一致) +// * @param dto 预约参数 +// * @return R +// */ +// @Operation(summary = "新增会议室预约", description = "新增会议室预约") +// @SysLog("新增会议室预约") +// @PostMapping +// @PreAuthorize("@pms.hasPermission('integrated_meetingBooking_add')") +// @Transactional +// public R save(@RequestBody MeetingBookingSaveDto dto) { +// // 1. 参数转换 +// MeetingBookingEntity meetingBooking = new MeetingBookingEntity(); +// meetingBooking.setTitle(dto.getTitle()); +// meetingBooking.setRoomId(dto.getRoomId()); +// meetingBooking.setDescription(dto.getDescription()); +// meetingBooking.setBookingDate(LocalDate.parse(dto.getBookingDate())); +// meetingBooking.setStartTime(LocalTime.parse(dto.getStartTime())); +// meetingBooking.setEndTime(LocalTime.parse(dto.getEndTime())); +// // 2. 验证会议室是否存在 +// MeetingRoomEntity room = meetingRoomService.getById(meetingBooking.getRoomId()); +// if (room == null) { +// return R.failed("会议室不存在"); +// } +// // 3. 验证会议室状态 +// if (!YesNoEnum.NO.getCode().equals(room.getStatus())) { +// return R.failed("会议室当前不可用"); +// } +// // 4. 校验时间 +// LocalDate bookingDate = meetingBooking.getBookingDate(); +// LocalTime startTime = meetingBooking.getStartTime(); +// LocalTime endTime = meetingBooking.getEndTime(); +// if (startTime == null || endTime == null || bookingDate == null) { +// return R.failed("预约日期和时间不能为空"); +// } +// if (startTime.isAfter(endTime)) { +// return R.failed("开始时间不能晚于结束时间"); +// } +// LocalTime availableStart = LocalTime.of(8, 0); +// LocalTime availableEnd = LocalTime.of(18, 0); +// if (startTime.isBefore(availableStart) || endTime.isAfter(availableEnd)) { +// return R.failed("预约时间必须在8:00-18:00之间"); +// } +// // 5. 检查时间段是否已被预约 +// var existingBookings = meetingBookingService.list( +// Wrappers.lambdaQuery() +// .eq(MeetingBookingEntity::getRoomId, meetingBooking.getRoomId()) +// .eq(MeetingBookingEntity::getBookingDate, bookingDate) +// .eq(MeetingBookingEntity::getCheckStatus, TaskCheckStatusEnum.RESULT.getCode()) +// ); +// for (MeetingBookingEntity booking : existingBookings) { +// LocalTime bookingStart = booking.getStartTime(); +// LocalTime bookingEnd = booking.getEndTime(); +// if (!(endTime.compareTo(bookingStart) <= 0 || startTime.compareTo(bookingEnd) >= 0)) { +// return R.failed("该时间段已被预约"); +// } +// } +// // 6. 设置预约人、部门 +// meetingBooking.setApplicantId(SecurityUtils.getUser().getId()); +// meetingBooking.setDeptId(SecurityUtils.getUser().getDeptId()); +// // 7. 发起流程 +// var processByBusinessKey = remoteFlowApiFlowService.getProcessByBusinessKey(IntegratedFlowConstant.INTEGRATED_MEETING_BOOKING); +// if (!processByBusinessKey.isOk() || processByBusinessKey.getData() == null) { +// throw new ServiceException("流程配置获取失败: " + processByBusinessKey.getMsg()); +// } +// Process process = processByBusinessKey.getData(); +// MeetingFlowDto meetingFlowDto = new MeetingFlowDto(); +// meetingFlowDto.setRoomName(room.getRoomName()); +// meetingFlowDto.setApplicantName(SecurityUtils.getUser().getUsername()); +// meetingFlowDto.setMeetingTime(bookingDate + " " + startTime + "-" + endTime); +// Map stringObjectMap = BeanUtil.beanToMap(meetingFlowDto); +// ProcessInstanceParamDto processInstanceParamDto = new ProcessInstanceParamDto(); +// processInstanceParamDto.setFlowId(process.getFlowId()); +// processInstanceParamDto.setParamMap(stringObjectMap); +// var stringR = remoteFlowApiFlowService.startProcessInstance(processInstanceParamDto); +// meetingBooking.setCheckStatus(TaskCheckStatusEnum.PADDING.getCode()); +// meetingBooking.setProcessInstanceId(stringR.getData()); +// boolean success = meetingBookingService.save(meetingBooking); +// return R.ok(success); +// } +// +// /** +// * 修改会议室预约 +// * @param meetingBooking 会议室预约 +// * @return R +// */ +// @Operation(summary = "修改会议室预约" , description = "修改会议室预约" ) +// @SysLog("修改会议室预约" ) +// @PutMapping +// @PreAuthorize("@pms.hasPermission('integrated_meetingBooking_edit')" ) +// public R updateById(@RequestBody MeetingBookingEntity meetingBooking) { +// return R.ok(meetingBookingService.updateById(meetingBooking)); +// } +// +// /** +// * 通过id删除会议室预约 +// * @param ids id列表 +// * @return R +// */ +// @Operation(summary = "通过id删除会议室预约" , description = "通过id删除会议室预约" ) +// @SysLog("通过id删除会议室预约" ) +// @DeleteMapping +// @PreAuthorize("@pms.hasPermission('integrated_meetingBooking_del')" ) +// public R removeById(@RequestBody Long[] ids) { +// return R.ok(meetingBookingService.removeBatchByIds(CollUtil.toList(ids))); +// } +// +// +// /** +// * 导出excel 表格 +// * @param meetingBooking 查询条件 +// * @param ids 导出指定ID +// * @return excel 文件流 +// */ +// @ResponseExcel +// @GetMapping("/export") +// @PreAuthorize("@pms.hasPermission('integrated_meetingBooking_export')" ) +// public List export(MeetingBookingEntity meetingBooking,Long[] ids) { +// return meetingBookingService.list(Wrappers.lambdaQuery(meetingBooking).in(ArrayUtil.isNotEmpty(ids), MeetingBookingEntity::getId, ids)); +// } +//} \ No newline at end of file diff --git a/pjcloud-wallet/pjcloud-wallet-api/src/main/java/com/bsd/pjcloud/wallet/api/constant/WalletRechargeInvoiceStatusEnum.java b/pjcloud-wallet/pjcloud-wallet-api/src/main/java/com/bsd/pjcloud/wallet/api/constant/WalletRechargeInvoiceStatusEnum.java index 943e10f07..89fc939ed 100644 --- a/pjcloud-wallet/pjcloud-wallet-api/src/main/java/com/bsd/pjcloud/wallet/api/constant/WalletRechargeInvoiceStatusEnum.java +++ b/pjcloud-wallet/pjcloud-wallet-api/src/main/java/com/bsd/pjcloud/wallet/api/constant/WalletRechargeInvoiceStatusEnum.java @@ -17,7 +17,8 @@ public enum WalletRechargeInvoiceStatusEnum { BINDED("2", "已绑定充值"), UNCHECKED("3", "未审核"), CHECKED("4", "审核成功"), - CANCELLATION("5", "作废"), + FINANCE_CANCELLATION("5", "财务管理员作废"), + DEPT_CANCELLATION("6", "部门管理员作废"), ; private final String code; diff --git a/pjcloud-wallet/pjcloud-wallet-api/src/main/java/com/bsd/pjcloud/wallet/api/dto/recharge/WalletRechargeBindInvoiceDto.java b/pjcloud-wallet/pjcloud-wallet-api/src/main/java/com/bsd/pjcloud/wallet/api/dto/recharge/WalletRechargeBindInvoiceDto.java index c404f150f..99c7f91bb 100644 --- a/pjcloud-wallet/pjcloud-wallet-api/src/main/java/com/bsd/pjcloud/wallet/api/dto/recharge/WalletRechargeBindInvoiceDto.java +++ b/pjcloud-wallet/pjcloud-wallet-api/src/main/java/com/bsd/pjcloud/wallet/api/dto/recharge/WalletRechargeBindInvoiceDto.java @@ -1,8 +1,7 @@ package com.bsd.pjcloud.wallet.api.dto.recharge; -import com.bsd.pjcloud.wallet.api.vo.recharge.WalletRechargeInvoiceVo; +import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeInvoiceEntity; import lombok.Data; -import org.apache.commons.math3.optim.nonlinear.scalar.LineSearch; import java.time.LocalDateTime; import java.util.List; @@ -11,7 +10,7 @@ import java.util.List; * 充值记录绑定发票 */ @Data -public class WalletRechargeBindInvoiceDto extends WalletRechargeInvoiceVo { +public class WalletRechargeBindInvoiceDto extends WalletRechargeInvoiceEntity { /** * 充值/扣款申请id @@ -37,4 +36,6 @@ public class WalletRechargeBindInvoiceDto extends WalletRechargeInvoiceVo { * 审核时间 */ private LocalDateTime[] processTimeList; + + private Boolean isFindUserCheck = false; } diff --git a/pjcloud-wallet/pjcloud-wallet-api/src/main/java/com/bsd/pjcloud/wallet/api/vo/recharge/WalletRechargeInvoiceVo.java b/pjcloud-wallet/pjcloud-wallet-api/src/main/java/com/bsd/pjcloud/wallet/api/vo/recharge/WalletRechargeInvoiceVo.java index dda171c03..8db67ff71 100644 --- a/pjcloud-wallet/pjcloud-wallet-api/src/main/java/com/bsd/pjcloud/wallet/api/vo/recharge/WalletRechargeInvoiceVo.java +++ b/pjcloud-wallet/pjcloud-wallet-api/src/main/java/com/bsd/pjcloud/wallet/api/vo/recharge/WalletRechargeInvoiceVo.java @@ -8,4 +8,7 @@ public class WalletRechargeInvoiceVo extends WalletRechargeInvoiceEntity { private String totalPriceCnStr; + + private Boolean isCheckUser; + } diff --git a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/controller/recharge/WalletRechargeApplyController.java b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/controller/recharge/WalletRechargeApplyController.java index 23632ca28..8790d0f48 100644 --- a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/controller/recharge/WalletRechargeApplyController.java +++ b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/controller/recharge/WalletRechargeApplyController.java @@ -53,6 +53,7 @@ public class WalletRechargeApplyController { @PostMapping("/save-topup") @Operation(summary = "新增充值") + @Idempotent(expireTime = 3, info = "正在充值中,请勿重复操作") public R comparePageJoin(@RequestBody WalletRechargeSaveTopupDto dto) { walletRechargeApplyService.saveTopup(dto); return R.ok(); @@ -68,6 +69,7 @@ public class WalletRechargeApplyController { @SysLog("提交申请") @GetMapping("/apply") @PreAuthorize("@pms.hasPermission('wallet_walletRechargeApply_apply')") + @Idempotent(expireTime = 5, info = "正在申请中,请勿重复操作") public R apply(@RequestParam Long id) { walletRechargeApplyService.apply(id); return R.ok(true); diff --git a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/controller/recharge/WalletRechargeInvoiceController.java b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/controller/recharge/WalletRechargeInvoiceController.java index 170280e3a..37c5cbc50 100644 --- a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/controller/recharge/WalletRechargeInvoiceController.java +++ b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/controller/recharge/WalletRechargeInvoiceController.java @@ -95,6 +95,7 @@ public class WalletRechargeInvoiceController { public R getWalletRechargeInvoicePage(@ParameterObject Page page, @ParameterObject WalletRechargeBindInvoiceDto dto) { DataScope dataScope = DataScope.of(); dataScope.setScopeDeptName("apply_dept_id"); + dto.setIsFindUserCheck(true); return R.ok(walletRechargeInvoiceService.scopePageList(page, dto, dataScope)); } diff --git a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/mapper/recharge/WalletRechargePackageMapper.java b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/mapper/recharge/WalletRechargePackageMapper.java index 4696e6b29..61a972cba 100644 --- a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/mapper/recharge/WalletRechargePackageMapper.java +++ b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/mapper/recharge/WalletRechargePackageMapper.java @@ -3,9 +3,7 @@ package com.bsd.pjcloud.wallet.mapper.recharge; import com.baomidou.mybatisplus.extension.plugins.pagination.Page; import com.bsd.pjcloud.common.data.datascope.PjcloudBaseMapper; import com.bsd.pjcloud.wallet.api.dto.recharge.WalletRechargePackageDto; -import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargeApplyEntity; import com.bsd.pjcloud.wallet.api.entity.recharge.WalletRechargePackageEntity; -import com.bsd.pjcloud.wallet.api.vo.recharge.WalletRechargeApplyVo; import com.bsd.pjcloud.wallet.api.vo.recharge.WalletRechargePackageVo; import com.github.yulichang.wrapper.MPJLambdaWrapper; import org.apache.ibatis.annotations.Mapper; diff --git a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/impl/recharge/WalletRechargeApplyServiceImpl.java b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/impl/recharge/WalletRechargeApplyServiceImpl.java index cd4140ef7..638fdf59a 100644 --- a/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/impl/recharge/WalletRechargeApplyServiceImpl.java +++ b/pjcloud-wallet/pjcloud-wallet-biz/src/main/java/com/bsd/pjcloud/wallet/service/impl/recharge/WalletRechargeApplyServiceImpl.java @@ -193,9 +193,12 @@ public class WalletRechargeApplyServiceImpl extends ServiceImpl scopePageList(Page page, WalletRechargeBindInvoiceDto dto, DataScope dataScope) { - return baseMapper.scopePageList(page, dto, dataScope); + Page pageList = baseMapper.scopePageList(page, dto, dataScope); + disposeList(pageList.getRecords(), dto); + return pageList; } /** @@ -314,6 +320,7 @@ public class WalletRechargeInvoiceServiceImpl extends ServiceImpl list, WalletRechargeBindInvoiceDto dto) { + if (ObjectUtil.isEmpty(list)) return; + // 审批流程 + if (dto.getIsFindUserCheck()) { + List processInstanceIds = list.stream().map(WalletRechargeInvoiceVo::getProcessId).filter(ObjectUtil::isNotEmpty).distinct().toList(); + if (ObjectUtil.isNotEmpty(processInstanceIds)) { + List taskList = flowUtil.queryProcessInstanceList(SecurityUtils.getUser().getId().toString(), processInstanceIds); + if (ObjectUtil.isNotEmpty(taskList)) { + Map taskMap = CollectionUtils.convertMap(taskList, TaskDto::getProcessInstanceId); + CollectionUtils.convertList(list, v -> { + TaskDto task = taskMap.get(v.getProcessId()); + if (ObjectUtil.isNotEmpty(task)) { + v.setIsCheckUser(true); + } + return v; + }); + } + } + } + } } \ No newline at end of file diff --git a/pjcloud-wallet/pjcloud-wallet-biz/src/main/resources/mapper/recharge/WalletRechargeInvoiceMapper.xml b/pjcloud-wallet/pjcloud-wallet-biz/src/main/resources/mapper/recharge/WalletRechargeInvoiceMapper.xml index 6cd870bcd..029f31bf1 100644 --- a/pjcloud-wallet/pjcloud-wallet-biz/src/main/resources/mapper/recharge/WalletRechargeInvoiceMapper.xml +++ b/pjcloud-wallet/pjcloud-wallet-biz/src/main/resources/mapper/recharge/WalletRechargeInvoiceMapper.xml @@ -32,7 +32,7 @@ a.del_flag = '0' - + and a.status = #{dto.status} @@ -44,6 +44,9 @@ and a.dept_or_user like concat('%', #{dto.deptOrUser}, '%') + + and a.remark like concat('%', #{dto.remark}, '%') + and a.apply_user_id in