|
@@ -1,5 +1,6 @@
|
|
|
package com.qmrb.system.controller;
|
|
|
|
|
|
+import java.io.UnsupportedEncodingException;
|
|
|
import java.util.Arrays;
|
|
|
import java.util.List;
|
|
|
import java.util.stream.Collectors;
|
|
@@ -9,6 +10,9 @@ import cn.hutool.core.lang.Assert;
|
|
|
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
|
|
import com.qmrb.system.pojo.entity.BarnRecord;
|
|
|
import org.apache.commons.lang3.StringUtils;
|
|
|
+import org.apache.rocketmq.client.exception.MQBrokerException;
|
|
|
+import org.apache.rocketmq.client.exception.MQClientException;
|
|
|
+import org.apache.rocketmq.remoting.exception.RemotingException;
|
|
|
import org.springdoc.core.annotations.ParameterObject;
|
|
|
import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.security.access.prepost.PreAuthorize;
|
|
@@ -52,12 +56,24 @@ import jakarta.validation.Valid;
|
|
|
@RestController
|
|
|
@RequestMapping("/api/v1/record")
|
|
|
@CrossOrigin
|
|
|
-public class BarnRecordController{
|
|
|
+public class BarnRecordController {
|
|
|
|
|
|
@Autowired
|
|
|
private IBarnRecordService barnRecordService;
|
|
|
|
|
|
- @Operation(summary = "岗亭端停车记录分页列表", security = {@SecurityRequirement(name = "Authorization")})
|
|
|
+
|
|
|
+
|
|
|
+ @Operation(summary = "应急取车", security = {@SecurityRequirement(name = "Authorization")})
|
|
|
+ @PutMapping(value = "/takeCar/{id}")
|
|
|
+ public Result<?> takeCar(
|
|
|
+ @Parameter(description = "岗亭端停车记录ID") @PathVariable Long id,
|
|
|
+ @RequestBody @Validated BarnRecordForm form) throws MQBrokerException, RemotingException, UnsupportedEncodingException, InterruptedException, MQClientException {
|
|
|
+
|
|
|
+ boolean result = barnRecordService.takeCar(id, form);
|
|
|
+ return Result.judge(result);
|
|
|
+ }
|
|
|
+
|
|
|
+ @Operation(summary = "岗亭端停车记录分页列表", security = {@SecurityRequirement(name = "Authorization")})
|
|
|
@GetMapping("/page")
|
|
|
public PageResult<BarnRecordVO> getPage(
|
|
|
@ParameterObject BarnRecordQuery queryParams
|
|
@@ -65,25 +81,26 @@ public class BarnRecordController{
|
|
|
Page<BarnRecordVO> result = barnRecordService.getPage(queryParams);
|
|
|
return PageResult.success(result);
|
|
|
}
|
|
|
-
|
|
|
-
|
|
|
+
|
|
|
+
|
|
|
@Operation(summary = "岗亭端停车记录列表", security = {@SecurityRequirement(name = "Authorization")})
|
|
|
@GetMapping("/listByPlateNumber")
|
|
|
public PageResult<BarnRecordVO> listByPlateNumber(
|
|
|
@ParameterObject BarnRecordQuery queryParams
|
|
|
) {
|
|
|
// Assert.isTrue(StringUtils.isNotBlank(queryParams.getCarNumber()), "请输入车牌号");
|
|
|
- Page<BarnRecordVO> result = barnRecordService.getPage(queryParams);
|
|
|
+ Page<BarnRecordVO> result = barnRecordService.getPage(queryParams);
|
|
|
return PageResult.success(result);
|
|
|
}
|
|
|
+
|
|
|
@Operation(summary = "批量新增或者修改多条岗亭端停车记录", security = {@SecurityRequirement(name = "Authorization")})
|
|
|
@PostMapping("/saveBatchOrUpdate")
|
|
|
@Resubmit
|
|
|
public Result<?> saveOrUpdateBatch(@RequestBody @Valid List<BarnRecordForm> list) {
|
|
|
List<BarnRecordForm> result = barnRecordService.saveBatchOrUpdate(list);
|
|
|
- if (CollectionUtil.isNotEmpty(result)){
|
|
|
+ if (CollectionUtil.isNotEmpty(result)) {
|
|
|
return Result.success(result);
|
|
|
- }else{
|
|
|
+ } else {
|
|
|
return Result.failed("批量新增或者修改多条岗亭端停车记录失败");
|
|
|
}
|
|
|
}
|
|
@@ -103,17 +120,21 @@ public class BarnRecordController{
|
|
|
public Result<BarnRecordForm> getForm(
|
|
|
@Parameter(description = "岗亭端停车记录ID") @PathVariable Long id
|
|
|
) {
|
|
|
- BarnRecordForm formData = barnRecordService.getFormData(id);
|
|
|
+ BarnRecordForm formData = barnRecordService.getFormData(id);
|
|
|
return Result.success(formData);
|
|
|
}
|
|
|
-
|
|
|
+
|
|
|
@Operation(summary = "岗亭端停车记录金额数据", security = {@SecurityRequirement(name = "Authorization")})
|
|
|
@GetMapping("/{id}/getCarParkUseLogOrder")
|
|
|
public Result<BarnRecordForm> getCarParkUseLogOrder(
|
|
|
@Parameter(description = "岗亭端停车记录ID") @PathVariable Long id,
|
|
|
@ParameterObject Boolean isMonthlyCardMode
|
|
|
) {
|
|
|
+<<<<<<< Updated upstream
|
|
|
BarnRecordForm formData = barnRecordService.getCarParkUseLogOrder(id,isMonthlyCardMode);
|
|
|
+=======
|
|
|
+ BarnRecordForm formData = barnRecordService.getCarParkUseLogOrder(id);
|
|
|
+>>>>>>> Stashed changes
|
|
|
return Result.success(formData);
|
|
|
}
|
|
|
|
|
@@ -122,8 +143,8 @@ public class BarnRecordController{
|
|
|
public Result<?> updateForm(
|
|
|
@Parameter(description = "岗亭端停车记录ID") @PathVariable Long id,
|
|
|
@RequestBody @Validated BarnRecordForm form) {
|
|
|
-
|
|
|
- boolean result = barnRecordService.updateForm(id,form);
|
|
|
+
|
|
|
+ boolean result = barnRecordService.updateForm(id, form);
|
|
|
return Result.judge(result);
|
|
|
}
|
|
|
|
|
@@ -132,9 +153,9 @@ public class BarnRecordController{
|
|
|
public Result<?> deleteUsers(
|
|
|
@Parameter(description = "岗亭端停车记录ID,多个以英文逗号(,)分割") @PathVariable String ids
|
|
|
) {
|
|
|
- if(StrUtil.isBlank(ids)) {
|
|
|
- return Result.failed(ResultCode.PARAM_ERROR, "删除的岗亭端停车记录数据为空");
|
|
|
- }
|
|
|
+ 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());
|