Merge branch 'master2'
# Conflicts:
# src/main/java/com/boying/controller/ParkController.java
# src/main/java/com/boying/controller/car/PlateServlet3.java
| | |
| | | <artifactId>signature</artifactId> |
| | | <version>1.1.0.6</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.eclipse.paho</groupId> |
| | | <artifactId>org.eclipse.paho.client.mqttv3</artifactId> |
| | | <version>1.0.2</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>com.github.xiaoymin</groupId> |
| | | <artifactId>knife4j-openapi3-spring-boot-starter</artifactId> |
| | | <version>4.0.0</version> |
| | | </dependency> |
| | | <dependency> |
| | | <groupId>org.springdoc</groupId> |
| | | <artifactId>springdoc-openapi-ui</artifactId> |
| | | <version>1.6.14</version> |
| | | </dependency> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>com.led</groupId>--> |
| | | <!-- <artifactId>show</artifactId>--> |
| | | <!-- <version>0.0.0.1</version>--> |
| | | <!-- </dependency>--> |
| | | <!-- <dependency>--> |
| | | <!-- <groupId>net.sf</groupId>--> |
| | | <!-- <artifactId>jni4net</artifactId>--> |
| | | <!-- <version>0.8.8.0</version>--> |
| | | <!-- </dependency>--> |
| | | |
| | | </dependencies> |
| | | |
| | | <build> |
| | |
| | | |
| | | |
| | | import cn.hutool.core.io.resource.ClassPathResource; |
| | | import net.sf.jni4net.Bridge; |
| | | //import net.sf.jni4net.Bridge; |
| | | import org.springframework.boot.SpringApplication; |
| | | import org.springframework.boot.autoconfigure.SpringBootApplication; |
| | | import org.springframework.context.annotation.Bean; |
| | |
| | | SpringApplication.run(Application.class, args); |
| | | } |
| | | |
| | | @Bean |
| | | public static void getBean() throws IOException { |
| | | Bridge.setVerbose(true); |
| | | Bridge.init(); |
| | | File loadDll = new File("LedShow.j4n.dll"); |
| | | Bridge.LoadAndRegisterAssemblyFrom(loadDll); |
| | | } |
| | | // @Bean |
| | | // public static void getBean() throws IOException { |
| | | // Bridge.setVerbose(true); |
| | | // Bridge.init(); |
| | | // File loadDll = new File("LedShow.j4n.dll"); |
| | | // Bridge.LoadAndRegisterAssemblyFrom(loadDll); |
| | | // } |
| | | } |
| | |
| | | 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; |
| | |
| | | @RestController |
| | | @RequestMapping("ffzf/barrier") |
| | | @RequiredArgsConstructor |
| | | @Tag(description = "ffzf/barrier" , name = "道闸接口" ) |
| | | public class BarrierController { |
| | | |
| | | private final BarrierService barrierService; |
| | |
| | | |
| | | |
| | | @PostMapping("findPage") |
| | | @Operation(summary = "根据停车场分页查询道闸" , description = "根据停车场分页查询道闸" ) |
| | | public Object findPage(Page page, String parkId) { |
| | | QueryWrapper<Barrier> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda() |
| | |
| | | } |
| | | |
| | | @PostMapping("save") |
| | | @Operation(summary = "新增道闸" , description = "新增道闸" ) |
| | | public Object save(Barrier barrier) { |
| | | barrier.setUpdateTime(LocalDateTime.now()); |
| | | barrierService.saveOrUpdate(barrier); |
| | |
| | | } |
| | | |
| | | @PostMapping("delete") |
| | | @Operation(summary = "删除道闸" , description = "删除道闸" ) |
| | | public Object delete(Integer id) { |
| | | Barrier byId = barrierService.getById(id); |
| | | barrierService.removeById(id); |
| | |
| | | } |
| | | |
| | | @PostMapping("findAll") |
| | | @Operation(summary = "查询所有道闸(APP)" , description = "查询所有道闸(APP)" ) |
| | | public Object findAll(Long parkId) { |
| | | if (parkId==null) { |
| | | return R.failed("未发现该停车场"); |
| | |
| | | } |
| | | |
| | | @PostMapping("open") |
| | | @Operation(summary = "手动开闸(废弃)" , description = "手动开闸(废弃)" ) |
| | | public Object open(Long barrierId) { |
| | | Barrier b= barrierService.getById(barrierId); |
| | | if (b==null) { |
| | |
| | | } |
| | | |
| | | @PostMapping("getByCode") |
| | | @Operation(summary = "根据code查询道闸" , description = "根据code查询道闸" ) |
| | | public Object getByCode(String code) { |
| | | Barrier b= barrierService.findByCode2(code); |
| | | if (b==null) { |
| | |
| | | |
| | | |
| | | @PostMapping("openBarrier") |
| | | @Operation(summary = "手持手动开闸" , description = "手持手动开闸" ) |
| | | public Object openBarrier(Long barrierId,Integer type,String carNo,String remark) { |
| | | Barrier b= barrierService.getById(barrierId); |
| | | if (b==null) { |
| | |
| | | import com.boying.service.BarrierService; |
| | | import com.boying.service.OutParkService; |
| | | import com.boying.service.ParkService; |
| | | 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; |
| | |
| | | @RestController |
| | | @RequestMapping("ffzf/barrierOpenLog") |
| | | @RequiredArgsConstructor |
| | | @Tag(description = "ffzf/barrierOpenLog" , name = "手动开闸日志" ) |
| | | public class BarrierOpenLogController { |
| | | |
| | | private final BarrierOpenLogService barrierOpenLogService; |
| | |
| | | |
| | | |
| | | @PostMapping("findPage") |
| | | @Operation(summary = "分页查询" , description = "分页查询" ) |
| | | public Object findPage(Page page, Integer parkId,String carNo) { |
| | | QueryWrapper<BarrierOpenLog> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda() |
| | |
| | | import com.boying.service.ParkService; |
| | | import com.boying.util.DateUtilOther; |
| | | import com.fasterxml.jackson.databind.ObjectMapper; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | |
| | | @RestController |
| | | @RequestMapping("ffzf/rule") |
| | | @RequiredArgsConstructor |
| | | @Tag(description = "ffzf/rule" , name = "缴费规则" ) |
| | | public class CostRuleController{ |
| | | |
| | | private final CostRuleService costRuleService; |
| | | private final ParkService parkService; |
| | | |
| | | @GetMapping("test") |
| | | @Operation(summary = "测试" , description = "测试" ) |
| | | public Object save(String start,String end) throws ParseException { |
| | | double money = costRuleService.getMoney(4, DateUtilOther.stringToLocalDate(start,null), DateUtilOther.stringToLocalDate(end, null), 1); |
| | | return R.ok(money); |
| | | } |
| | | |
| | | @PostMapping("/findPage") |
| | | @Operation(summary = "分页查询" , description = "分页查询" ) |
| | | public Object findPage(Page page,CostRule costRule) { |
| | | QueryWrapper<CostRule> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda() |
| | |
| | | return R.ok(page1);} |
| | | |
| | | @PostMapping("/save") |
| | | @Operation(summary = "新增规则" , description = "新增规则" ) |
| | | public Object save(CostRule costRule) { |
| | | costRuleService.saveOrUpdate(costRule); |
| | | return R.ok("保存成功"); |
| | |
| | | |
| | | |
| | | @PostMapping("/delete") |
| | | @Operation(summary = "删除规则" , description = "删除规则" ) |
| | | public Object delete(Long id) { |
| | | costRuleService.removeById(id); |
| | | return R.ok("删除成功"); |
| | |
| | | import com.boying.service.ParkService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.RequiredArgsConstructor; |
| | | |
| | | import org.springframework.web.bind.annotation.*; |
| | |
| | | @RequiredArgsConstructor |
| | | @RequestMapping("ffzf/enterpark" ) |
| | | @Api(value = "enterpark", tags = "入场表管理") |
| | | @Tag(description = "ffzf/enterpark" , name = "入场表记录" ) |
| | | public class EnterParkController { |
| | | |
| | | private final EnterParkService enterParkService; |
| | |
| | | // } |
| | | |
| | | @PostMapping("/findPage") |
| | | @Operation(summary = "分页查询" , description = "分页查询" ) |
| | | public Object findPage(Page page, String carNo,Integer parkId,String date) throws ParseException { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | if(StringUtils.isNotBlank(date)){ |
| | |
| | | */ |
| | | @ApiOperation(value = "通过id查询", notes = "通过id查询") |
| | | @GetMapping("/{id}" ) |
| | | @Operation(summary = "根据id查询" , description = "根据id查询" ) |
| | | public R getById(@PathVariable("id" ) Integer id) { |
| | | return R.ok(enterParkService.getById(id)); |
| | | } |
| | |
| | | */ |
| | | @ApiOperation(value = "新增入场表", notes = "新增入场表") |
| | | @PostMapping |
| | | @Operation(summary = "新增入场" , description = "新增入场" ) |
| | | public R save(@RequestBody EnterPark enterPark) { |
| | | return R.ok(enterParkService.save(enterPark)); |
| | | } |
| | |
| | | */ |
| | | @ApiOperation(value = "修改入场表", notes = "修改入场表") |
| | | @PutMapping |
| | | @Operation(summary = "修改入场" , description = "修改入场" ) |
| | | public R updateById(@RequestBody EnterPark enterPark) { |
| | | return R.ok(enterParkService.updateById(enterPark)); |
| | | } |
| | |
| | | */ |
| | | @ApiOperation(value = "通过id删除入场表", notes = "通过id删除入场表") |
| | | @DeleteMapping("/{id}" ) |
| | | @Operation(summary = "删除入场" , description = "删除入场" ) |
| | | public R removeById(@PathVariable Integer id) { |
| | | return R.ok(enterParkService.removeById(id)); |
| | | } |
| | |
| | | * @return excel 文件流 |
| | | */ |
| | | @GetMapping("/export") |
| | | @Operation(summary = "导出入场" , description = "导出入场" ) |
| | | public List<EnterPark> export(EnterPark enterPark) { |
| | | return enterParkService.list(Wrappers.query(enterPark)); |
| | | } |
| | |
| | | import com.boying.entity.FileInfo; |
| | | import com.boying.service.FileInfoService; |
| | | import io.lettuce.core.dynamic.annotation.Param; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | @RestController |
| | | @RequestMapping("ffzf/fileInfo") |
| | | @RequiredArgsConstructor |
| | | @Tag(description = "ffzf/fileInfo" , name = "文件上传接口" ) |
| | | public class FileInfo2Controller { |
| | | |
| | | private final FileInfoService fileInfoService; |
| | |
| | | * @Param downloadPath 文件路径 |
| | | */ |
| | | @GetMapping("/download/downloadZip") |
| | | @Operation(summary = "下载zip" , description = "下载zip" ) |
| | | public void downloadZip(@Param("downloadPath") String downloadPath, HttpServletRequest request, HttpServletResponse response) { |
| | | //下载图片 |
| | | String down = fileInfoService.downloadPathFile(downloadPath, request, response); |
| | | } |
| | | |
| | | @PostMapping("/download/downloadZips") |
| | | @Operation(summary = "下载多个zip" , description = "下载多个zip" ) |
| | | public void downloadZips(String fileIds, HttpServletRequest request, HttpServletResponse response) { |
| | | List<FileInfo> fileInfoList = new ArrayList<>(); |
| | | if(fileIds.contains(",")){ |
| | |
| | | fileInfoService.downForZip(fileInfoList, request, response); |
| | | } |
| | | @PostMapping("/download/downloadPng") |
| | | @Operation(summary = "下载图片" , description = "下载图片" ) |
| | | public void downloadPng(String fileId, HttpServletRequest request, HttpServletResponse response) { |
| | | FileInfo byId = fileInfoService.getById(Integer.parseInt(fileId)); |
| | | fileInfoService.downloadPng(byId,request,response); |
| | | } |
| | | |
| | | @GetMapping("/showImg") |
| | | @Operation(summary = "根据路径预览图片" , description = "根据路径预览图片" ) |
| | | public void showImg( String path,HttpServletResponse response) { |
| | | fileInfoService.getFile(path,response); |
| | | } |
| | | |
| | | @GetMapping("/showImgById/{fileId}") |
| | | @Operation(summary = "根据文件id预览图片" , description = "根据文件id预览图片" ) |
| | | public void showImgById(@PathVariable Long fileId,HttpServletResponse response) { |
| | | fileInfoService.getFileById(fileId,response); |
| | | } |
| | |
| | | import com.boying.service.FileInfoService; |
| | | import io.lettuce.core.dynamic.annotation.Param; |
| | | import io.swagger.models.auth.In; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | |
| | | @RestController |
| | | @RequestMapping("ffzf/fileinfo") |
| | | @RequiredArgsConstructor |
| | | @Tag(description = "ffzf/fileinfo" , name = "文件接口(已废弃)" ) |
| | | public class FileInfoController { |
| | | |
| | | private final FileInfoService fileInfoService; |
| | |
| | | * @Param downloadPath 文件路径 |
| | | */ |
| | | @GetMapping("/download/downloadZip") |
| | | @Operation(summary = "下载zip" , description = "下载zip" ) |
| | | public void downloadZip(@Param("downloadPath") String downloadPath, HttpServletRequest request, HttpServletResponse response) { |
| | | //下载图片 |
| | | String down = fileInfoService.downloadPathFile(downloadPath, request, response); |
| | | } |
| | | |
| | | @PostMapping("/download/downloadZips") |
| | | @Operation(summary = "下载多个zip" , description = "下载多个zip" ) |
| | | public void downloadZips(String fileIds, HttpServletRequest request, HttpServletResponse response) { |
| | | List<FileInfo> fileInfoList = new ArrayList<>(); |
| | | if(fileIds.contains(",")){ |
| | |
| | | fileInfoService.downForZip(fileInfoList, request, response); |
| | | } |
| | | @PostMapping("/download/downloadPng") |
| | | @Operation(summary = "下载图片" , description = "下载图片" ) |
| | | public void downloadPng(String fileId, HttpServletRequest request, HttpServletResponse response) { |
| | | FileInfo byId = fileInfoService.getById(Integer.parseInt(fileId)); |
| | | fileInfoService.downloadPng(byId,request,response); |
| | | } |
| | | |
| | | @GetMapping("/showImg/{filename}") |
| | | @Operation(summary = "根据路径预览图片" , description = "根据路径预览图片" ) |
| | | public void showImg(@PathVariable String filename,HttpServletResponse response) { |
| | | fileInfoService.getFile(filename,response); |
| | | } |
| | | |
| | | @GetMapping("/showImgById/{fileId}") |
| | | @Operation(summary = "根据文件id预览图片" , description = "根据文件id预览图片" ) |
| | | public void showImgById(@PathVariable Long fileId,HttpServletResponse response) { |
| | | fileInfoService.getFileById(fileId,response); |
| | | } |
| | |
| | | import com.boying.service.BarrierService; |
| | | import com.boying.service.LedShowService; |
| | | import com.boying.service.ParkService; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.data.redis.core.StringRedisTemplate; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | @RestController |
| | | @RequestMapping("ledshow") |
| | | @RequiredArgsConstructor |
| | | @Tag(description = "ledshow" , name = "led日志(已废弃)" ) |
| | | public class LedShowController { |
| | | |
| | | private final LedShowService ledShowService; |
| | |
| | | import com.boying.service.UserService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.models.auth.In; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | |
| | | @RestController |
| | | @RequestMapping("ffzf/orderrecord") |
| | | @RequiredArgsConstructor |
| | | @Tag(description = "ffzf/orderrecord" , name = "订单接口" ) |
| | | public class OrderRecordController { |
| | | |
| | | private final OrderRecordService orderRecordService; |
| | |
| | | */ |
| | | @ApiOperation(value = "分页查询", notes = "分页查询") |
| | | @PostMapping("/findPage" ) |
| | | @Operation(summary = "分页查询" , description = "分页查询" ) |
| | | public R getOrderRecordPage(Page page, OrderRecord orderRecord) { |
| | | QueryWrapper<OrderRecord> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda() |
| | |
| | | |
| | | |
| | | @PostMapping("/getByCarNo") |
| | | @Operation(summary = "通过车牌号月份分页查询" , description = "通过车牌号月份分页查询" ) |
| | | public Object getByCarNo(Page page,String carNo,String month,String phone) { |
| | | List<OrderRecordVo> recordVos = new ArrayList<>(); |
| | | QueryWrapper<OrderRecord> wrapper = new QueryWrapper<>(); |
| | |
| | | } |
| | | |
| | | @PostMapping("/findCountPage") |
| | | @Operation(summary = "查询停车场订单金额统计" , description = "查询停车场订单金额统计" ) |
| | | public Object findCountPage(Integer parkId,String startTime,String endTime) throws ParseException { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | QueryWrapper<OutPark> wrapper = new QueryWrapper<>(); |
| | |
| | | import com.boying.entity.*; |
| | | import com.boying.service.*; |
| | | import com.boying.util.DateUtilOther; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | |
| | | @RestController |
| | | @RequestMapping("ffzf/outpark") |
| | | @RequiredArgsConstructor |
| | | @Tag(description = "ffzf/outpark" , name = "出场表接口" ) |
| | | public class OutParkController { |
| | | |
| | | |
| | |
| | | private StringRedisTemplate redisTemplate; |
| | | |
| | | @PostMapping("/findPage") |
| | | @Operation(summary = "分页查询" , description = "分页查询" ) |
| | | public Object findPage(Page page, String carNo,Long parkId,String payCode,String date) throws ParseException { |
| | | List<OutPark> list = outParkService.getList(page.getCurrent(), page.getSize(), carNo,parkId,payCode, date); |
| | | System.out.println(list); |
| | |
| | | } |
| | | //getById |
| | | @PostMapping("/getById") |
| | | @Operation(summary = "根据id查询" , description = "根据id查询" ) |
| | | public Object getById(Long id) { |
| | | return R.ok(outParkService.getById(id)); |
| | | } |
| | | //道闸code |
| | | @PostMapping("/findByBarrierCode") |
| | | @Operation(summary = "根据道闸code查询出场(已废弃)" , description = "根据道闸code查询出场(已废弃)" ) |
| | | public Object findById(String code) { |
| | | if(StringUtils.isBlank(code)){ |
| | | return R.failed(null,"参数错误"); |
| | |
| | | |
| | | //道闸code |
| | | @PostMapping("/findByBarrierCode2") |
| | | @Operation(summary = "根据道闸code查询出场" , description = "根据道闸code查询出场" ) |
| | | public Object findById2(String code2) { |
| | | if(StringUtils.isBlank(code2)){ |
| | | return R.failed(null,"参数错误"); |
| | |
| | | } |
| | | |
| | | @PostMapping("/delete") |
| | | @Operation(summary = "删除出场" , description = "删除出场" ) |
| | | public Object delete(Long id) { |
| | | outParkService.removeById(id); |
| | | return R.ok("删除成功"); |
| | | } |
| | | |
| | | @PostMapping("enterPark2") |
| | | @Operation(summary = "新增入场(废弃)" , description = "新增入场(废弃)" ) |
| | | public Object enterPark(String carNo,Integer barrierId,Integer parkId,String code2) { |
| | | Barrier barrier1 = findBarrier(code2); |
| | | barrierId = barrier1.getId(); |
| | |
| | | } |
| | | |
| | | @PostMapping("outPark2") |
| | | @Operation(summary = "新增出场(废弃)" , description = "新增出场(废弃)" ) |
| | | public Object outPark(String carNo,Integer barrierId,Integer parkId,String code2) { |
| | | String s = "开始执行出场接口------>\n"; |
| | | Barrier barrier1 = findBarrier(code2); |
| | |
| | | } |
| | | |
| | | @GetMapping("/statisticParkOrder/count") |
| | | @Operation(summary = "统计用户管理的停车场订单数量" , description = "统计用户管理的停车场订单数量" ) |
| | | public R statisticParkOrder(String parkIds) { |
| | | Map<String,Object> resultMap = new HashMap<>(); |
| | | if(StringUtils.isNotBlank(parkIds)){ |
| | |
| | | } |
| | | |
| | | @GetMapping("/isJS") |
| | | @Operation(summary = "僵尸车查询" , description = "僵尸车查询" ) |
| | | public Object isJS(String carNo ,Integer parkId) { |
| | | List<EnterPark> byCarNo = enterParkService.findByCarNo(carNo, parkId); |
| | | if(byCarNo.size() > 0){ |
| | |
| | | } |
| | | |
| | | @GetMapping("/getByCarAndPark") |
| | | @Operation(summary = "根据车牌和停车场获取最新出场" , description = "根据车牌和停车场获取最新出场" ) |
| | | public Object getByCarAndPark(String carNo ,Integer parkId) { |
| | | QueryWrapper<OutPark> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda() |
| | |
| | | } |
| | | |
| | | @GetMapping("/editEnterPark") |
| | | @Operation(summary = "修改入场信息" , description = "修改入场信息" ) |
| | | public Object editEnterPark(String carNo ,Integer parkId,String time) { |
| | | QueryWrapper<Barrier> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda() |
| | |
| | | import com.boying.service.StatisticService; |
| | | import com.boying.service.StreetLogoService; |
| | | import com.boying.service.TicketBlackService; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.data.domain.PageRequest; |
| | |
| | | @RestController |
| | | @RequestMapping("statistic") |
| | | @RequiredArgsConstructor |
| | | @Tag(description = "statistic" , name = "大屏统计接口" ) |
| | | public class StatisticController{ |
| | | |
| | | private final StatisticService statisticService; |
| | |
| | | |
| | | //指挥页面数据 |
| | | @PostMapping("/getData1") |
| | | @Operation(summary = "查询所有泊车统计" , description = "查询所有泊车统计" ) |
| | | public Object card1() { |
| | | List<Statistic> all = statisticService.list(); |
| | | if(all.size() >0){ |
| | |
| | | } |
| | | |
| | | @PostMapping("/getBlackRecord") |
| | | @Operation(summary = "查询所有违法统计" , description = "查询所有违法统计" ) |
| | | public Object getList1(Page page) { |
| | | QueryWrapper<TicketBlack> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda() |
| | |
| | | } |
| | | |
| | | @PostMapping("/getLogo") |
| | | @Operation(summary = "查询所有街道违章统计" , description = "查询所有街道违章统计" ) |
| | | public Object getLogo() { |
| | | return R.ok(streetLogoService.list()); |
| | | } |
| | |
| | | import com.boying.service.StreetReRoadService; |
| | | import com.boying.service.StreetService; |
| | | import com.boying.util.LngLatUtil; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.web.bind.annotation.GetMapping; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | |
| | | @RestController |
| | | @RequestMapping("ffzf/street") |
| | | @RequiredArgsConstructor |
| | | @Tag(description = "ffzf/street" , name = "街道统计" ) |
| | | public class StreetController { |
| | | |
| | | |
| | |
| | | private final StreetLogoService streetLogoService; |
| | | |
| | | @PostMapping("/findPage") |
| | | @Operation(summary = "分页查询" , description = "分页查询" ) |
| | | public Object findPage(Page page, Street street) { |
| | | QueryWrapper<Street> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda() |
| | |
| | | } |
| | | |
| | | @PostMapping("/save") |
| | | @Operation(summary = "新增街道" , description = "新增街道" ) |
| | | public Object save(Street street) { |
| | | QueryWrapper<Street> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda() |
| | |
| | | } |
| | | |
| | | @PostMapping("/save2") |
| | | @Operation(summary = "新增路" , description = "新增路" ) |
| | | public Object save2(StreetReRoad streetReRoad) { |
| | | streetReRoadService.saveOrUpdate(streetReRoad); |
| | | return R.ok(); |
| | |
| | | |
| | | |
| | | @PostMapping("/delete") |
| | | @Operation(summary = "删除街" , description = "删除街" ) |
| | | public Object delete(Long id) { |
| | | streetService.removeById(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @PostMapping("/delete2") |
| | | @Operation(summary = "删除路" , description = "删除路" ) |
| | | public Object delete2(Long id) { |
| | | streetReRoadService.removeById(id); |
| | | return R.ok(); |
| | | } |
| | | |
| | | @GetMapping("/findById") |
| | | @Operation(summary = "根据id查询(APP)" , description = "根据id查询(APP)" ) |
| | | public Object findById(Long id,int type) { |
| | | if(type==0){ |
| | | QueryWrapper<StreetReRoad> roadQueryWrapper = new QueryWrapper<>(); |
| | |
| | | } |
| | | |
| | | @GetMapping("/findList") |
| | | @Operation(summary = "查询所有街道和路" , description = "查询所有街道和路" ) |
| | | public Object findAll() { |
| | | Map<String,Object> map = new HashMap<>(); |
| | | QueryWrapper<Street> wrapper = new QueryWrapper<>(); |
| | |
| | | } |
| | | |
| | | @GetMapping("/findList2") |
| | | @Operation(summary = "查询所有街道" , description = "查询所有街道" ) |
| | | public Object findAll2() { |
| | | return R.ok(streetService.list()); |
| | | } |
| | | |
| | | @PostMapping("findLogo") |
| | | @Operation(summary = "查询所有街道违章" , description = "查询所有街道违章" ) |
| | | public Object findLogo(String lng ,String lat) { |
| | | List<StreetLogo> all = streetLogoService.list(); |
| | | List<StreetLogo> all2 = new ArrayList<>(); |
| | |
| | | import com.boying.util.FileUtil; |
| | | import com.boying.util.NumberToCN; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.apache.commons.io.FileUtils; |
| | | import org.apache.commons.io.FilenameUtils; |
| | |
| | | @RestController |
| | | @RequestMapping("ffzf/ticketblack") |
| | | @RequiredArgsConstructor |
| | | @Tag(description = "ffzf/ticketblack" , name = "黑名单表接口" ) |
| | | public class TicketBlackController { |
| | | |
| | | |
| | |
| | | |
| | | |
| | | @PostMapping("findPage") |
| | | @Operation(summary = "分页查询" , description = "分页查询" ) |
| | | public Object findPage(Page page, TicketBlack ticket){ |
| | | QueryWrapper<TicketBlack> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda() |
| | |
| | | } |
| | | |
| | | @PostMapping("/save") |
| | | @Operation(summary = "新增黑名单" , description = "新增黑名单" ) |
| | | public Object save(TicketBlack ticket) throws IOException{ |
| | | QueryWrapper<TicketBlack> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda() |
| | |
| | | */ |
| | | @ApiOperation(value = "通过id查询", notes = "通过id查询") |
| | | @GetMapping("/{id}" ) |
| | | @Operation(summary = "通过id查询" , description = "通过id查询" ) |
| | | public R getById(@PathVariable("id" ) Integer id) { |
| | | TicketBlack byId = ticketBlackService.getById(id); |
| | | return R.ok(byId); |
| | |
| | | |
| | | |
| | | @PostMapping("/delete") |
| | | @Operation(summary = "删除黑名单" , description = "删除黑名单" ) |
| | | public Object delete(Long id){ |
| | | TicketBlack ticket =ticketBlackService.getById(id); |
| | | if(ticket!=null){ |
| | |
| | | } |
| | | |
| | | @PostMapping("/updateById") |
| | | @Operation(summary = "更新黑名单" , description = "更新黑名单" ) |
| | | public Object updateById(TicketBlack ticket){ |
| | | return R.ok( ticketBlackService.updateById(ticket)); |
| | | } |
| | |
| | | import com.boying.service.ParkService; |
| | | import com.boying.service.UserService; |
| | | import com.boying.util.LngLatUtil; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.data.jpa.domain.Specification; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | |
| | | @RestController |
| | | @RequestMapping("/ffzf/user") |
| | | @RequiredArgsConstructor |
| | | @Tag(description = "ffzf/user" , name = "用户接口" ) |
| | | public class UserController{ |
| | | |
| | | private final UserService userService; |
| | | private final ParkService parkService; |
| | | |
| | | @PostMapping("/findPage") |
| | | @Operation(summary = "分页查询" , description = "分页查询" ) |
| | | public Object findPage(User user, Page page) { |
| | | QueryWrapper<User> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda() |
| | |
| | | } |
| | | |
| | | @PostMapping("/findAll") |
| | | @Operation(summary = "查询所有" , description = "查询所有" ) |
| | | public Object findAll() { |
| | | return R.ok(userService.list()); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/save") |
| | | @Operation(summary = "新增用户" , description = "新增用户" ) |
| | | public Object save(User user) { |
| | | if(user.getId()==null){ |
| | | user.setPassword(user.getLoginName()); |
| | |
| | | } |
| | | |
| | | @PostMapping("/delete") |
| | | @Operation(summary = "删除用户" , description = "删除用户" ) |
| | | public Object delete(Long id) { |
| | | userService.removeById(id); |
| | | return R.ok("删除成功"); |
| | | } |
| | | |
| | | @PostMapping("/login") |
| | | @Operation(summary = "登录" , description = "登录" ) |
| | | public Object login(String loginName,String password,String lng,String lat) { |
| | | if(StringUtils.isBlank(loginName)||StringUtils.isBlank(password)){ |
| | | return R.failed("用户名和密码必填"); |
| | |
| | | } |
| | | |
| | | @PostMapping("updatePassword") |
| | | @Operation(summary = "修改密码" , description = "修改密码" ) |
| | | public Object updatePassword(Long userId,String oldPassword,String newPassword) { |
| | | QueryWrapper<User> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda() |
| | |
| | | import com.boying.entity.ViolationType; |
| | | import com.boying.service.ViolationTypeService; |
| | | import io.swagger.models.auth.In; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | @RestController |
| | | @RequestMapping("ffzf/violationtype") |
| | | @RequiredArgsConstructor |
| | | @Tag(description = "ffzf/violationtype" , name = "违章类型接口" ) |
| | | public class ViolationTypeController { |
| | | |
| | | private final ViolationTypeService violationTypeService; |
| | | |
| | | @PostMapping("/findPage") |
| | | @Operation(summary = "分页查询" , description = "分页查询" ) |
| | | public Object findPage(Page page) { |
| | | QueryWrapper<ViolationType> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda() |
| | |
| | | } |
| | | |
| | | @PostMapping("/save") |
| | | @Operation(summary = "新增违章类型" , description = "新增违章类型" ) |
| | | public Object save(ViolationType violationType) { |
| | | violationTypeService.saveOrUpdate(violationType); |
| | | return R.ok("保存成功"); |
| | | } |
| | | |
| | | @GetMapping("/{id}") |
| | | @Operation(summary = "根据id查询" , description = "根据id查询" ) |
| | | public Object getObj(@PathVariable Integer id) { |
| | | return R.ok(violationTypeService.getById(id)); |
| | | } |
| | | |
| | | @PostMapping("/delete") |
| | | @Operation(summary = "删除违章类型" , description = "删除违章类型" ) |
| | | public Object delete(Long id) { |
| | | violationTypeService.removeById(id); |
| | | return R.ok("删除成功"); |
| | | } |
| | | |
| | | @PostMapping("/findAll") |
| | | @Operation(summary = "查询所有" , description = "查询所有" ) |
| | | public Object findAll() { |
| | | return R.ok(violationTypeService.list()); |
| | | } |
| | |
| | | import com.boying.entity.WhiteList; |
| | | import com.boying.service.ParkService; |
| | | import com.boying.service.WhiteListService; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | @RestController |
| | | @RequestMapping("ffzf/whiteList") |
| | | @RequiredArgsConstructor |
| | | @Tag(description = "ffzf/whiteList" , name = "白名单接口" ) |
| | | public class WhiteListController{ |
| | | |
| | | private final WhiteListService whiteListService; |
| | | private final ParkService parkService; |
| | | |
| | | @PostMapping("/findPage") |
| | | @Operation(summary = "分页查询" , description = "分页查询" ) |
| | | public Object findPage(Page page, String carNo) { |
| | | QueryWrapper<WhiteList> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda() |
| | |
| | | } |
| | | |
| | | @PostMapping("/findPageNew") |
| | | @Operation(summary = "分页查询(新)" , description = "分页查询(新)" ) |
| | | public Object findPageNew(Page page, String carNo) { |
| | | QueryWrapper<WhiteList> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda() |
| | |
| | | } |
| | | |
| | | @PostMapping("/save") |
| | | @Operation(summary = "新增白名单" , description = "新增白名单" ) |
| | | public Object save(WhiteList whiteList) { |
| | | whiteListService.saveOrUpdate(whiteList); |
| | | return R.ok("保存成功"); |
| | | } |
| | | |
| | | @PostMapping("/delete") |
| | | @Operation(summary = "删除白名单" , description = "删除白名单" ) |
| | | public Object delete(Long id) { |
| | | whiteListService.removeById(id); |
| | | return R.ok("删除成功"); |
New file |
| | |
| | | package com.boying.controller.car; |
| | | |
| | | import org.eclipse.paho.client.mqttv3.*; |
| | | import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence; |
| | | |
| | | /** |
| | | * @author kdq |
| | | * @version 1.0.0 |
| | | * @ClassName MqttSample.java |
| | | * @Description TODO |
| | | * @createTime 2024年03月19日 16:56:00 |
| | | */ |
| | | public class MqttSample { |
| | | |
| | | public static void main(String[] args) throws MqttException{ |
| | | MqttSample client = new MqttSample(); |
| | | client.start(); |
| | | } |
| | | //MQTT安装的服务器地址和端口号(本机的ip) |
| | | public static final String HOST = "tcp://39.96.92.240:9092"; |
| | | //定义一个主题 |
| | | public static final String TOPIC = "/device/message/up/keep_alive"; |
| | | //定义MQTT的ID,可以在MQTT服务配置中指定 |
| | | private static final String clientid = "client-2"; |
| | | private MqttClient client; |
| | | private MqttConnectOptions options; |
| | | private String userName = "mqtt"; |
| | | private String passWord = "mqtt"; |
| | | |
| | | // private ScheduledExecutorService scheduler; |
| | | |
| | | private void start() { |
| | | try { |
| | | // host为主机名,clientid即连接MQTT的客户端ID,一般以唯一标识符表示,MemoryPersistence设置clientid的保存形式,默认为以内存保存 |
| | | client = new MqttClient(HOST, clientid, new MemoryPersistence()); |
| | | // MQTT的连接设置 |
| | | options = new MqttConnectOptions(); |
| | | // 设置是否清空session,这里如果设置为false表示服务器会保留客户端的连接记录,这里设置为true表示每次连接到服务器都以新的身份连接 |
| | | options.setCleanSession(false); |
| | | // 设置连接的用户名 |
| | | options.setUserName(userName); |
| | | // 设置连接的密码 |
| | | options.setPassword(passWord.toCharArray()); |
| | | // 设置超时时间 单位为秒 |
| | | options.setConnectionTimeout(10); |
| | | // 设置会话心跳时间 单位为秒 服务器会每隔1.5*20秒的时间向客户端发送个消息判断客户端是否在线,但这个方法并没有重连的机制 |
| | | options.setKeepAliveInterval(20); |
| | | // 设置回调,client.setCallback就可以调用PushCallback类中的messageArrived()方法 |
| | | client.setCallback(new PushCallback()); |
| | | MqttTopic topic = client.getTopic(TOPIC); |
| | | |
| | | int qos = 2; |
| | | |
| | | //setWill方法,如果项目中需要知道客户端是否掉线可以调用该方法。设置最终端口的通知消息 |
| | | options.setWill(topic, "This is yizhu...".getBytes(), qos, true); |
| | | client.connect(options); |
| | | //订阅消息 |
| | | int[] Qos = {qos}; |
| | | String[] topic1 = {TOPIC}; |
| | | client.subscribe(topic1, Qos); |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
New file |
| | |
| | | package com.boying.controller.car; |
| | | |
| | | import org.eclipse.paho.client.mqttv3.MqttClient; |
| | | import org.eclipse.paho.client.mqttv3.MqttConnectOptions; |
| | | import org.eclipse.paho.client.mqttv3.MqttException; |
| | | import org.eclipse.paho.client.mqttv3.MqttTopic; |
| | | import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence; |
| | | |
| | | /** |
| | | * @author kdq |
| | | * @version 1.0.0 |
| | | * @ClassName MqttSample.java |
| | | * @Description TODO |
| | | * @createTime 2024年03月19日 16:56:00 |
| | | */ |
| | | public class MqttSample2 { |
| | | |
| | | public static void main(String[] args) throws MqttException{ |
| | | MqttSample2 client = new MqttSample2(); |
| | | client.start(); |
| | | } |
| | | //MQTT安装的服务器地址和端口号(本机的ip) |
| | | public static final String HOST = "tcp://39.96.92.240:9092"; |
| | | //定义一个主题 |
| | | public static final String TOPIC = "/device/message/up/ivs_result"; |
| | | //定义MQTT的ID,可以在MQTT服务配置中指定 |
| | | private static final String clientid = "client-3"; |
| | | private MqttClient client; |
| | | private MqttConnectOptions options; |
| | | private String userName = "mqtt"; |
| | | private String passWord = "mqtt"; |
| | | |
| | | // private ScheduledExecutorService scheduler; |
| | | |
| | | private void start() { |
| | | try { |
| | | // host为主机名,clientid即连接MQTT的客户端ID,一般以唯一标识符表示,MemoryPersistence设置clientid的保存形式,默认为以内存保存 |
| | | client = new MqttClient(HOST, clientid, new MemoryPersistence()); |
| | | // MQTT的连接设置 |
| | | options = new MqttConnectOptions(); |
| | | // 设置是否清空session,这里如果设置为false表示服务器会保留客户端的连接记录,这里设置为true表示每次连接到服务器都以新的身份连接 |
| | | options.setCleanSession(false); |
| | | // 设置连接的用户名 |
| | | options.setUserName(userName); |
| | | // 设置连接的密码 |
| | | options.setPassword(passWord.toCharArray()); |
| | | // 设置超时时间 单位为秒 |
| | | options.setConnectionTimeout(10); |
| | | // 设置会话心跳时间 单位为秒 服务器会每隔1.5*20秒的时间向客户端发送个消息判断客户端是否在线,但这个方法并没有重连的机制 |
| | | options.setKeepAliveInterval(20); |
| | | // 设置回调,client.setCallback就可以调用PushCallback类中的messageArrived()方法 |
| | | client.setCallback(new PushCallback()); |
| | | MqttTopic topic = client.getTopic(TOPIC); |
| | | |
| | | int qos = 2; |
| | | |
| | | //setWill方法,如果项目中需要知道客户端是否掉线可以调用该方法。设置最终端口的通知消息 |
| | | options.setWill(topic, "This is yizhu...".getBytes(), qos, true); |
| | | client.connect(options); |
| | | //订阅消息 |
| | | int[] Qos = {qos}; |
| | | String[] topic1 = {TOPIC}; |
| | | client.subscribe(topic1, Qos); |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | } |
| | |
| | | import com.google.gson.JsonParser; |
| | | |
| | | import com.sun.media.jfxmedia.track.Track; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | import java.nio.charset.StandardCharsets; |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.time.Duration; |
| | | import java.time.LocalDateTime; |
| | | import java.time.ZoneOffset; |
| | | import java.util.Base64; |
| | |
| | | * Servlet implementation class PlateServlet |
| | | */ |
| | | @Controller |
| | | @RequestMapping("/car2") |
| | | @RequestMapping("/ffzf/car2") |
| | | @RequiredArgsConstructor |
| | | @Tag(description = "ffzf/car3" , name = "泊车流程接口" ) |
| | | public class PlateServlet2 extends HttpServlet { |
| | | private static final long serialVersionUID = 1L; |
| | | @Value("${ffpark.logPath}") |
| | |
| | | private final TicketService ticketService; |
| | | private final CostRuleService costRuleService; |
| | | private final WhiteListService whiteListService; |
| | | private final OutParkLogService outParkLogService; |
| | | private final String LEDURL = "http://192.168.31.212:9988/LedShow/IGetResultDataAllLine"; |
| | | |
| | | /** |
| | |
| | | out.close(); |
| | | } |
| | | |
| | | // protected void easyOpen(HttpServletRequest request, HttpServletResponse response) throws IOException { |
| | | // response.setContentType("text/json"); |
| | | // PrintWriter out = response.getWriter(); |
| | | // out.println("{\"Response_AlarmInfoPlate\":{\"info\":\"ok\",\"content\":\"...\",\"is_pay\":\"true\",\"ivs_ioctrl\":{\"delay\":800,\"io\":0,\"value\":2}}}"); |
| | | // out.flush(); |
| | | // out.close(); |
| | | // } |
| | | |
| | | protected void easyOpen(HttpServletRequest request, HttpServletResponse response) throws IOException { |
| | | response.setContentType("text/json"); |
| | | PrintWriter out = response.getWriter(); |
| | | out.println("{\"Response_AlarmInfoPlate\":{\"info\":\"ok\",\"content\":\"...\",\"is_pay\":\"true\"}}"); |
| | | out.println("{\"Response_AlarmInfoPlate\":{\"ivs_ioctrl\":{\"delay\":1000,\"io\":0,\"value\":2}}}"); |
| | | out.flush(); |
| | | out.close(); |
| | | } |
| | | |
| | | protected void easyNoOpen(HttpServletRequest request, HttpServletResponse response) throws IOException { |
| | | response.setContentType("text/json"); |
| | | PrintWriter out = response.getWriter(); |
| | | out.println("{\"Response_AlarmInfoPlate\":{\"info\":\"error\",\"content\":\"...\",\"is_pay\":\"false\"}}"); |
| | | out.flush(); |
| | | out.close(); |
| | | } |
| | | |
| | | @PostMapping("/status") |
| | | @Operation(summary = "相机心跳接口" , description = "相机心跳接口" ) |
| | | public void heart(String serialno,HttpServletRequest request,HttpServletResponse response) throws ServletException, IOException { |
| | | Barrier barrier = barrierService.findByCode(serialno); |
| | | Park park = parkService.getById(barrier.getParkId()); |
| | | String redis = redisTemplate.opsForValue().get("park_up_" + park.getId()); |
| | | Park park = parkService.getOneById(barrier.getParkId()); |
| | | //Park park = parkService.getById(barrier.getParkId()); |
| | | //String redis = redisTemplate.opsForValue().get("park_up_" + park.getId()); |
| | | String redisnum = redisTemplate.opsForValue().get("car_park_" + park.getId()); |
| | | if(StringUtils.isBlank(redisnum)){ |
| | | redisnum = "0"; |
| | | } |
| | | if(barrier!=null){ |
| | | if(barrier.getType2()==1){ |
| | | //待开闸 |
| | |
| | | int i = Integer.parseInt(redisnum); |
| | | i--; |
| | | if(i<0){ |
| | | String s= "2."+barrier.getCarNo()+"闸机手动启动,场内停车数为"+i+"\n"; |
| | | redisTemplate.opsForValue().set("car_park_" + park.getId(),"0",30, TimeUnit.DAYS); |
| | | redisTemplate.opsForValue().set("park_up_" + park.getId(),"true",30, TimeUnit.DAYS); |
| | | }else { |
| | | String s= "2."+barrier.getCarNo()+"闸机手动启动,场内停车数为"+i+"\n"; |
| | | redisTemplate.opsForValue().set("car_park_" + park.getId(),Integer.toString(i),30, TimeUnit.DAYS); |
| | | redisTemplate.opsForValue().set("park_up_" + park.getId(),"true",30, TimeUnit.DAYS); |
| | | } |
| | |
| | | barrier.setStatus(0); |
| | | barrier.setUpdateTime(LocalDateTime.now()); |
| | | barrierService.saveOrUpdate(barrier); |
| | | |
| | | String jsonValue = JSON.toJSONString(barrier); |
| | | redisTemplate.opsForValue().set("barrier-"+barrier.getCode(), jsonValue); |
| | | easyOpen(request,response); |
| | | }else { |
| | | //不需开闸 |
| | | barrier.setStatus(0); |
| | | barrier.setUpdateTime(LocalDateTime.now()); |
| | | barrierService.saveOrUpdate(barrier); |
| | | OutPark outPark = outParkService.count4(barrier.getId()); |
| | | if(outPark!=null){ |
| | | if(barrier.getType() == 0){ |
| | | int i = Integer.parseInt(redisnum); |
| | | i--; |
| | | if(i<0){ |
| | | redisTemplate.opsForValue().set("car_park_" + park.getId(),"0",30, TimeUnit.DAYS); |
| | | redisTemplate.opsForValue().set("park_up_" + park.getId(),"true",30, TimeUnit.DAYS); |
| | | }else { |
| | | redisTemplate.opsForValue().set("car_park_" + park.getId(),Integer.toString(i),30, TimeUnit.DAYS); |
| | | redisTemplate.opsForValue().set("park_up_" + park.getId(),"true",30, TimeUnit.DAYS); |
| | | LocalDateTime now = LocalDateTime.now(); |
| | | LocalDateTime updateTime = barrier.getUpdateTime(); |
| | | Duration duration = Duration.between(updateTime,now); |
| | | long minutes = duration.toMinutes(); |
| | | if(minutes>=2){ |
| | | barrier.setStatus(0); |
| | | barrier.setUpdateTime(LocalDateTime.now()); |
| | | barrierService.saveOrUpdate(barrier); |
| | | } |
| | | |
| | | String jsonValue = JSON.toJSONString(barrier); |
| | | redisTemplate.opsForValue().set("barrier-"+barrier.getCode(), jsonValue); |
| | | if(barrier.getType() == 0){ |
| | | OutPark outPark = outParkService.count4(barrier.getId()); |
| | | if(outPark!=null){ |
| | | if(barrier.getType() == 0){ |
| | | int i = Integer.parseInt(redisnum); |
| | | i--; |
| | | if(i<0){ |
| | | String s= "2."+outPark.getCarNo()+"缴费完成,场内停车数为"+i+"\n"; |
| | | redisTemplate.opsForValue().set("car_park_" + park.getId(),"0",30, TimeUnit.DAYS); |
| | | redisTemplate.opsForValue().set("park_up_" + park.getId(),"true",30, TimeUnit.DAYS); |
| | | }else { |
| | | String s= "2."+outPark.getCarNo()+"缴费完成,场内停车数为"+i+"\n"; |
| | | redisTemplate.opsForValue().set("car_park_" + park.getId(),Integer.toString(i),30, TimeUnit.DAYS); |
| | | redisTemplate.opsForValue().set("park_up_" + park.getId(),"true",30, TimeUnit.DAYS); |
| | | } |
| | | } |
| | | outPark.setStatus2(1); |
| | | outParkService.saveOrUpdate(outPark); |
| | | easyOpen(request,response); |
| | | OutParkLog byOutPark = outParkLogService.getByOutPark(outPark.getCarNo(), outPark.getId()); |
| | | byOutPark.setOpenTime(LocalDateTime.now()); |
| | | outParkLogService.saveOrUpdate(byOutPark); |
| | | enterParkService.deleteByCarNo(outPark.getCarNo(), barrier.getParkId()); |
| | | redisTemplate.delete("outPark-"+outPark.getBarrierId()); |
| | | } |
| | | outPark.setStatus2(1); |
| | | outParkService.saveOrUpdate(outPark); |
| | | easyOpen(request,response); |
| | | } |
| | | if(barrier.getType() == 1){ |
| | | boolean in = barrierService.getDateDifIn(barrier.getId()); |
| | | boolean in = barrierService.getDateDifIn(park.getId()); |
| | | if(in){ |
| | | inLedShowDefault(park.getId(),request,response); |
| | | } |
| | |
| | | } |
| | | } |
| | | |
| | | }else { |
| | | easyNoOpen(request,response); |
| | | } |
| | | } |
| | | /** |
| | | * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response) |
| | | */ |
| | | @PostMapping("/PlateServlet") |
| | | @Operation(summary = "车辆识别接口" , description = "车辆识别接口" ) |
| | | protected void info(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { |
| | | String s= ""; |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss"); |
| | |
| | | s+="查询道闸为空\n"; |
| | | }else{ |
| | | if(barrier.getType()==0){ |
| | | easyOpen(request,response); |
| | | //noOpen(request,response); |
| | | outPark(license, barrier.getId(), barrier.getParkId(),request,response); |
| | | s+=license+"-保存出场记录\n"; |
| | | // outPark(license, barrier.getId(), barrier.getParkId(),request,response); |
| | | // s+=license+"-保存出场记录\n"; |
| | | }else{ |
| | | String num = redisTemplate.opsForValue().get("car_park_" + barrier.getParkId()); |
| | | if(StringUtils.isBlank(num)){ |
| | | num = "0"; |
| | | redisTemplate.opsForValue().set("car_park_" + barrier.getParkId(),num,30, TimeUnit.DAYS); |
| | | redisTemplate.opsForValue().set("park_up_" + barrier.getParkId(),"true",30, TimeUnit.DAYS); |
| | | } |
| | | Park byId = parkService.getById(barrier.getParkId()); |
| | | if(Integer.parseInt(num) >= byId.getNum() ){ |
| | | //led显示 |
| | | inLedFullShow(code, license,barrier.getParkId(),request,response); |
| | | }else { |
| | | //led显示 |
| | | inLedShow(code, license,barrier.getParkId(),request,response); |
| | | enterPark(license,barrier.getId(),barrier.getParkId()); |
| | | s+=license+"-保存入场记录\n"; |
| | | } |
| | | easyOpen(request,response); |
| | | // String num = redisTemplate.opsForValue().get("car_park_" + barrier.getParkId()); |
| | | // if(StringUtils.isBlank(num)){ |
| | | // num = "0"; |
| | | // redisTemplate.opsForValue().set("car_park_" + barrier.getParkId(),num,30, TimeUnit.DAYS); |
| | | // redisTemplate.opsForValue().set("park_up_" + barrier.getParkId(),"true",30, TimeUnit.DAYS); |
| | | // } |
| | | // Park byId = parkService.getById(barrier.getParkId()); |
| | | // if(Integer.parseInt(num) >= byId.getNum() ){ |
| | | // //led显示 |
| | | // inLedFullShow(code, license,barrier.getParkId(),request,response); |
| | | // }else { |
| | | // //led显示 |
| | | // inLedShow(code, license,barrier.getParkId(),request,response); |
| | | // enterPark(license,barrier.getId(),barrier.getParkId()); |
| | | // s+=license+"-保存入场记录\n"; |
| | | // } |
| | | } |
| | | } |
| | | writeTxt(s); |
| | | // writeTxt(s); |
| | | }while(false); |
| | | } |
| | | catch (Exception e) { |
| | |
| | | enterPark.setStatus(1);//发现有违章 |
| | | } |
| | | enterParkService.saveOrUpdate(enterPark); |
| | | String jsonValue = JSON.toJSONString(enterPark); |
| | | redisTemplate.opsForValue().set("enterPark_dif_"+ parkId, jsonValue); |
| | | |
| | | Barrier barrier = barrierService.getById(barrierId); |
| | | barrier.setType2(1); |
| | |
| | | byCarNoAndBarrierId.setStatus(1); |
| | | byCarNoAndBarrierId.setStatus2(1); |
| | | outParkService.saveOrUpdate(byCarNoAndBarrierId); |
| | | String jsonValue = JSON.toJSONString(byCarNoAndBarrierId); |
| | | redisTemplate.opsForValue().set("outPark_dif_"+ barrierId, jsonValue); |
| | | return 0.0; |
| | | }else{ |
| | | if(w.getParkIds()!=null){ |
| | |
| | | byCarNoAndBarrierId.setStatus(1); |
| | | byCarNoAndBarrierId.setStatus2(1); |
| | | outParkService.saveOrUpdate(byCarNoAndBarrierId); |
| | | String jsonValue = JSON.toJSONString(byCarNoAndBarrierId); |
| | | redisTemplate.opsForValue().set("outPark_dif_"+ barrierId, jsonValue); |
| | | return 0.0; |
| | | } |
| | | } |
| | |
| | | } |
| | | if(outPark.getPrice()==0&&outPark.getStatus3()==0){ |
| | | System.out.println(outPark.getCarNo()+"该车不需要缴费"); |
| | | String jsonValue = JSON.toJSONString(outPark); |
| | | redisTemplate.opsForValue().set("outPark_dif_"+ barrierId, jsonValue); |
| | | outLedShow(barrier.getCode(),barrier.getCarNo(),outPark.getPrice(),toDayHrMinSec,barrier.getParkId(),request,response,0); |
| | | }else { |
| | | //需要缴费或者有违章 |
| | | System.out.println(outPark.getCarNo()+"该车需要缴费"+outPark.getPrice()); |
| | | String jsonValue = JSON.toJSONString(outPark); |
| | | redisTemplate.opsForValue().set("outPark_dif_"+ barrierId, jsonValue); |
| | | outLedShow(barrier.getCode(),barrier.getCarNo(),outPark.getPrice(),toDayHrMinSec,barrier.getParkId(),request,response,1); |
| | | } |
| | | barrierService.saveOrUpdate(barrier); |
New file |
| | |
| | | package com.boying.controller.car; |
| | | |
| | | /** |
| | | * @author kdq |
| | | * @version 1.0.0 |
| | | * @ClassName PushCallback.java |
| | | * @Description TODO |
| | | * @createTime 2024年03月20日 15:42:00 |
| | | */ |
| | | import org.eclipse.paho.client.mqttv3.IMqttDeliveryToken; |
| | | import org.eclipse.paho.client.mqttv3.MqttCallback; |
| | | import org.eclipse.paho.client.mqttv3.MqttMessage; |
| | | |
| | | /** |
| | | * 必须实现MqttCallback的接口并实现对应的相关接口方法CallBack 类将实现 MqttCallBack。 |
| | | * 每个客户机标识都需要一个回调实例。在此示例中,构造函数传递客户机标识以另存为实例数据。 |
| | | * 在回调中,将它用来标识已经启动了该回调的哪个实例。 |
| | | * 必须在回调类中实现三个方法: |
| | | * public void messageArrived(MqttTopic topic, MqttMessage message)接收已经预订的发布。 |
| | | * public void connectionLost(Throwable cause)在断开连接时调用。 |
| | | * public void deliveryComplete(MqttDeliveryToken token)) |
| | | * 接收到已经发布的 QoS 1 或 QoS 2 消息的传递令牌时调用。 |
| | | * 由 MqttClient.connect 激活此回调。 |
| | | */ |
| | | public class PushCallback implements MqttCallback{ |
| | | |
| | | @Override |
| | | public void connectionLost(Throwable cause) { |
| | | // 连接丢失后,一般在这里面进行重连 |
| | | System.out.println("连接断开……(可以做重连)"); |
| | | } |
| | | |
| | | @Override |
| | | public void deliveryComplete(IMqttDeliveryToken token) { |
| | | System.out.println("deliveryComplete---------" + token.isComplete()); |
| | | } |
| | | |
| | | @Override |
| | | public void messageArrived(String topic, MqttMessage message) throws Exception { |
| | | // subscribe后得到的消息会执行到这里面 |
| | | System.out.println("接收消息主题:" + topic + " 接收消息Qos:" + message.getQos() + "接收消息内容:" + new String(message.getPayload())); |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | package com.boying.controller.car; |
| | | |
| | | import org.eclipse.paho.client.mqttv3.*; |
| | | import org.eclipse.paho.client.mqttv3.persist.MemoryPersistence; |
| | | |
| | | /** |
| | | * @author kdq |
| | | * @version 1.0.0 |
| | | * @ClassName ServerMQTT.java |
| | | * @Description TODO |
| | | * @createTime 2024年03月20日 15:43:00 |
| | | */ |
| | | public class ServerMQTT { |
| | | |
| | | public static void main(String[] args) throws MqttException { |
| | | ServerMQTT server = new ServerMQTT(); |
| | | |
| | | server.message = new MqttMessage(); |
| | | server.message.setQos(2); |
| | | server.message.setRetained(true); |
| | | server.message.setPayload("ServerMQTT".getBytes()); |
| | | server.publish(server.topic , server.message); |
| | | System.out.println(server.message.isRetained() + "------ratained状态"); |
| | | } |
| | | |
| | | //MQTT安装的服务器地址和端口号 |
| | | public static final String HOST = "tcp://39.96.92.240:9092"; |
| | | //定义一个主题 |
| | | public static final String TOPIC = "/device/message/up/ivs_result"; |
| | | //定义MQTT的ID,可以在MQTT服务配置中指定 |
| | | private static final String clientid = "client-1"; |
| | | |
| | | private MqttClient client; |
| | | private MqttTopic topic; |
| | | private String userName = "mqtt"; |
| | | private String passWord = "mqtt"; |
| | | private MqttMessage message; |
| | | |
| | | /** |
| | | * g构造函数 |
| | | */ |
| | | public ServerMQTT() throws MqttException { |
| | | // MemoryPersistence设置clientid的保存形式,默认为以内存保存 |
| | | client = new MqttClient(HOST, clientid, new MemoryPersistence()); |
| | | connect(); |
| | | } |
| | | |
| | | /** |
| | | * l连接服务器 |
| | | */ |
| | | private void connect() { |
| | | MqttConnectOptions options = new MqttConnectOptions(); |
| | | options.setCleanSession(false); |
| | | options.setUserName(userName); |
| | | options.setPassword(passWord.toCharArray()); |
| | | // 设置超时时间 |
| | | options.setConnectionTimeout(10); |
| | | // 设置会话心跳时间 |
| | | options.setKeepAliveInterval(20); |
| | | try { |
| | | client.setCallback(new MqttCallback() { |
| | | @Override |
| | | public void connectionLost(Throwable cause) { |
| | | // 连接丢失后,一般在这里面进行重连 |
| | | System.out.println("连接断开……(可以做重连)"); |
| | | } |
| | | @Override |
| | | public void deliveryComplete(IMqttDeliveryToken token) { |
| | | System.out.println("deliveryComplete---------" + token.isComplete()); |
| | | } |
| | | @Override |
| | | public void messageArrived(String topic, MqttMessage message) throws Exception { |
| | | // subscribe后得到的消息会执行到这里面 |
| | | System.out.println("接收消息主题:" + topic + " 接收消息Qos:" + message.getQos() + "接收消息内容:" + new String(message.getPayload())); |
| | | } |
| | | }); |
| | | client.connect(options); |
| | | |
| | | topic = client.getTopic(TOPIC); |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | | } |
| | | |
| | | /** |
| | | * t推送消息 |
| | | */ |
| | | public void publish(MqttTopic topic , MqttMessage message) throws MqttPersistenceException, MqttException { |
| | | MqttDeliveryToken token = topic.publish(message); |
| | | token.waitForCompletion(); |
| | | System.out.println("message is published completely! " + token.isComplete()); |
| | | } |
| | | } |
| | |
| | | import com.boying.entity.Park; |
| | | import com.boying.service.EnterParkService; |
| | | import com.boying.service.ParkService; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | @RestController |
| | | @RequestMapping("ffzf/notice") |
| | | @RequiredArgsConstructor |
| | | @Tag(description = "ffzf/notice" , name = "违法通知接口" ) |
| | | public class NoticeController { |
| | | |
| | | private final EnterParkService enterParkService; |
| | |
| | | |
| | | //停车场内有违法的车辆 |
| | | @PostMapping("/illegalCar") |
| | | @Operation(summary = "根据id查询停车场内所有违法车辆" , description = "根据id查询停车场内所有违法车辆" ) |
| | | public Object illegalCar(Long parkId){ |
| | | QueryWrapper<EnterPark> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda() |
| | |
| | | |
| | | //停车场内有违法的车辆 |
| | | @PostMapping("/illegalCar2") |
| | | @Operation(summary = "查询所有停车场内所有违法车辆" , description = "查询所有停车场内所有违法车辆" ) |
| | | public Object illegalCar2(){ |
| | | QueryWrapper<EnterPark> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda() |
| | |
| | | return R.ok(all); |
| | | } |
| | | |
| | | //停车场内的车辆 根据状态查询 |
| | | @PostMapping("/enterPark") |
| | | @Operation(summary = "停车场内的车辆 根据状态查询" , description = "停车场内的车辆 根据状态查询" ) |
| | | public Object enterPark(Integer status, Page page){ |
| | | if(status==null){ |
| | | Page page1 = enterParkService.page(page); |
| | |
| | | import com.boying.service.*; |
| | | import com.boying.util.HTTPEntityUtil; |
| | | import com.google.gson.Gson; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.http.ResponseEntity; |
| | |
| | | @RestController |
| | | @RequestMapping("ffzf/ffPay") |
| | | @RequiredArgsConstructor |
| | | @Tag(description = "ffzf/ffPay" , name = "对接财政支付接口" ) |
| | | public class PayController extends BaseController { |
| | | |
| | | private final OrderRecordService orderRecordService; |
| | |
| | | |
| | | //生成电子缴款码 |
| | | @PostMapping("zhiFa") |
| | | @Operation(summary = "执法生成缴款码" , description = "执法生成缴款码" ) |
| | | public Object zhiFa(Long id){ |
| | | Ticket ticket = ticketService.getById(id); |
| | | if(ticket.getPayStatus()==1){ |
| | |
| | | |
| | | //支付接口通知 |
| | | @PostMapping("result") |
| | | @Operation(summary = "缴费结果通知" , description = "缴费结果通知" ) |
| | | public String result(HttpServletRequest request, String payKey, String payerTypeCode, String payerNum, String payCode, Double amt, String status, String errorInfo, String sign, String signType) throws Exception{ |
| | | try { |
| | | // updateOrderRecord(payCode,status); |
| | |
| | | |
| | | //生成电子缴款码 |
| | | @PostMapping("park2") |
| | | @Operation(summary = "财政缴费更新生成缴款码" , description = "财政缴费更新生成缴款码" ) |
| | | public Object park2(Long id){ |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss"); |
| | | String logs = sdf.format(new Date())+"开始扫码缴费------》\n"; |
| | |
| | | * 缴款书 |
| | | */ |
| | | @PostMapping("park") |
| | | @Operation(summary = "对接邮储生成缴款书" , description = "对接邮储生成缴款书" ) |
| | | public Object park(Long id){ |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss"); |
| | | String logs = sdf.format(new Date())+"开始扫码缴费------》\n"; |
| | |
| | | * 获取执法id |
| | | */ |
| | | @PostMapping("getZhifaId") |
| | | @Operation(summary = "更新大厅缴款码" , description = "更新大厅缴款码" ) |
| | | public Object getZhifaId(){ |
| | | QueryWrapper<NowPayOrder> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda() |
| | |
| | | * 缴款书 |
| | | */ |
| | | @PostMapping("zhifa") |
| | | @Operation(summary = "执法缴费(新)" , description = "执法缴费(新)" ) |
| | | public Object zhifa(Long id){ |
| | | System.out.println(id+"开始缴费"); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss"); |
| | |
| | | import com.boying.util.FileUtil; |
| | | import com.boying.util.NumberToCN; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.apache.commons.io.FileUtils; |
| | | import org.apache.commons.io.FilenameUtils; |
| | |
| | | @RestController |
| | | @RequestMapping("ffzf/ticket") |
| | | @RequiredArgsConstructor |
| | | @Tag(description = "ffzf/ticket" , name = "手持开罚单接口" ) |
| | | public class TicketController{ |
| | | |
| | | |
| | |
| | | |
| | | //图片回显 |
| | | @RequestMapping(value = "/showImg", method = RequestMethod.GET) |
| | | @Operation(summary = "图片回显" , description = "图片回显" ) |
| | | public void getAwardAsByteArray(HttpServletResponse response, HttpServletRequest request) throws IOException { |
| | | String result = request.getParameter("result"); |
| | | InputStream in = null; |
| | |
| | | } |
| | | |
| | | @PostMapping("findPage") |
| | | @Operation(summary = "分页查询" , description = "分页查询" ) |
| | | public Object findPage(Page page, Ticket ticket){ |
| | | QueryWrapper<Ticket> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda() |
| | |
| | | } |
| | | |
| | | @PostMapping("/save") |
| | | @Operation(summary = "保存罚单" , description = "保存罚单" ) |
| | | public Object save(Ticket ticket,HttpServletRequest request) throws IOException{ |
| | | String imgStr = ""; |
| | | MultipartHttpServletRequest multipartRequest = (MultipartHttpServletRequest) request; |
| | |
| | | } |
| | | |
| | | @PostMapping("/save2") |
| | | @Operation(summary = "保存罚单(废弃)" , description = "保存罚单(废弃)" ) |
| | | public Object save2(Ticket ticket) throws IOException{ |
| | | if(ticket.getUserId()!=null){ |
| | | User user = userService.getById(ticket.getUserId()); |
| | |
| | | */ |
| | | @ApiOperation(value = "通过id查询", notes = "通过id查询") |
| | | @GetMapping("/{id}" ) |
| | | @Operation(summary = "通过id查询罚单" , description = "通过id查询罚单" ) |
| | | public R getById(@PathVariable("id" ) Integer id) { |
| | | Ticket byId = ticketService.getById(id); |
| | | byId.setContent(violationTypeService.getById(byId.getViolationTypeId()).getContent()); |
| | |
| | | |
| | | |
| | | @PostMapping("/delete") |
| | | @Operation(summary = "删除罚单" , description = "删除罚单" ) |
| | | public Object delete(Long id){ |
| | | Ticket ticket =ticketService.getById(id); |
| | | ticket.setStatus(3); |
| | |
| | | } |
| | | |
| | | @PostMapping("/updateById") |
| | | @Operation(summary = "更新罚单状态" , description = "更新罚单状态" ) |
| | | public Object updateById(Ticket ticket){ |
| | | if(ticket.getMoney() >0){ |
| | | BigDecimal numberOfMoney = new BigDecimal(ticket.getMoney()+""); |
| | |
| | | |
| | | //与执法对接 |
| | | @GetMapping("/getResult") |
| | | @Operation(summary = "与执法平台对接,获取签字结果" , description = "与执法平台对接,获取签字结果" ) |
| | | public Object getResult(Ticket ticket){ |
| | | ticketService.updateById(ticket); |
| | | return R.ok(); |
| | |
| | | } |
| | | |
| | | @PostMapping("/getZhiFa") |
| | | @Operation(summary = "根据状态查询罚单" , description = "根据状态查询罚单" ) |
| | | public Object getZhiFa(Integer status,Page page){ |
| | | |
| | | QueryWrapper<Ticket> wrapper = new QueryWrapper<>(); |
| | |
| | | } |
| | | |
| | | @PostMapping("/getCar") |
| | | @Operation(summary = "获取黑名单车辆" , description = "获取黑名单车辆" ) |
| | | public Object getCar(String carNo,Page page,int type){ |
| | | QueryWrapper<TicketBlack> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda() |
| | |
| | | } |
| | | |
| | | @PostMapping("/getCarList") |
| | | @Operation(summary = "根据车牌分页获取罚单" , description = "根据车牌分页获取罚单" ) |
| | | public Object getCarList(String carNo,Page page){ |
| | | QueryWrapper<Ticket> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda() |
| | |
| | | |
| | | |
| | | @PostMapping("/noFound") |
| | | @Operation(summary = "更新罚单状态,增加备注" , description = "更新罚单状态,增加备注" ) |
| | | public Object noFound(Long ticketId,String remark){ |
| | | Ticket ticket = ticketService.getById(ticketId); |
| | | ticket.setStatus(2); |
| | |
| | | } |
| | | |
| | | @PostMapping("/getStatisticByYear") |
| | | @Operation(summary = "统计年度罚单" , description = "统计年度罚单" ) |
| | | public Object getStatistic(int year){ |
| | | Map<String,Object> map = new HashMap<>(); |
| | | List<Object> list = new ArrayList<>(); |
| | |
| | | } |
| | | |
| | | @PostMapping("/getOrderList") |
| | | @Operation(summary = "根据年和月统计罚单" , description = "根据年和月统计罚单" ) |
| | | public Object getOrderList(int year,int month){ |
| | | |
| | | Date yearFirst = DateUtilOther.getFirstDayOfMonth(year,month); |
| | |
| | | } |
| | | |
| | | @PostMapping("findById") |
| | | @Operation(summary = "根据id查询" , description = "根据id查询" ) |
| | | public Object findById(Long id){ |
| | | Ticket ticket = ticketService.getById(id); |
| | | if(ticket.getViolationTypeId()!=null){ |
| | |
| | | */ |
| | | @ApiOperation(value = "手动缴费", notes = "手动缴费") |
| | | @PostMapping("/jiaofei" ) |
| | | @Operation(summary = "手动缴费更新二维码" , description = "手动缴费更新二维码" ) |
| | | public R jiaofei(Integer id) { |
| | | Ticket byId = ticketService.getById(id); |
| | | if(byId.getPayStatus() == 1){ |
| | |
| | | */ |
| | | @ApiOperation(value = "测试对接", notes = "测试对接") |
| | | @GetMapping("/test" ) |
| | | @Operation(summary = "测试对接执法平台" , description = "测试对接执法平台" ) |
| | | public R test() { |
| | | Ticket byId = ticketService.getById(13); |
| | | byId = ticketService.getNumber(byId); |
| | |
| | | import com.boying.common.R; |
| | | import com.boying.entity.UpdateApp; |
| | | import com.boying.service.UpdateAppService; |
| | | import io.swagger.v3.oas.annotations.Operation; |
| | | import io.swagger.v3.oas.annotations.tags.Tag; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | @RestController |
| | | @RequestMapping("ffzf/updateApp") |
| | | @RequiredArgsConstructor |
| | | @Tag(description = "ffzf/updateApp" , name = "app更新接口" ) |
| | | public class UpdateAppController{ |
| | | |
| | | private final UpdateAppService updateAppService; |
| | | |
| | | @PostMapping("/getUpdateApp") |
| | | @Operation(summary = "获取最新app版本" , description = "获取最新app版本" ) |
| | | public Object getUpdateApp(){ |
| | | List<UpdateApp> all = updateAppService.list(); |
| | | if(all.size()==0){ |
| | |
| | | import com.boying.service.*; |
| | | import com.boying.util.DateUtilOther; |
| | | import com.google.gson.Gson; |
| | | 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.http.ResponseEntity; |
| | |
| | | @RestController |
| | | @RequestMapping("/ffzf/api") |
| | | @RequiredArgsConstructor |
| | | @Tag(description = "ffzf/api" , name = "邮储/邢台银行 对接支付接口" ) |
| | | public class YCPayController { |
| | | private final OutParkService outParkService; |
| | | private final PayLogService payLogService; |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/getByQueryId") |
| | | @Operation(summary = "根据出场id获取出场数据" , description = "根据出场id获取出场数据" ) |
| | | public Object getByQueryId(Long queryId){ |
| | | if(queryId == null){ |
| | | return R.failed("参数为空"); |
| | |
| | | * 缴款书 |
| | | */ |
| | | @PostMapping("park") |
| | | @Operation(summary = "邮储申请缴款书" , description = "邮储申请缴款书" ) |
| | | public Object park(Long id){ |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss"); |
| | | OutPark outPark = outParkService.getById(id); |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("parkJudg") |
| | | @Operation(summary = "判断支付端是否已经申请过支付" , description = "判断支付端是否已经申请过支付" ) |
| | | public Object parkJudg(Long id){ |
| | | if(id == null){ |
| | | return R.failed("未找到数据,请稍后重新点击"); |
| | |
| | | * 判断是否缴费 |
| | | */ |
| | | @PostMapping("parkXT") |
| | | @Operation(summary = "邢台银行申请缴费" , description = "邢台银行申请缴费" ) |
| | | public Object parkXT(Long id){ |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss"); |
| | | OutPark outPark = outParkService.getById(id); |
| | |
| | | * 阿里缴费 |
| | | */ |
| | | @PostMapping("payByAli") |
| | | @Operation(summary = "邢台银行支付宝缴费" , description = "邢台银行支付宝缴费" ) |
| | | public Object payByAli(Long id){ |
| | | OutPark outPark = outParkService.getById(id); |
| | | String xtyhpay = systemConfigProperties.getXTYHPAY(); |
| | |
| | | * 获取微信openid |
| | | */ |
| | | @PostMapping("getOpenId") |
| | | @Operation(summary = "邢台银行获取微信用户openid" , description = "邢台银行获取微信用户openid" ) |
| | | public Object park(Long id,String code){ |
| | | OutPark outPark = outParkService.getById(id); |
| | | String openIdByCode = wxService.getOpenIdByCode(code); |
| | |
| | | * 微信缴费 |
| | | */ |
| | | @PostMapping("payByWX") |
| | | @Operation(summary = "邢台银行微信支付" , description = "邢台银行微信支付" ) |
| | | public Object payByWX(Long id,String openId){ |
| | | System.out.println("开始支付"); |
| | | OutPark outPark = outParkService.getById(id); |
| | |
| | | * @return |
| | | */ |
| | | @GetMapping("/result") |
| | | @Operation(summary = "邮储获得支付回调" , description = "邮储获得支付回调" ) |
| | | public Object result(Long queryId,int success,int msg){ |
| | | OutPark byId = outParkService.getById(queryId); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss"); |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping("/getResult") |
| | | @Operation(summary = "邢台银行支付回调接口" , description = "邢台银行支付回调接口" ) |
| | | public Object getResult(HttpServletRequest request){ |
| | | System.out.println("getResult收到访问"); |
| | | String respCode = request.getParameter("respCode"); |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping ("/checkbill") |
| | | @Operation(summary = "邮储对账接口" , description = "邮储对账接口" ) |
| | | public Object checkbill(@RequestBody Map params){ |
| | | String checkDate = (String) params.get("checkDate"); |
| | | String tranDate = (String) params.get("tranDate"); |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping ("/checkbillXTYH") |
| | | @Operation(summary = "邢台银行对账接口" , description = "邢台银行对账接口" ) |
| | | public Object checkbillXTYH(String date){ |
| | | String xtyhpay = systemConfigProperties.getXTYHPAY(); |
| | | Map<String,Object> map = new HashMap<>(); |
| | |
| | | * @return |
| | | */ |
| | | @PostMapping ("/searchPayStatus") |
| | | @Operation(summary = "交易状态查询" , description = "交易状态查询" ) |
| | | public Object searchPayStatus(String txnOrderId,String txnOrderTime){ |
| | | OutPark outPark = outParkService.findByOrderId(txnOrderId); |
| | | if(outPark == null){ |
| | |
| | | @Autowired |
| | | private TicketBlackService ticketBlackService; |
| | | |
| | | @Scheduled(cron = "0 0/40 * * * ?") |
| | | //@Scheduled(cron = "0 0/40 * * * ?") |
| | | public void execute() throws IOException { |
| | | System.out.println("开始定时任务-------》"); |
| | | // List<TicketBlack> list = ticketBlackService.updateType(); |
| | |
| | | |
| | | Boolean taskFlag = false; |
| | | |
| | | @Scheduled(cron = "0/2 * * * * ?") |
| | | //@Scheduled(cron = "0/2 * * * * ?") |
| | | public void execute() throws Exception { |
| | | if(taskFlag == true){ |
| | | System.out.println("正在运行,强制退出-------》"); |
| | |
| | | datasource: |
| | | url: jdbc:mysql://localhost:3306/ffparknew?useUnicode=true&characterEncoding=UTF-8&serverTimezone=GMT%2B8 |
| | | username: root |
| | | password: 2009Boying!@# |
| | | password: rootroot |
| | | driverClassName: com.mysql.cj.jdbc.Driver |
| | | #连接池 |
| | | hikari: |
| | |
| | | max-lifetime: 1800000 |
| | | connection-timeout: 30000 |
| | | connection-test-query: SELECT 1 |
| | | |
| | | security: |
| | | oauth2: |
| | | client: |
| | | ignore-urls: |
| | | - /webjars/** |
| | | - /v3/api-docs/** |
| | | - /doc.html |
| | | jpa: |
| | | database: mysql |
| | | show-sql: true |
| | |
| | | max-file-size: 50MB |
| | | max-request-size: 50MB |
| | | mybatis-plus: |
| | | #configuration: |
| | | #log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | configuration: |
| | | log-impl: org.apache.ibatis.logging.stdout.StdOutImpl |
| | | # slf4j日志配置 |
| | | logging: |
| | | config: classpath:logback.xml |
| | |
| | | logPath: D:/FFproject/log/ |
| | | filePath: D:/FFproject/file/ |
| | | |
| | | |
| | | #项目配置 |
| | | ffzf: |
| | | ip: http://36.134.129.218:6060/ |
| | | loginIp: http://36.134.129.218:9999/auth/oauth/token |
| | | info: api/getInfo |
| | | getNumber: api/getNumber |
| | | #XTYHPAY: http://xiangniupaydev.xtbank.com:28085/ifsp-payweb/SOA/txnAccept |
| | | XTYHPAY: https://xiangniupay.xtbank.com/ifsp-payweb/SOA/txnAccept |
| | | #XTYHRESULT: http://39.96.92.240:8089/ffzf/api/getResult |
| | | XTYHRESULT: http://183.196.93.178:8089/ffzf/api/getResult |
| | | #XTYHMERID: 8202309110000001 |
| | | XTYHMERID: 8202308300000015 |
| | | XTYHMERNAME: 邯郸市峰峰矿区滏源建设发展有限公司 |
| | | XTYHAPPID: wx46e756aed958f895 |
| | | |
| | | |
| | | |
| | | |
| | |
| | | |
| | | <!-- 指定项目中某个包,当有日志操作行为时的日志记录级别 --> |
| | | <!-- 在这个根包下面的所有日志操作行为的权限都是DEBUG --> |
| | | <logger name="com.boying.scheduled" level="INFO"> |
| | | <logger name="com.boying.scheduled" level="DEBUG"> |
| | | <!--与上面appender的name要一致--> |
| | | <appender-ref ref="mylog" /> |
| | | </logger> |