| 
					
				 | 
			
			
				@@ -0,0 +1,126 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+package com.qmrb.system.controller; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import java.util.Arrays; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import java.util.List; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import java.util.stream.Collectors; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.qmrb.system.common.exception.BusinessException; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import org.springdoc.core.annotations.ParameterObject; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import org.springframework.beans.factory.annotation.Autowired; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import org.springframework.security.access.prepost.PreAuthorize; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import org.springframework.validation.annotation.Validated; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import org.springframework.web.bind.annotation.CrossOrigin; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import org.springframework.web.bind.annotation.DeleteMapping; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import org.springframework.web.bind.annotation.GetMapping; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import org.springframework.web.bind.annotation.PathVariable; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import org.springframework.web.bind.annotation.PostMapping; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import org.springframework.web.bind.annotation.PutMapping; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import org.springframework.web.bind.annotation.RequestBody; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import org.springframework.web.bind.annotation.RequestMapping; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import io.swagger.v3.oas.annotations.Operation; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import io.swagger.v3.oas.annotations.Parameter; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import io.swagger.v3.oas.annotations.security.SecurityRequirement; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import io.swagger.v3.oas.annotations.tags.Tag; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.baomidou.mybatisplus.extension.plugins.pagination.Page; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.qmrb.system.common.result.PageResult; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.qmrb.system.common.result.Result; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.qmrb.system.common.result.ResultCode; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.qmrb.system.framework.resubmit.Resubmit; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.qmrb.system.service.IMyCarPlateNumberService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.qmrb.system.pojo.form.MyCarPlateNumberForm; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.qmrb.system.pojo.vo.MyCarPlateNumberVO; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.qmrb.system.pojo.query.MyCarPlateNumberQuery; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import com.qmrb.system.pojo.vo.Option; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import cn.hutool.core.util.StrUtil; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import org.springframework.web.bind.annotation.RestController; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+import jakarta.validation.Valid; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+/** 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ * <p> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ * 我的车牌 前端控制器 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ * </p> 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ * 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ * @author gs 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ * @since 2025-02-24 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ */ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+@Tag(name = "我的车牌接口") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+@RestController 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+@RequestMapping("/api/v1/car_plate_number") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+@CrossOrigin 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+public class MyCarPlateNumberController{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Autowired 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    private IMyCarPlateNumberService myCarPlateNumberService; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	@Operation(summary = "我的车牌分页列表", security = {@SecurityRequirement(name = "Authorization")}) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @GetMapping("/page") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public PageResult<MyCarPlateNumberVO> getPage( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            @ParameterObject MyCarPlateNumberQuery queryParams 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    ) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        Page<MyCarPlateNumberVO> result = myCarPlateNumberService.getPage(queryParams); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return PageResult.success(result); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Operation(summary = "我的车牌分页列表", security = {@SecurityRequirement(name = "Authorization")}) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @GetMapping("/getPageByUserId") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public PageResult<MyCarPlateNumberVO> getPageByUserId( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            @ParameterObject MyCarPlateNumberQuery queryParams 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    ) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        if(queryParams.getUserId() == null){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            throw new BusinessException("用户id不能为空"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        Page<MyCarPlateNumberVO> result = myCarPlateNumberService.getPage(queryParams); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return PageResult.success(result); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+     
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Operation(summary = "新增我的车牌", security = {@SecurityRequirement(name = "Authorization")}) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @PostMapping 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @PreAuthorize("@ss.hasPerm('car_plate_number:add')") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Resubmit 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public Result<MyCarPlateNumberForm> saveForm( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            @RequestBody @Valid MyCarPlateNumberForm form 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    ) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        MyCarPlateNumberForm result = myCarPlateNumberService.saveForm(form); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return Result.success(result); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Operation(summary = "我的车牌表单数据", security = {@SecurityRequirement(name = "Authorization")}) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @GetMapping("/{id}/form") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public Result<MyCarPlateNumberForm> getForm( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            @Parameter(description = "我的车牌ID") @PathVariable Long id 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    ) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    	MyCarPlateNumberForm formData = myCarPlateNumberService.getFormData(id); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return Result.success(formData); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Operation(summary = "修改我的车牌", security = {@SecurityRequirement(name = "Authorization")}) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @PutMapping(value = "/{id}") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @PreAuthorize("@ss.hasPerm('car_plate_number:edit')") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public Result<?> updateForm( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            @Parameter(description = "我的车牌ID") @PathVariable Long id, 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            @RequestBody @Validated MyCarPlateNumberForm form) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    	 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        boolean result = myCarPlateNumberService.updateForm(id,form); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return Result.judge(result); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @Operation(summary = "删除我的车牌", security = {@SecurityRequirement(name = "Authorization")}) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @DeleteMapping("/{ids}") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    @PreAuthorize("@ss.hasPerm('car_plate_number:delete')") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    public Result<?> deleteUsers( 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+            @Parameter(description = "我的车牌ID,多个以英文逗号(,)分割") @PathVariable String ids 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    ) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    	if(StrUtil.isBlank(ids)) { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    		 return Result.failed(ResultCode.PARAM_ERROR, "删除的我的车牌数据为空"); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    	} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        // 逻辑删除 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        List<Long> idList = Arrays.asList(ids.split(",")).stream() 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+                .map(idStr -> Long.parseLong(idStr)).collect(Collectors.toList()); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        boolean result = myCarPlateNumberService.removeByIds(idList); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+        return Result.judge(result); 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+    } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+} 
			 |