Merge branch 'master' of https://codeup.aliyun.com/bsdtec/biz-api-cloud
This commit is contained in:
commit
7ff1eb93dc
6 files changed
+130
-6
No files matched your search
+1
@@ -52,4 +52,5 @@ public class FeedbackAppDTO {
|
||||
@Schema(description="创建时间")
|
||||
private LocalDateTime createTime;
|
||||
|
||||
|
||||
}
|
||||
+10
@@ -6,6 +6,7 @@ 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.admin.api.feign.RemoteDictService;
|
||||
import com.bsd.pjcloud.common.core.util.BeanUtils;
|
||||
import com.bsd.pjcloud.common.core.util.R;
|
||||
import com.bsd.pjcloud.common.log.annotation.SysLog;
|
||||
@@ -41,6 +42,9 @@ public class FeedbackController {
|
||||
|
||||
private final FeedbackService feedbackService;
|
||||
|
||||
|
||||
private final RemoteDictService remoteDictService;
|
||||
|
||||
/**
|
||||
* 分页查询
|
||||
* @param page 分页对象
|
||||
@@ -173,4 +177,10 @@ public class FeedbackController {
|
||||
wrapper.eq(FeedbackEntity::getId,id);
|
||||
return R.ok(feedbackService.list(wrapper));
|
||||
}
|
||||
|
||||
@Operation(summary = "获取反馈类型" , description = "获取反馈类型" )
|
||||
@GetMapping("/app/getFeedbackType" )
|
||||
public R getFeedbackType() {
|
||||
return R.ok(remoteDictService.getDictByType("feedback_type"));
|
||||
}
|
||||
}
|
||||
+51
@@ -6,8 +6,10 @@ 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.BeanUtils;
|
||||
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.MaintenanceOrderEntity;
|
||||
import com.bsd.pjcloud.integrated.service.MaintenanceOrderService;
|
||||
import org.springframework.security.access.prepost.PreAuthorize;
|
||||
@@ -19,6 +21,7 @@ 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.dto.MaintenanceOrderAppCreateDTO;
|
||||
|
||||
import java.util.List;
|
||||
import java.util.Objects;
|
||||
@@ -118,4 +121,52 @@ public class MaintenanceOrderController {
|
||||
public List<MaintenanceOrderEntity> export(MaintenanceOrderEntity maintenanceOrder,Long[] ids) {
|
||||
return maintenanceOrderService.list(Wrappers.lambdaQuery(maintenanceOrder).in(ArrayUtil.isNotEmpty(ids), MaintenanceOrderEntity::getId, ids));
|
||||
}
|
||||
|
||||
/**
|
||||
* App端-维修申请新增
|
||||
* @param dto 维修工单申请参数
|
||||
* @return R
|
||||
*/
|
||||
@PostMapping("/app/apply")
|
||||
@Operation(summary = "App端-维修申请新增", description = "App端用户提交维修申请")
|
||||
@SysLog("App端-维修申请新增")
|
||||
@PreAuthorize("@pms.hasPermission('integrated_maintenanceOrder_add')")
|
||||
public R appApply(@RequestBody MaintenanceOrderAppCreateDTO dto) {
|
||||
Long userId = SecurityUtils.getUser().getId();
|
||||
MaintenanceOrderEntity bean = BeanUtils.toBean(dto, MaintenanceOrderEntity.class);
|
||||
bean.setUserId(userId);
|
||||
return R.ok(maintenanceOrderService.save(bean));
|
||||
}
|
||||
|
||||
/**
|
||||
* App端-我的维修分页列表
|
||||
* @param page 分页对象
|
||||
* @return R
|
||||
*/
|
||||
@GetMapping("/app/my")
|
||||
@Operation(summary = "App端-我的维修分页列表", description = "App端用户分页查询自己的维修单")
|
||||
@PreAuthorize("@pms.hasPermission('integrated_maintenanceOrder_view')")
|
||||
public R myMaintenanceOrders(@ParameterObject Page page) {
|
||||
Long userId = SecurityUtils.getUser().getId();
|
||||
LambdaQueryWrapper<MaintenanceOrderEntity> wrapper = Wrappers.lambdaQuery();
|
||||
wrapper.eq(MaintenanceOrderEntity::getUserId, userId);
|
||||
return R.ok(maintenanceOrderService.page(page, wrapper));
|
||||
}
|
||||
|
||||
/**
|
||||
* App端-我的维修单详情
|
||||
* @param id 维修单ID
|
||||
* @return R
|
||||
*/
|
||||
@GetMapping("/app/my/{id}")
|
||||
@Operation(summary = "App端-我的维修单详情", description = "App端用户查看自己维修单详情")
|
||||
@PreAuthorize("@pms.hasPermission('integrated_maintenanceOrder_view')")
|
||||
public R myMaintenanceOrderDetail(@PathVariable("id") Long id) {
|
||||
Long userId = SecurityUtils.getUser().getId();
|
||||
MaintenanceOrderEntity entity = maintenanceOrderService.getById(id);
|
||||
if (entity == null || !Objects.equals(entity.getUserId(), userId)) {
|
||||
return R.failed("无权查看该维修单");
|
||||
}
|
||||
return R.ok(entity);
|
||||
}
|
||||
}
|
||||
+56
-3
@@ -281,9 +281,8 @@ public class MeetingRoomController {
|
||||
for (MeetingBookingEntity booking : existingBookings) {
|
||||
LocalTime bookingStart = booking.getStartTime();
|
||||
LocalTime bookingEnd = booking.getEndTime();
|
||||
|
||||
// 修改判断逻辑:只要有任何重叠就表示冲突
|
||||
if (!(endTime.isBefore(bookingStart) || startTime.isAfter(bookingEnd))) {
|
||||
// 只要不是完全无交集就算冲突
|
||||
if (!(endTime.compareTo(bookingStart) <= 0 || startTime.compareTo(bookingEnd) >= 0)) {
|
||||
return R.failed("该时间段已被预约");
|
||||
}
|
||||
}
|
||||
@@ -304,4 +303,58 @@ public class MeetingRoomController {
|
||||
return R.ok(success);
|
||||
}
|
||||
|
||||
/**
|
||||
* 我的预约 - 分页,支持checkStatus筛选
|
||||
* @param page 分页对象
|
||||
* @param checkStatus 审核状态(可选),传空查全部
|
||||
*/
|
||||
@GetMapping("/app/my-bookings")
|
||||
public R<Page<MeetingBookingEntity>> myBookings(@ParameterObject Page page, @RequestParam(value = "checkStatus", required = false) String checkStatus) {
|
||||
Long userId = SecurityUtils.getUser().getId();
|
||||
LambdaQueryWrapper<MeetingBookingEntity> wrapper = Wrappers.<MeetingBookingEntity>lambdaQuery()
|
||||
.eq(MeetingBookingEntity::getApplicantId, userId);
|
||||
if (checkStatus != null && !checkStatus.isEmpty()) {
|
||||
wrapper.eq(MeetingBookingEntity::getCheckStatus, checkStatus);
|
||||
}
|
||||
wrapper.orderByDesc(MeetingBookingEntity::getBookingDate)
|
||||
.orderByDesc(MeetingBookingEntity::getStartTime);
|
||||
Page<MeetingBookingEntity> result = meetingBookingService.page(page, wrapper);
|
||||
return R.ok(result);
|
||||
}
|
||||
|
||||
/**
|
||||
* 取消预约
|
||||
*/
|
||||
@PostMapping("/app/cancel-booking/{bookingId}")
|
||||
public R<Boolean> cancelBooking(@PathVariable("bookingId") Long bookingId) {
|
||||
Long userId = SecurityUtils.getUser().getId();
|
||||
MeetingBookingEntity booking = meetingBookingService.getById(bookingId);
|
||||
if (booking == null) {
|
||||
return R.failed("预约不存在");
|
||||
}
|
||||
if (!Objects.equals(booking.getApplicantId(), userId)) {
|
||||
return R.failed("无权取消他人预约");
|
||||
}
|
||||
// 设置checkStatus为4(已取消)
|
||||
booking.setCheckStatus("4");
|
||||
boolean updated = meetingBookingService.updateById(booking);
|
||||
return R.ok(updated);
|
||||
}
|
||||
|
||||
/**
|
||||
* 预约详情
|
||||
*/
|
||||
@GetMapping("/app/booking-detail/{bookingId}")
|
||||
public R<MeetingBookingEntity> bookingDetail(@PathVariable("bookingId") Long bookingId) {
|
||||
Long userId = SecurityUtils.getUser().getId();
|
||||
MeetingBookingEntity booking = meetingBookingService.getById(bookingId);
|
||||
if (booking == null) {
|
||||
return R.failed("预约不存在");
|
||||
}
|
||||
if (!Objects.equals(booking.getApplicantId(), userId)) {
|
||||
return R.failed("无权查看他人预约详情");
|
||||
}
|
||||
return R.ok(booking);
|
||||
}
|
||||
|
||||
}
|
||||
+11
-3
@@ -30,9 +30,9 @@ public class MaintenanceOrderEntity extends Model<MaintenanceOrderEntity> {
|
||||
private Long id;
|
||||
|
||||
/**
|
||||
* 标题
|
||||
* 设备名称
|
||||
*/
|
||||
@Schema(description="标题")
|
||||
@Schema(description="设备名称")
|
||||
private String title;
|
||||
|
||||
/**
|
||||
@@ -74,7 +74,7 @@ public class MaintenanceOrderEntity extends Model<MaintenanceOrderEntity> {
|
||||
/**
|
||||
* 发现地点
|
||||
*/
|
||||
@Schema(description="发现地点")
|
||||
@Schema(description="设备位置")
|
||||
private String location;
|
||||
|
||||
/**
|
||||
@@ -130,4 +130,12 @@ public class MaintenanceOrderEntity extends Model<MaintenanceOrderEntity> {
|
||||
*/
|
||||
@Schema(description="租户编号")
|
||||
private Long tenantId;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* 维修类型
|
||||
*/
|
||||
@Schema(description="维修类型")
|
||||
private Long maintainType;
|
||||
}
|
||||
+1
@@ -21,5 +21,6 @@
|
||||
<result property="updateTime" column="update_time"/>
|
||||
<result property="delFlag" column="del_flag"/>
|
||||
<result property="tenantId" column="tenant_id"/>
|
||||
<result property="maintainType" column="maintain_type"/>
|
||||
</resultMap>
|
||||
</mapper>
|
||||
Reference in new issue
Block a user