| | |
| | | import com.boying.entity.OutPark; |
| | | import com.boying.service.BarrierService; |
| | | import com.boying.service.OutParkService; |
| | | import com.boying.service.ParkService; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @RequestMapping("barrier") |
| | | @RequestMapping("ffzf/barrier") |
| | | @RequiredArgsConstructor |
| | | public class BarrierController { |
| | | |
| | | private final BarrierService barrierService; |
| | | private final OutParkService outParkService; |
| | | private final ParkService parkService; |
| | | |
| | | @PostMapping("findPage") |
| | | public Object findPage(Page page, String parkId) { |
| | |
| | | return R.ok("请求成功"); |
| | | } |
| | | |
| | | @PostMapping("getByCode") |
| | | public Object getByCode(String code) { |
| | | Barrier b= barrierService.findByCode2(code); |
| | | if (b==null) { |
| | | return R.failed("未找到该道闸"); |
| | | } |
| | | b.setParkName(parkService.getById(b.getParkId()).getName()); |
| | | return R.ok(b,"请求成功"); |
| | | } |
| | | |
| | | |
| | | |
| | | @PostMapping("openBarrier") |
| | | public Object openBarrier(Long barrierId,Integer type) { |
| | | Barrier b= barrierService.getById(barrierId); |
| | |
| | | |
| | | |
| | | @RestController |
| | | @RequestMapping("rule") |
| | | @RequestMapping("ffzf/rule") |
| | | @RequiredArgsConstructor |
| | | public class CostRuleController{ |
| | | |
New file |
| | |
| | | package com.boying.controller; |
| | | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.baomidou.mybatisplus.extension.plugins.pagination.Page; |
| | | import com.boying.common.R; |
| | | import com.boying.entity.Barrier; |
| | | import com.boying.entity.EnterPark; |
| | | import com.boying.entity.OutPark; |
| | | import com.boying.service.BarrierService; |
| | | import com.boying.service.EnterParkService; |
| | | import com.boying.service.ParkService; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | import java.text.ParseException; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.Date; |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * 入场表 |
| | | * |
| | | * @author kdq |
| | | * @date 2023-01-23 09:46:32 |
| | | */ |
| | | @RestController |
| | | @RequiredArgsConstructor |
| | | @RequestMapping("ffzf/enterpark" ) |
| | | @Api(value = "enterpark", tags = "入场表管理") |
| | | public class EnterParkController { |
| | | |
| | | private final EnterParkService enterParkService; |
| | | private final BarrierService barrierService; |
| | | private final ParkService parkService; |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param page 泊车分页对象 |
| | | * @param |
| | | * @return |
| | | */ |
| | | // @ApiOperation(value = "分页查询", notes = "分页查询") |
| | | // @GetMapping("/page" ) |
| | | // public R getEnterParkPage(Page page, EnterPark enterPark, String date) throws ParseException { |
| | | // List<EnterPark> list = enterParkService.getList(page.getCurrent(), page.getSize(), enterPark.getCarNo(),enterPark.getParkId(), date); |
| | | // long count = enterParkService.getCount(enterPark.getCarNo(), enterPark.getParkId(), date); |
| | | // Page page1 = new Page(); |
| | | // for (EnterPark record : list) { |
| | | // record.setParkName(parkService.getById(record.getParkId()).getName()); |
| | | // if(record.getImgId() != null){ |
| | | // record.setImgPath("/ffzf/fileinfo/showImgById/"+record.getImgId()); |
| | | // } |
| | | // } |
| | | // page1.setRecords(list); |
| | | // page1.setCurrent(page.getCurrent()); |
| | | // page1.setSize(page.getSize()); |
| | | // page1.setTotal(count); |
| | | // return R.ok(page1); |
| | | // } |
| | | |
| | | @PostMapping("/findPage") |
| | | public Object findPage(Page page, String carNo,Integer parkId,String date) throws ParseException { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | if(StringUtils.isNotBlank(date)){ |
| | | System.out.println(date); |
| | | Date parse = sdf.parse(date); |
| | | date = sdf.format(parse); |
| | | } |
| | | List<EnterPark> list = enterParkService.getList(page.getCurrent(), page.getSize(), carNo,parkId, date); |
| | | long count = enterParkService.getCount(carNo,parkId, date); |
| | | for (EnterPark record : list) { |
| | | record.setParkName(parkService.getById(record.getParkId()).getName()); |
| | | if(record.getImgId() != null){ |
| | | record.setImgPath("/ffzf/fileinfo/showImgById/"+record.getImgId()); |
| | | } |
| | | } |
| | | page.setRecords(list); |
| | | page.setTotal(count); |
| | | return R.ok(page); |
| | | } |
| | | |
| | | /** |
| | | * 通过id查询入场表 |
| | | * @param id id |
| | | * @return R |
| | | */ |
| | | @ApiOperation(value = "通过id查询", notes = "通过id查询") |
| | | @GetMapping("/{id}" ) |
| | | public R getById(@PathVariable("id" ) Integer id) { |
| | | return R.ok(enterParkService.getById(id)); |
| | | } |
| | | |
| | | /** |
| | | * 新增入场表 |
| | | * @param enterPark 入场表 |
| | | * @return R |
| | | */ |
| | | @ApiOperation(value = "新增入场表", notes = "新增入场表") |
| | | @PostMapping |
| | | public R save(@RequestBody EnterPark enterPark) { |
| | | return R.ok(enterParkService.save(enterPark)); |
| | | } |
| | | |
| | | /** |
| | | * 修改入场表 |
| | | * @param enterPark 入场表 |
| | | * @return R |
| | | */ |
| | | @ApiOperation(value = "修改入场表", notes = "修改入场表") |
| | | @PutMapping |
| | | public R updateById(@RequestBody EnterPark enterPark) { |
| | | return R.ok(enterParkService.updateById(enterPark)); |
| | | } |
| | | |
| | | /** |
| | | * 通过id删除入场表 |
| | | * @param id id |
| | | * @return R |
| | | */ |
| | | @ApiOperation(value = "通过id删除入场表", notes = "通过id删除入场表") |
| | | @DeleteMapping("/{id}" ) |
| | | public R removeById(@PathVariable Integer id) { |
| | | return R.ok(enterParkService.removeById(id)); |
| | | } |
| | | |
| | | |
| | | /** |
| | | * 导出excel 表格 |
| | | * @param enterPark 查询条件 |
| | | * @return excel 文件流 |
| | | */ |
| | | @GetMapping("/export") |
| | | public List<EnterPark> export(EnterPark enterPark) { |
| | | return enterParkService.list(Wrappers.query(enterPark)); |
| | | } |
| | | } |
| | |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @RequestMapping("fileInfo") |
| | | @RequestMapping("ffzf/fileInfo") |
| | | @RequiredArgsConstructor |
| | | public class FileInfoController { |
| | | |
| | |
| | | public void showImg(String path,HttpServletResponse response) { |
| | | fileInfoService.getFile(path,response); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/showImgById/{fileId}") |
| | | public void showImgById(@PathVariable Long fileId,HttpServletResponse response) { |
| | |
| | | import com.boying.service.OutParkService; |
| | | import com.boying.service.ParkService; |
| | | import com.boying.service.UserService; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import io.swagger.models.auth.In; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.springframework.beans.BeanUtils; |
| | |
| | | import java.util.stream.Collectors; |
| | | |
| | | @RestController |
| | | @RequestMapping("orderrecord") |
| | | @RequestMapping("ffzf/orderrecord") |
| | | @RequiredArgsConstructor |
| | | public class OrderRecordController { |
| | | |
| | |
| | | private final ParkService parkService; |
| | | private final UserService userService; |
| | | |
| | | /** |
| | | * 分页查询 |
| | | * @param page 分页对象 |
| | | * @param orderRecord 订单表 |
| | | * @return |
| | | */ |
| | | @ApiOperation(value = "分页查询", notes = "分页查询") |
| | | @PostMapping("/findPage" ) |
| | | public R getOrderRecordPage(Page page, OrderRecord orderRecord) { |
| | | QueryWrapper<OrderRecord> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda() |
| | | .eq(OrderRecord::getType,orderRecord.getType()) |
| | | .eq(OrderRecord::getStatus,1) |
| | | .eq(StringUtils.isNotBlank(orderRecord.getCarNo()),OrderRecord::getCarNo,orderRecord.getCarNo()) |
| | | .isNotNull(OrderRecord::getPayCode) |
| | | .orderByDesc(OrderRecord::getCreateTime); |
| | | Page page1 = orderRecordService.page(page, wrapper); |
| | | List<OrderRecord> records = page1.getRecords(); |
| | | for (OrderRecord record : records) { |
| | | if(record.getImgInId() != null){ |
| | | record.setImgInPath("/ffzf/fileinfo/showImgById/"+record.getImgInId()); |
| | | } |
| | | if(record.getImgOutId() != null){ |
| | | record.setImgOutPath("/ffzf/fileinfo/showImgById/"+record.getImgOutId()); |
| | | } |
| | | } |
| | | page1.setRecords(records); |
| | | return R.ok(page1); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/getByCarNo") |
| | | public Object getByCarNo(Page page,String carNo,String month,String phone) { |
| | | List<OrderRecordVo> recordVos = new ArrayList<>(); |
| | |
| | | import cn.hutool.core.date.DateUtil; |
| | | import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import com.baomidou.mybatisplus.core.toolkit.StringUtils; |
| | | import com.boying.common.R; |
| | | import com.boying.common.SystemConfigProperties; |
| | | import com.boying.entity.*; |
| | |
| | | private StringRedisTemplate redisTemplate; |
| | | |
| | | @PostMapping("/findPage") |
| | | public Object findPage(Page page,OutPark outPark) { |
| | | QueryWrapper<OutPark> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda().orderByDesc(OutPark::getId); |
| | | return R.ok(outParkService.page(page,wrapper)); |
| | | 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); |
| | | long count = outParkService.getCount(carNo,parkId,payCode, date); |
| | | for (OutPark record : list) { |
| | | record.setParkName(parkService.getById(record.getParkId()).getName()); |
| | | if(record.getEnterTime() != null){ |
| | | record.setTimeStr(DateUtilOther.millisToDayHrMinSec(new Double(record.getTime()).longValue())); |
| | | }else { |
| | | record.setTimeStr("未发现入场记录"); |
| | | } |
| | | if(record.getImgId() != null){ |
| | | record.setImgPath("/ffzf/fileinfo/showImgById/"+record.getImgId()); |
| | | } |
| | | } |
| | | page.setRecords(list); |
| | | page.setTotal(count); |
| | | return R.ok(page); |
| | | } |
| | | |
| | | //道闸code |
| | |
| | | if(outPark.getTime() > 0){ |
| | | outPark.setTimeStr(DateUtilOther.millisToDayHrMinSec(new Double(outPark.getTime()).longValue())); |
| | | }else { |
| | | outPark.setTimeStr("0"); |
| | | outPark.setTimeStr("不足一分钟"); |
| | | } |
| | | return R.ok(outPark); |
| | | } |
| | |
| | | import java.util.stream.Collectors; |
| | | |
| | | @RestController |
| | | @RequestMapping("/park") |
| | | @RequestMapping("ffzf/park") |
| | | @RequiredArgsConstructor |
| | | public class ParkController { |
| | | |
| | |
| | | |
| | | |
| | | @RestController |
| | | @RequestMapping("street") |
| | | @RequestMapping("ffzf/street") |
| | | @RequiredArgsConstructor |
| | | public class StreetController { |
| | | |
| | |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @RequestMapping("/user") |
| | | @RequestMapping("/ffzf/user") |
| | | @RequiredArgsConstructor |
| | | public class UserController{ |
| | | |
| | |
| | | import org.springframework.web.bind.annotation.*; |
| | | |
| | | @RestController |
| | | @RequestMapping("violationType") |
| | | @RequestMapping("ffzf/violationType") |
| | | @RequiredArgsConstructor |
| | | public class ViolationTypeController { |
| | | |
| | |
| | | |
| | | |
| | | @RestController |
| | | @RequestMapping("whiteList") |
| | | @RequestMapping("ffzf/whiteList") |
| | | @RequiredArgsConstructor |
| | | public class WhiteListController{ |
| | | |
| | |
| | | .execute() |
| | | .body(); |
| | | ResultData resultData = JSON.parseObject(s1,ResultData.class); |
| | | System.out.println(resultData); |
| | | String[] split = resultData.getDatas().split("-"); |
| | | String[] dataX = new String[resultData.getLenth()]; |
| | | System.arraycopy(split,0,dataX,0,resultData.getLenth()); |
| | | String s2 = StringUtil.toStr(dataX); |
| | | byte[] bytes = StringUtil.HexString2Bytes(s2); |
| | | //byte[] bytes = StringUtil.HexString2Bytes(s2); |
| | | byte[] bytes1 = StringUtil.hex2Byte(resultData.getDatas()); |
| | | byte[] bytes = StringUtil.byte2hex(bytes1); |
| | | for (byte aByte : bytes) { |
| | | System.out.print(aByte+" "); |
| | | } |
| | | System.out.println(); |
| | | String data1 = new String("gb2312"); |
| | | data1 = Base64.getMimeEncoder().encodeToString(bytes); |
| | | System.out.println("bytes.length: "+bytes.length); |
| | | //String data1 = new String("gb2312"); |
| | | String data1 = Base64.getMimeEncoder().encodeToString(bytes); |
| | | // String data2 = data1.replace("\n", ""); |
| | | String data3 = data1.replaceAll("\r\n", ""); |
| | | String data3 = data1.replaceAll("\r\n", "") + "="; |
| | | System.out.println(); |
| | | System.out.println(data3); |
| | | open(request,response,data3);//入场开闸 |
| | |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @RequestMapping("notice") |
| | | @RequestMapping("ffzf/notice") |
| | | @RequiredArgsConstructor |
| | | public class NoticeController { |
| | | |
| | |
| | | import com.boying.entity.*; |
| | | import com.boying.service.*; |
| | | import com.boying.util.DateUtilOther; |
| | | import com.boying.util.NumberToCN; |
| | | import io.swagger.annotations.ApiOperation; |
| | | import lombok.RequiredArgsConstructor; |
| | | import org.apache.commons.io.FileUtils; |
| | | import org.apache.commons.io.FilenameUtils; |
| | | import org.apache.commons.io.IOUtils; |
| | | import org.springframework.http.MediaType; |
| | | import org.springframework.web.bind.annotation.PostMapping; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestMethod; |
| | | import org.springframework.web.bind.annotation.RestController; |
| | | import org.springframework.web.bind.annotation.*; |
| | | import org.springframework.web.multipart.MultipartFile; |
| | | import org.springframework.web.multipart.MultipartHttpServletRequest; |
| | | |
| | |
| | | import java.io.File; |
| | | import java.io.IOException; |
| | | import java.io.InputStream; |
| | | import java.math.BigDecimal; |
| | | import java.util.*; |
| | | |
| | | @RestController |
| | | @RequestMapping("ticket") |
| | | @RequestMapping("ffzf/ticket") |
| | | @RequiredArgsConstructor |
| | | public class TicketController{ |
| | | |
| | |
| | | } |
| | | |
| | | @PostMapping("findPage") |
| | | public Object findPage(Page page, Integer type){ |
| | | if(type==null){ |
| | | public Object findPage(Page page, Ticket ticket){ |
| | | QueryWrapper<Ticket> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda() |
| | | .eq(Ticket::getType,1) |
| | | .orderByDesc(Ticket::getId); |
| | | return R.ok(ticketService.page(page, wrapper)); |
| | | }else{ |
| | | QueryWrapper<Ticket> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda() |
| | | .eq(Ticket::getType,type) |
| | | .orderByDesc(Ticket::getId); |
| | | .eq(StringUtils.isNotBlank(ticket.getCarNo()),Ticket::getCarNo,ticket.getCarNo()) |
| | | .eq(ticket.getType() != null,Ticket::getType,ticket.getType()) |
| | | .eq(ticket.getViolationTypeId() != null,Ticket::getViolationTypeId,ticket.getViolationTypeId()) |
| | | .eq(ticket.getPayStatus() != null,Ticket::getPayStatus,ticket.getPayStatus()) |
| | | .orderByDesc(Ticket::getCreateTime); |
| | | return R.ok(ticketService.page(page, wrapper)); |
| | | } |
| | | |
| | | } |
| | | |
| | | |
| | | @PostMapping("/save") |
| | | public Object save(Ticket ticket,HttpServletRequest request) throws IOException{ |
| | |
| | | return R.ok(ticket); |
| | | } |
| | | |
| | | /** |
| | | * 通过id查询票据表 |
| | | * @param id id |
| | | * @return R |
| | | */ |
| | | @ApiOperation(value = "通过id查询", notes = "通过id查询") |
| | | @GetMapping("/{id}" ) |
| | | public R getById(@PathVariable("id" ) Integer id) { |
| | | Ticket byId = ticketService.getById(id); |
| | | byId.setContent(violationTypeService.getById(byId.getViolationTypeId()).getContent()); |
| | | return R.ok(byId); |
| | | } |
| | | |
| | | |
| | | @PostMapping("/delete") |
| | | public Object delete(Long id){ |
| | | Ticket ticket =ticketService.getById(id); |
| | | ticket.setStatus(3); |
| | | ticketService.saveOrUpdate(ticket); |
| | | return R.ok("操作成功"); |
| | | } |
| | | |
| | | @PostMapping("/updateById") |
| | | public Object updateById(@RequestBody Ticket ticket){ |
| | | if(ticket.getMoney() >0){ |
| | | BigDecimal numberOfMoney = new BigDecimal(ticket.getMoney()+""); |
| | | String s = NumberToCN.number2CNMontrayUnit(numberOfMoney); |
| | | ticket.setMoneyStr(s.toString()); |
| | | } |
| | | return R.ok(ticketService.updateById(ticket)); |
| | | } |
| | | |
| | | public void saveLogo(String name,String lng,String lat){ |
| | |
| | | } |
| | | return R.ok(ticket); |
| | | } |
| | | |
| | | /** |
| | | * 手动缴费 |
| | | * @param id id |
| | | * @return R |
| | | */ |
| | | @ApiOperation(value = "手动缴费", notes = "手动缴费") |
| | | @PostMapping("/jiaofei" ) |
| | | public R jiaofei(Integer id) { |
| | | Ticket byId = ticketService.getById(id); |
| | | byId.setContent(violationTypeService.getById(byId.getViolationTypeId()).getContent()); |
| | | return R.ok(byId); |
| | | } |
| | | } |
| | |
| | | import java.util.List; |
| | | |
| | | @RestController |
| | | @RequestMapping("updateApp") |
| | | @RequestMapping("ffzf/updateApp") |
| | | @RequiredArgsConstructor |
| | | public class UpdateAppController{ |
| | | |
| | |
| | | package com.boying.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.boying.common.BaseEntity; |
| | | import io.swagger.annotations.ApiModel; |
| | |
| | | import javax.persistence.Column; |
| | | import javax.persistence.Entity; |
| | | import javax.persistence.Table; |
| | | import javax.persistence.Transient; |
| | | |
| | | @Data |
| | | @TableName("barrier") |
| | |
| | | @Column(columnDefinition = "int comment '端口'") |
| | | private int port; |
| | | |
| | | |
| | | @Transient |
| | | @TableField(exist = false) |
| | | private String parkName; |
| | | |
| | | } |
| | |
| | | @TableField(exist = false) |
| | | private String imgPath; |
| | | |
| | | @Transient |
| | | @TableField(exist = false) |
| | | private String date; |
| | | |
| | | } |
| | |
| | | package com.boying.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.boying.common.BaseEntity; |
| | | import io.swagger.annotations.ApiModel; |
| | |
| | | |
| | | import javax.persistence.Column; |
| | | import javax.persistence.Entity; |
| | | import javax.persistence.Transient; |
| | | |
| | | /** |
| | | * @author kdq |
| | |
| | | @Column(columnDefinition = "int comment 'png'") |
| | | private Integer billfiletype; |
| | | |
| | | //图片id |
| | | @ApiModelProperty(value = "入场图片id") |
| | | @Column(columnDefinition = "int comment '入场图片id'") |
| | | private Long imgInId; |
| | | |
| | | //图片id |
| | | @ApiModelProperty(value = "出场图片id") |
| | | @Column(columnDefinition = "int comment '出场图片id'") |
| | | private Long imgOutId; |
| | | |
| | | @Transient |
| | | @TableField(exist = false) |
| | | private String imgInPath; |
| | | |
| | | @Transient |
| | | @TableField(exist = false) |
| | | private String imgOutPath; |
| | | |
| | | |
| | | |
| | |
| | | @Transient |
| | | @TableField(exist = false) |
| | | private String imgPath; |
| | | |
| | | @Transient |
| | | @TableField(exist = false) |
| | | private String date; |
| | | } |
| | |
| | | package com.boying.entity; |
| | | |
| | | import com.baomidou.mybatisplus.annotation.TableField; |
| | | import com.baomidou.mybatisplus.annotation.TableName; |
| | | import com.boying.common.BaseEntity; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import javax.persistence.Entity; |
| | | import javax.persistence.Transient; |
| | | import java.util.Date; |
| | | |
| | | /** |
| | |
| | | /** |
| | | * 状态(0:未处理,1:已处理,2:未完成 3:撤销) |
| | | */ |
| | | private int status; |
| | | private Integer status; |
| | | /** |
| | | * 地点 |
| | | */ |
| | |
| | | /** |
| | | * 0:现场处罚 1:上级任务 2:违章拖车 |
| | | */ |
| | | private int type; |
| | | private Integer type; |
| | | |
| | | private String lng; |
| | | |
| | |
| | | /** |
| | | * 缴款状态(0:待缴费 1:已缴费 2:支付失败) |
| | | */ |
| | | private int payStatus; |
| | | private Integer payStatus; |
| | | /** |
| | | * 处罚金额 |
| | | */ |
| | | private double money; |
| | | /** |
| | | * 处罚金额大写 |
| | | */ |
| | | private String moneyStr; |
| | | /** |
| | | * 缴费时间 |
| | | */ |
| | |
| | | private String userName; |
| | | private String violationTypeName; |
| | | private String qrUrl; |
| | | |
| | | |
| | | //年份 |
| | | private String year; |
| | | |
| | | //文书号 |
| | | private String number; |
| | | |
| | | //当事人姓名 |
| | | private String personName; |
| | | |
| | | //当事人身份证号 |
| | | private String idCard; |
| | | |
| | | //当事人住址 |
| | | private String personAddress; |
| | | |
| | | //执法人1姓名 |
| | | private String zfName1; |
| | | //执法人2姓名 |
| | | private String zfName2; |
| | | |
| | | //执法人员1证号 |
| | | private String zfNum1; |
| | | //执法人员2证号 |
| | | private String zfNum2; |
| | | |
| | | //最后执行日期 |
| | | private String days; |
| | | |
| | | /** |
| | | * 流水号 |
| | | */ |
| | | private String code2; |
| | | |
| | | @Transient |
| | | @TableField(exist = false) |
| | | private String content; |
| | | |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.boying.entity.EnterPark; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | import org.apache.ibatis.annotations.Select; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author kdq |
| | |
| | | */ |
| | | @Mapper |
| | | public interface EnterParkMapper extends BaseMapper<EnterPark> { |
| | | |
| | | List<EnterPark> getList(@Param("current")long current, @Param("size")long size, @Param("carNo")String carNo, @Param("parkId")Integer parkId, @Param("date")String date); |
| | | |
| | | |
| | | long getCount(@Param("carNo")String carNo,@Param("parkId")Integer parkId,@Param("date")String date); |
| | | } |
| | |
| | | import com.baomidou.mybatisplus.core.mapper.BaseMapper; |
| | | import com.boying.entity.OutPark; |
| | | import org.apache.ibatis.annotations.Mapper; |
| | | import org.apache.ibatis.annotations.Param; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author kdq |
| | |
| | | */ |
| | | @Mapper |
| | | public interface OutParkMapper extends BaseMapper<OutPark> { |
| | | |
| | | List<OutPark> getList(@Param("current")long current, @Param("size")long size, @Param("carNo")String carNo, @Param("parkId")Long parkId, @Param("payCode")String payCode, @Param("date")String date); |
| | | |
| | | long getCount(@Param("carNo")String carNo, @Param("parkId")Long parkId, @Param("payCode")String payCode, @Param("date")String date); |
| | | |
| | | } |
| | |
| | | */ |
| | | public interface BarrierService extends IService<Barrier> { |
| | | Barrier findByCode(String code); |
| | | Barrier findByCode2(String code); |
| | | boolean getDateDifIn(Integer barrierId); |
| | | boolean getDateDifOut(Integer barrierId); |
| | | } |
| | |
| | | * @createTime 2022年11月20日 10:21:00 |
| | | */ |
| | | public interface EnterParkService extends IService<EnterPark> { |
| | | |
| | | List<EnterPark> getList(long current,long size,String carNo,Integer parkId,String date); |
| | | |
| | | long getCount(String carNo,Integer parkId,String date); |
| | | |
| | | int count1(); |
| | | List<EnterPark> findByCarNo(String carNo,Integer parkId); |
| | | @Transactional(readOnly = false) |
| | |
| | | import com.boying.entity.OutPark; |
| | | import com.boying.entity.Statistic; |
| | | |
| | | import java.util.List; |
| | | |
| | | /** |
| | | * @author kdq |
| | | * @version 1.0.0 |
| | |
| | | * @createTime 2022年11月20日 10:19:00 |
| | | */ |
| | | public interface OutParkService extends IService<OutPark> { |
| | | List<OutPark> getList(long current, long size, String carNo, Long parkId, String payCode, String date); |
| | | |
| | | long getCount(String carNo, Long parkId, String payCode, String date); |
| | | |
| | | |
| | | int count1(); |
| | | |
| | | int count2(); |
| | |
| | | } |
| | | |
| | | @Override |
| | | public Barrier findByCode2(String code) { |
| | | QueryWrapper<Barrier> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda() |
| | | .eq(Barrier::getCode2,code); |
| | | List<Barrier> list = list(wrapper); |
| | | if(list.size()>0){ |
| | | return list.get(0); |
| | | }else { |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public boolean getDateDifIn(Integer barrierId) { |
| | | QueryWrapper<EnterPark> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda() |
| | |
| | | private final EnterParkMapper enterParkMapper; |
| | | |
| | | @Override |
| | | public List<EnterPark> getList(long current, long size, String carNo, Integer parkId, String date) { |
| | | return enterParkMapper.getList(current-1,size,carNo,parkId,date); |
| | | } |
| | | |
| | | @Override |
| | | public long getCount( String carNo, Integer parkId, String date) { |
| | | return enterParkMapper.getCount(carNo,parkId,date); |
| | | } |
| | | |
| | | @Override |
| | | public int count1() { |
| | | QueryWrapper<EnterPark> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda() |
| | |
| | | return null; |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public List<OutPark> getList(long current, long size, String carNo, Long parkId, String payCode, String date) { |
| | | return outParkMapper.getList(current-1,size,carNo,parkId,payCode,date); |
| | | } |
| | | |
| | | @Override |
| | | public long getCount(String carNo, Long parkId, String payCode, String date) { |
| | | return outParkMapper.getCount(carNo,parkId,payCode,date); |
| | | } |
| | | } |
New file |
| | |
| | | package com.boying.util; |
| | | |
| | | import java.math.BigDecimal; |
| | | |
| | | /** |
| | | * @author kdq |
| | | * @version 1.0.0 |
| | | * @ClassName NumberToCN.java |
| | | * @Description 金额大写 |
| | | * @createTime 2023年02月06日 17:21:00 |
| | | */ |
| | | public class NumberToCN { |
| | | private static final String[] CN_UPPER_NUMBER = { "零", "壹", "贰", "叁", "肆", "伍", "陆", "柒", "捌", "玖" }; |
| | | private static final String[] CN_UPPER_MONETRAY_UNIT = { "分", "角", "圆", "拾", "佰", "仟", "万", "拾", "佰", "仟", "亿", "拾", "佰", "仟", "兆", "拾","佰", "仟" }; |
| | | private static final String CN_FULL = "整"; |
| | | private static final String CN_NEGATIVE = "负"; |
| | | private static final int MONEY_PRECISION = 2; |
| | | private static final String CN_ZEOR_FULL = "零元" + CN_FULL; |
| | | |
| | | /** |
| | | * 把输入的金额转换为汉语中人民币的大写 |
| | | * |
| | | * @param numberOfMoney |
| | | * 输入的金额 |
| | | * @return 对应的汉语大写 |
| | | */ |
| | | public static String number2CNMontrayUnit(BigDecimal numberOfMoney) { |
| | | StringBuffer sb = new StringBuffer(); |
| | | // -1, 0, or 1 as the value of this BigDecimal is negative, zero, or |
| | | // positive. |
| | | int signum = numberOfMoney.signum(); |
| | | // 零元整的情况 |
| | | if (signum == 0) { |
| | | return CN_ZEOR_FULL; |
| | | } |
| | | // 这里会进行金额的四舍五入 |
| | | long number = numberOfMoney.movePointRight(MONEY_PRECISION) |
| | | .setScale(0, 4).abs().longValue(); |
| | | // 得到小数点后两位值 |
| | | long scale = number % 100; |
| | | int numUnit = 0; |
| | | int numIndex = 0; |
| | | boolean getZero = false; |
| | | // 判断最后两位数,一共有四中情况:00 = 0, 01 = 1, 10, 11 |
| | | if (!(scale > 0)) { |
| | | numIndex = 2; |
| | | number = number / 100; |
| | | getZero = true; |
| | | } |
| | | if ((scale > 0) && (!(scale % 10 > 0))) { |
| | | numIndex = 1; |
| | | number = number / 10; |
| | | getZero = true; |
| | | } |
| | | int zeroSize = 0; |
| | | while (true) { |
| | | if (number <= 0) { |
| | | break; |
| | | } |
| | | // 每次获取到最后一个数 |
| | | numUnit = (int) (number % 10); |
| | | if (numUnit > 0) { |
| | | if ((numIndex == 9) && (zeroSize >= 3)) { |
| | | sb.insert(0, CN_UPPER_MONETRAY_UNIT[6]); |
| | | } |
| | | if ((numIndex == 13) && (zeroSize >= 3)) { |
| | | sb.insert(0, CN_UPPER_MONETRAY_UNIT[10]); |
| | | } |
| | | sb.insert(0, CN_UPPER_MONETRAY_UNIT[numIndex]); |
| | | sb.insert(0, CN_UPPER_NUMBER[numUnit]); |
| | | getZero = false; |
| | | zeroSize = 0; |
| | | } else { |
| | | ++zeroSize; |
| | | if (!(getZero)) { |
| | | sb.insert(0, CN_UPPER_NUMBER[numUnit]); |
| | | } |
| | | if (numIndex == 2) { |
| | | if (number > 0) { |
| | | sb.insert(0, CN_UPPER_MONETRAY_UNIT[numIndex]); |
| | | } |
| | | } else if (((numIndex - 2) % 4 == 0) && (number % 1000 > 0)) { |
| | | sb.insert(0, CN_UPPER_MONETRAY_UNIT[numIndex]); |
| | | } |
| | | getZero = true; |
| | | } |
| | | // 让number每次都去掉最后一个数 |
| | | number = number / 10; |
| | | ++numIndex; |
| | | } |
| | | // 如果signum == -1,则说明输入的数字为负数,就在最前面追加特殊字符:负 |
| | | if (signum == -1) { |
| | | sb.insert(0, CN_NEGATIVE); |
| | | } |
| | | // 输入的数字小数点后两位为"00"的情况,则要在最后追加特殊字符:整 |
| | | if (!(scale > 0)) { |
| | | sb.append(CN_FULL); |
| | | } |
| | | return sb.toString(); |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | double d = 123654.25d; |
| | | BigDecimal numberOfMoney = new BigDecimal(d+""); |
| | | String s = NumberToCN.number2CNMontrayUnit(numberOfMoney); |
| | | System.out.println(s.toString()); |
| | | } |
| | | } |
| | |
| | | |
| | | public class StringUtil { |
| | | |
| | | /** 16进制中的字符集 */ |
| | | private static final String HEX_CHAR = "0123456789ABCDEF"; |
| | | |
| | | /** 16进制中的字符集对应的字节数组 */ |
| | | private static final byte[] HEX_STRING_BYTE = HEX_CHAR.getBytes(); |
| | | |
| | | public static boolean isNullOrEmpty(String str) { |
| | | if (null == str || "".equalsIgnoreCase(str.trim()) |
| | | || "null".equals(str.trim())) { |
| | |
| | | String s1 = substring.replaceAll(",", ""); |
| | | String s2 = s1.replaceAll(" ", ""); |
| | | return s2; |
| | | } |
| | | |
| | | public static byte[] toBytes(String strs){ |
| | | String[] split = strs.split("-"); |
| | | byte[] bytes = new byte[split.length]; |
| | | for (int i = 0; i < split.length; i++) { |
| | | String s = split[i]; |
| | | bytes[i] = (byte) Byte.parseByte(s); |
| | | } |
| | | return bytes; |
| | | } |
| | | |
| | | public static byte[] hex2Byte(String hex) { |
| | | System.out.println(); |
| | | String[] parts = hex.split("-"); |
| | | byte[] bytes = new byte[parts.length]; |
| | | for (int i = 0; i < parts.length; i++) { |
| | | bytes[i] = (byte) (Integer.parseInt(parts[i],10)); |
| | | System.out.print(bytes[i]+ " "); |
| | | } |
| | | return bytes; |
| | | } |
| | | |
| | | public static String getUUID() { |
| | |
| | | if (null == src || 0 == src.length()) { |
| | | return null; |
| | | } |
| | | String s1 = src.replaceAll("-", ""); |
| | | byte[] ret = new byte[s1.length() / 2]; |
| | | byte[] tmp = s1.getBytes(); |
| | | // String s1 = src.replaceAll("-", ""); |
| | | byte[] ret = new byte[src.length() / 2]; |
| | | byte[] tmp = src.getBytes(); |
| | | for (int i = 0; i < (tmp.length / 2); i++) { |
| | | ret[i] = uniteBytes(tmp[i * 2], tmp[i * 2 + 1]); |
| | | ret[i] = (byte)uniteBytes(tmp[i * 2], tmp[i * 2 + 1]); |
| | | } |
| | | return ret; |
| | | } |
| | |
| | | return ret; |
| | | } |
| | | |
| | | public static void main(String[] args) { |
| | | String s = "00-64-FF-FF-6E-78-00-04-00-01-01-02-00-FF-00-00-00-09-E4-BA-AC-41-38-38-38-38-38-0D-01-01-01-02-00-FF-00-00-00-09-E4-B8-B4-E6-97-B6-E8-BD-A6-0D-02-01-01-02-00-FF-00-00-00-0C-E6-AC-A2-E8-BF-8E-E5-85-89-E4-B8-B4-0D-03-01-01-02-00-FF-00-00-00-09-E4-BD-99-E4-BD-8D-3A-37-34-00-0A-20-E4-B8-B4-E6-97-B6-E8-BD-A6-2C-E4-BA-AC-41-38-38-38-38-38-2C-E6-AC-A2-E8-BF-8E-E5-85-89-E4-B8-B4-00-6B-E7"; |
| | | String s1 = s.replaceAll("-", ""); |
| | | byte[] bytes = HexString2Bytes(s1); |
| | | for (byte aByte : bytes) { |
| | | System.out.print(aByte + " "); |
| | | /** |
| | | * 10进制字节数组转换为16进制字节数组 |
| | | * |
| | | * byte用二进制表示占用8位,16进制的每个字符需要用4位二进制位来表示,则可以把每个byte |
| | | * 转换成两个相应的16进制字符,即把byte的高4位和低4位分别转换成相应的16进制字符,再取对应16进制字符的字节 |
| | | * |
| | | * @param b 10进制字节数组 |
| | | * @return 16进制字节数组 |
| | | */ |
| | | public static byte[] byte2hex(byte[] b) { |
| | | int length = b.length; |
| | | byte[] b2 = new byte[length << 1]; |
| | | int pos; |
| | | for(int i=0; i<length; i++) { |
| | | pos = 2*i; |
| | | b2[pos] = HEX_STRING_BYTE[(b[i] & 0xf0) >> 4]; |
| | | b2[pos+1] = HEX_STRING_BYTE[b[i] & 0x0f]; |
| | | } |
| | | return b2; |
| | | } |
| | | |
| | | /** |
| | | * 16进制字节数组转换为10进制字节数组 |
| | | * |
| | | * 两个16进制字节对应一个10进制字节,则将第一个16进制字节对应成16进制字符表中的位置(0~15)并向左移动4位, |
| | | * 再与第二个16进制字节对应成16进制字符表中的位置(0~15)进行或运算,则得到对应的10进制字节 |
| | | * @param b 10进制字节数组 |
| | | * @return 16进制字节数组 |
| | | */ |
| | | public static byte[] hex2byte(byte[] b) { |
| | | if(b.length%2 != 0) { |
| | | throw new IllegalArgumentException("byte array length is not even!"); |
| | | } |
| | | |
| | | int length = b.length >> 1; |
| | | byte[] b2 = new byte[length]; |
| | | int pos; |
| | | for(int i=0; i<length; i++) { |
| | | pos = i << 1; |
| | | b2[i] = (byte) (HEX_CHAR.indexOf( b[pos] ) << 4 | HEX_CHAR.indexOf( b[pos+1] ) ); |
| | | } |
| | | return b2; |
| | | } |
| | | |
| | | /** |
| | | * 将16进制字节数组转成10进制字符串 |
| | | * @param b 16进制字节数组 |
| | | * @return 10进制字符串 |
| | | */ |
| | | public static String hex2Str(byte[] b) { |
| | | return new String(hex2byte(b)); |
| | | } |
| | | |
| | | /** |
| | | * 将10进制字节数组转成16进制字符串 |
| | | * @param b 10进制字节数组 |
| | | * @return 16进制字符串 |
| | | */ |
| | | public static String byte2HexStr(byte[] b) { |
| | | return Integer.toHexString(Integer.parseInt(new String(b))); |
| | | } |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | |
| | | } |
| | | } |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.boying.mapper.EnterParkMapper"> |
| | | |
| | | <resultMap id="enterParkMap" type="com.boying.entity.EnterPark"> |
| | | <id property="id" column="id"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="delFlag" column="del_flag"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | <result property="barrierId" column="barrier_id"/> |
| | | <result property="carNo" column="car_no"/> |
| | | <result property="parkId" column="park_id"/> |
| | | <result property="status" column="status"/> |
| | | </resultMap> |
| | | <select id="getList" resultType="com.boying.entity.EnterPark"> |
| | | select * from enter_park |
| | | <where> |
| | | 1=1 |
| | | <if test="carNo != null and carNo != ''"> |
| | | and car_no = #{carNo} |
| | | </if> |
| | | <if test="parkId != null and parkId != ''"> |
| | | and park_id = #{parkId} |
| | | </if> |
| | | <if test="date != null and date != ''"> |
| | | and DATE_FORMAT(create_time,'%Y-%m-%d') >= DATE_FORMAT(#{date},'%Y-%m-%d') |
| | | and DATE_FORMAT(create_time,'%Y-%m-%d') <= DATE_FORMAT(#{date},'%Y-%m-%d') |
| | | </if> |
| | | </where> |
| | | order by create_time desc limit #{current},#{size} |
| | | </select> |
| | | <select id="getCount" resultType="java.lang.Long"> |
| | | select count(*) from enter_park |
| | | <where> |
| | | 1=1 |
| | | <if test="carNo != null and carNo != ''"> |
| | | and car_no = #{carNo} |
| | | </if> |
| | | <if test="parkId != null and parkId != ''"> |
| | | and park_id = #{parkId} |
| | | </if> |
| | | <if test="date != null and date != ''"> |
| | | and DATE_FORMAT(create_time,'%Y-%m-%d') >= DATE_FORMAT(#{date},'%Y-%m-%d') |
| | | and DATE_FORMAT(create_time,'%Y-%m-%d') <= DATE_FORMAT(#{date},'%Y-%m-%d') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | </mapper> |
New file |
| | |
| | | <?xml version="1.0" encoding="UTF-8"?> |
| | | <!DOCTYPE mapper PUBLIC "-//mybatis.org//DTD Mapper 3.0//EN" "http://mybatis.org/dtd/mybatis-3-mapper.dtd"> |
| | | |
| | | <mapper namespace="com.boying.mapper.OutParkMapper"> |
| | | |
| | | <resultMap id="outParkMap" type="com.boying.entity.OutPark"> |
| | | <id property="id" column="id"/> |
| | | <result property="createTime" column="create_time"/> |
| | | <result property="delFlag" column="del_flag"/> |
| | | <result property="updateTime" column="update_time"/> |
| | | <result property="barrierId" column="barrier_id"/> |
| | | <result property="carNo" column="car_no"/> |
| | | <result property="code" column="code"/> |
| | | <result property="enterTime" column="enter_time"/> |
| | | <result property="parkId" column="park_id"/> |
| | | <result property="payCode" column="pay_code"/> |
| | | <result property="price" column="price"/> |
| | | <result property="remark" column="remark"/> |
| | | <result property="status" column="status"/> |
| | | <result property="status2" column="status2"/> |
| | | <result property="status3" column="status3"/> |
| | | <result property="time" column="time"/> |
| | | <result property="code2" column="code2"/> |
| | | </resultMap> |
| | | <select id="getList" resultType="com.boying.entity.OutPark"> |
| | | select * from out_park |
| | | <where> |
| | | 1=1 |
| | | <if test="carNo != null and carNo != ''"> |
| | | and car_no = #{carNo} |
| | | </if> |
| | | <if test="payCode != null and payCode != ''"> |
| | | and pay_code = #{payCode} |
| | | </if> |
| | | <if test="parkId != null and parkId != ''"> |
| | | and park_id = #{parkId} |
| | | </if> |
| | | <if test="date != null and date != ''"> |
| | | and DATE_FORMAT(create_time,'%Y-%m-%d') >= DATE_FORMAT(#{date},'%Y-%m-%d') |
| | | and DATE_FORMAT(create_time,'%Y-%m-%d') <= DATE_FORMAT(#{date},'%Y-%m-%d') |
| | | </if> |
| | | </where> |
| | | order by create_time desc limit #{current},#{size} |
| | | </select> |
| | | |
| | | <select id="getCount" resultType="java.lang.Long"> |
| | | select count(*) from out_park |
| | | <where> |
| | | 1=1 |
| | | <if test="carNo != null and carNo != ''"> |
| | | and car_no = #{carNo} |
| | | </if> |
| | | <if test="payCode != null and payCode != ''"> |
| | | and pay_code = #{payCode} |
| | | </if> |
| | | <if test="parkId != null and parkId != ''"> |
| | | and park_id = #{parkId} |
| | | </if> |
| | | <if test="date != null and date != ''"> |
| | | and DATE_FORMAT(create_time,'%Y-%m-%d') >= DATE_FORMAT(#{date},'%Y-%m-%d') |
| | | and DATE_FORMAT(create_time,'%Y-%m-%d') <= DATE_FORMAT(#{date},'%Y-%m-%d') |
| | | </if> |
| | | </where> |
| | | </select> |
| | | <select id="getOneByBarrierId" resultType="com.boying.entity.OutPark"> |
| | | select id,car_no,status2 from out_park |
| | | where barrier_id = #{barrierId} and `status` = 1 and status2 = 0 and del_flag = 0 limit 1; |
| | | </select> |
| | | </mapper> |