| | |
| | | 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 io.swagger.annotations.Tag; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | |
| | | @RestController |
| | | @RequestMapping("ffzf/barrier") |
| | | @RequiredArgsConstructor |
| | | @Tag(description = "ffzf/barrier" , name = "道闸接口" ) |
| | | public class BarrierController { |
| | | |
| | | private final BarrierService barrierService; |
| | |
| | | |
| | | |
| | | @PostMapping("findPage") |
| | | @Operation(summary = "根据停车场分页查询道闸" , description = "根据停车场分页查询道闸" ) |
| | | // @Operation(summary = "根据停车场分页查询道闸" , description = "根据停车场分页查询道闸" ) |
| | | public Object findPage(Page page, String parkId) { |
| | | QueryWrapper<Barrier> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda() |
| | |
| | | } |
| | | |
| | | @PostMapping("save") |
| | | @Operation(summary = "新增道闸" , description = "新增道闸" ) |
| | | // @Operation(summary = "新增道闸" , description = "新增道闸" ) |
| | | public Object save(Barrier barrier) { |
| | | barrier.setUpdateTime(LocalDateTime.now()); |
| | | barrierService.saveOrUpdate(barrier); |
| | |
| | | } |
| | | |
| | | @PostMapping("delete") |
| | | @Operation(summary = "删除道闸" , description = "删除道闸" ) |
| | | //@Operation(summary = "删除道闸" , description = "删除道闸" ) |
| | | public Object delete(Integer id) { |
| | | Barrier byId = barrierService.getById(id); |
| | | barrierService.removeById(id); |
| | |
| | | } |
| | | |
| | | @PostMapping("findAll") |
| | | @Operation(summary = "查询所有道闸(APP)" , description = "查询所有道闸(APP)" ) |
| | | //@Operation(summary = "查询所有道闸(APP)" , description = "查询所有道闸(APP)" ) |
| | | public Object findAll(Long parkId) { |
| | | if (parkId==null) { |
| | | return R.failed("未发现该停车场"); |
| | |
| | | } |
| | | |
| | | @PostMapping("open") |
| | | @Operation(summary = "手动开闸(废弃)" , description = "手动开闸(废弃)" ) |
| | | // @Operation(summary = "手动开闸(废弃)" , description = "手动开闸(废弃)" ) |
| | | public Object open(Long barrierId) { |
| | | Barrier b= barrierService.getById(barrierId); |
| | | if (b==null) { |
| | |
| | | } |
| | | |
| | | @PostMapping("getByCode") |
| | | @Operation(summary = "根据code查询道闸" , description = "根据code查询道闸" ) |
| | | // @Operation(summary = "根据code查询道闸" , description = "根据code查询道闸" ) |
| | | public Object getByCode(String code) { |
| | | Barrier b= barrierService.findByCode2(code); |
| | | if (b==null) { |
| | |
| | | |
| | | |
| | | @PostMapping("openBarrier") |
| | | @Operation(summary = "手持手动开闸" , description = "手持手动开闸" ) |
| | | // @Operation(summary = "手持手动开闸" , description = "手持手动开闸" ) |
| | | public Object openBarrier(Long barrierId,Integer type,String carNo,String remark) { |
| | | Barrier b= barrierService.getById(barrierId); |
| | | if (b==null) { |
| | |
| | | } |
| | | |
| | | @PostMapping("getDisConnect") |
| | | @Operation(summary = "设备掉线通知" , description = "设备掉线通知" ) |
| | | //@Operation(summary = "设备掉线通知" , description = "设备掉线通知" ) |
| | | public Object getDisConnect() { |
| | | List<Map<String,Object>> resultlist = new ArrayList<>(); |
| | | String barrierCodeAll = redisTemplate.opsForValue().get("barrierCode_all"); |