kongdeqiang
2024-04-22 7bc78d8f70a4d11e46f8bd640228804a3dd0dc68
src/main/java/com/boying/controller/BarrierController.java
@@ -12,6 +12,8 @@
import com.boying.service.OutParkService;
import com.boying.service.ParkService;
import com.boying.util.RedisJsonUtil;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.data.redis.core.StringRedisTemplate;
import org.springframework.web.bind.annotation.PostMapping;
@@ -27,6 +29,7 @@
@RestController
@RequestMapping("ffzf/barrier")
@RequiredArgsConstructor
@Tag(description = "ffzf/barrier" , name = "道闸接口" )
public class BarrierController {
    private final BarrierService barrierService;
@@ -37,6 +40,7 @@
    @PostMapping("findPage")
    @Operation(summary = "根据停车场分页查询道闸" , description = "根据停车场分页查询道闸" )
    public Object findPage(Page page, String parkId) {
        QueryWrapper<Barrier> wrapper = new QueryWrapper<>();
        wrapper.lambda()
@@ -54,6 +58,7 @@
    }
    @PostMapping("save")
    @Operation(summary = "新增道闸" , description = "新增道闸" )
    public Object save(Barrier barrier) {
        barrier.setUpdateTime(LocalDateTime.now());
        barrierService.saveOrUpdate(barrier);
@@ -67,6 +72,7 @@
    }
    @PostMapping("delete")
    @Operation(summary = "删除道闸" , description = "删除道闸" )
    public Object delete(Integer id) {
        Barrier byId = barrierService.getById(id);
        barrierService.removeById(id);
@@ -75,6 +81,7 @@
    }
    @PostMapping("findAll")
    @Operation(summary = "查询所有道闸(APP)" , description = "查询所有道闸(APP)" )
    public Object findAll(Long parkId) {
        if (parkId==null) {
            return R.failed("未发现该停车场");
@@ -86,6 +93,7 @@
    }
    @PostMapping("open")
    @Operation(summary = "手动开闸(废弃)" , description = "手动开闸(废弃)" )
    public Object open(Long barrierId) {
        Barrier b=  barrierService.getById(barrierId);
        if (b==null) {
@@ -104,6 +112,7 @@
    }
    @PostMapping("getByCode")
    @Operation(summary = "根据code查询道闸" , description = "根据code查询道闸" )
    public Object getByCode(String code) {
        Barrier b=  barrierService.findByCode2(code);
        if (b==null) {
@@ -116,6 +125,7 @@
    @PostMapping("openBarrier")
    @Operation(summary = "手持手动开闸" , description = "手持手动开闸" )
    public Object openBarrier(Long barrierId,Integer type,String carNo,String remark) {
        Barrier b=  barrierService.getById(barrierId);
        if (b==null) {