| | |
| | | fileInfoService.getFile(path,response); |
| | | } |
| | | |
| | | |
| | | @GetMapping("/showImgById/{fileId}") |
| | | public void showImgById(@PathVariable Long fileId,HttpServletResponse response) { |
| | | fileInfoService.getFileById(fileId,response); |
| | | } |
| | | |
| | | } |
| | |
| | | import com.boying.entity.*; |
| | | import com.boying.service.*; |
| | | import com.boying.util.DateUtilOther; |
| | | import com.boying.util.FileUtil; |
| | | import com.boying.util.StringUtil; |
| | | import com.google.gson.JsonObject; |
| | | import com.google.gson.JsonParser; |
| | |
| | | import java.util.List; |
| | | import java.util.concurrent.TimeUnit; |
| | | |
| | | |
| | | /** |
| | | * Servlet implementation class PlateServlet |
| | | */ |
| | |
| | | private final TicketService ticketService; |
| | | private final CostRuleService costRuleService; |
| | | private final WhiteListService whiteListService; |
| | | private final FileInfoService fileInfoService; |
| | | private final String LEDURL = "http://192.168.31.212:9988/LedShow/IGetResultDataAllLine"; |
| | | |
| | | /** |
| | |
| | | BufferedReader reader = new BufferedReader(new InputStreamReader(request.getInputStream(),"UTF-8")); |
| | | String str = ""; |
| | | String lineStr = ""; |
| | | FileInfo fileInfo = null; |
| | | while((str = reader.readLine()) != null){ |
| | | lineStr += str; |
| | | } |
| | |
| | | JSONObject result = alarmInfoPlate.getJSONObject("result"); |
| | | JSONObject plateResult = result.getJSONObject("PlateResult"); |
| | | String carNo = plateResult.get("license").toString(); |
| | | String image = plateResult.get("imageFile").toString(); |
| | | String code = alarmInfoPlate.get("serialno").toString(); |
| | | |
| | | try { |
| | |
| | | break; |
| | | } |
| | | |
| | | System.out.println("编号:"+serialno+"设备识别到了:"+license); |
| | | |
| | | if(StringUtils.isNotBlank(image)){ |
| | | fileInfo = FileUtil.generateBase64StringToFile(image, 1,1); |
| | | fileInfoService.save(fileInfo); |
| | | } |
| | | |
| | | |
| | | System.out.println("编号:"+serialno+" 设备识别到了:"+license); |
| | | String format = sdf.format(new Date()); |
| | | s+= format+",车牌号为:"+license+",serialno为:"+code+" "; |
| | | |
| | |
| | | easyNoOpen(request,response); |
| | | }else{ |
| | | if(barrier.getType()==0){ |
| | | outPark(license, barrier.getId(), barrier.getParkId(),request,response); |
| | | outPark(license, barrier.getId(), barrier.getParkId(),request,response,fileInfo); |
| | | s+=license+"-保存出场记录\n"; |
| | | }else{ |
| | | String num = redisTemplate.opsForValue().get("car_park_" + barrier.getParkId()); |
| | |
| | | }else { |
| | | //led显示 |
| | | inLedShow(code, license,barrier.getParkId(),request,response); |
| | | enterPark(license,barrier.getId(),barrier.getParkId()); |
| | | enterPark(license,barrier.getId(),barrier.getParkId(),fileInfo); |
| | | s+=license+"-保存入场记录\n"; |
| | | } |
| | | } |
| | |
| | | |
| | | |
| | | |
| | | public void enterPark(String carNo,Integer barrierId,Integer parkId) { |
| | | public void enterPark(String carNo,Integer barrierId,Integer parkId,FileInfo fileInfo) { |
| | | Park park = parkService.getById(parkId); |
| | | // int num = 0; |
| | | // String s = redisTemplate.opsForValue().get("car_park_" + parkId); |
| | |
| | | if(tickets.size()>0){ |
| | | enterPark.setStatus(1);//发现有违章 |
| | | } |
| | | if(fileInfo != null){ |
| | | enterPark.setImgId(fileInfo.getId()); |
| | | } |
| | | enterParkService.saveOrUpdate(enterPark); |
| | | |
| | | // Barrier barrier = barrierService.getById(barrierId); |
| | |
| | | // barrierService.saveOrUpdate(barrier); |
| | | } |
| | | |
| | | public double outPark(String carNo,Integer barrierId,Integer parkId,HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { |
| | | public double outPark(String carNo,Integer barrierId,Integer parkId,HttpServletRequest request, HttpServletResponse response,FileInfo fileInfo) throws ServletException, IOException { |
| | | double money = 0.0; |
| | | EnterPark enterPark = null; |
| | | String toDayHrMinSec = null; |
| | |
| | | //outPark.setPrice(Double.valueOf(String.format("%.1f", money))); |
| | | outPark.setPrice(money); |
| | | outPark.setStatus3(findTicket(carNo)); |
| | | if(fileInfo != null){ |
| | | outPark.setImgId(fileInfo.getId()); |
| | | } |
| | | outParkService.saveOrUpdate(outPark); |
| | | Barrier barrier =barrierService.getById(barrierId); |
| | | barrier.setCarNo(carNo); |
| | |
| | | */ |
| | | |
| | | |
| | | public static void main(String[] args) { |
| | | public static void main9(String[] args) { |
| | | //直接开票 |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd"); |
| | | SimpleDateFormat sdf2 = new SimpleDateFormat("hh:mm:ss"); |
| | | String format = sdf.format(new Date()); |
| | | String format2 = sdf2.format(new Date()); |
| | | String idStr = 111111+""; |
| | | String idStr = 17107+""; |
| | | String dateStr = DateUtil.currentSeconds()+""; |
| | | String l = idStr + dateStr; |
| | | |
| | |
| | | //开票申请 |
| | | DirectTicket.info info = new DirectTicket.info(); |
| | | info.setOrdernum(1); |
| | | info.setAmt(3.0); |
| | | info.setAmt(7.5); |
| | | info.setAmount(1); |
| | | info.setIncitemcode("072101"); |
| | | info.setIncitemname("停车泊位及公共停车场等有偿使用收入"); |
| | |
| | | directTicket.setIssuedate(format); |
| | | directTicket.setIssuetime(format2); |
| | | directTicket.setPayerpartytype("1"); |
| | | directTicket.setPayer("冀A0C5MA"); |
| | | directTicket.setAmt(3.0); |
| | | directTicket.setPayer("冀A0CM05"); |
| | | directTicket.setAmt(7.5); |
| | | directTicket.setUsername("张娇"); |
| | | directTicket.setChecker("乔宁"); |
| | | directTicket.setPayinfo(json); |
| | |
| | | txt += map+",\n"; |
| | | if(entity.getBody().getCode() ==1 ){ |
| | | //申请成功,去获取开票文件 |
| | | //System.out.println(entity.getBody()); |
| | | System.out.println(entity.getBody()); |
| | | Object o = entity.getBody().getData().get(0); |
| | | String s = JSON.toJSONString(o); |
| | | Map<String,Object> mapTypes = (Map)JSON.parse(s); |
| | |
| | | } |
| | | } |
| | | |
| | | public static void main9(String[] args) { |
| | | public static void main(String[] args) { |
| | | Map<String,Object> map1 = new HashMap<>(); |
| | | map1.put("einvoicecode", ""); |
| | | map1.put("einvoicenumber",""); |
| | | map1.put("bizcode", ""); |
| | | map1.put("randomnumber",""); |
| | | map1.put("einvoicecode", "13011223"); |
| | | map1.put("einvoicenumber","0005489442"); |
| | | map1.put("bizcode", "171071682490940"); |
| | | map1.put("randomnumber","366660"); |
| | | map1.put("billfiletype",1); |
| | | SimpleDateFormat sdf3 = new SimpleDateFormat("yyyy-MM-dd_HH_mm_ss"); |
| | | RestTemplate restTemplate = new RestTemplate(); |
| | | ResponseEntity<ReturnData> entity = restTemplate.postForEntity("http://10.255.200.204:7991/geteinvoicebybizcode", HTTPEntityUtil.setEntity(map1), ReturnData.class); |
| | | System.out.println(entity.getBody()); |
| | | if(entity.getBody().getCode() == 1){ |
| | | System.out.println(entity.getBody()); |
| | | Object o1 = entity.getBody().getData().get(0); |
| | | String s1 = JSON.toJSONString(o1); |
| | | EticketFile eticketFile = JSONObject.parseObject(s1, EticketFile.class); |
| | |
| | | import com.boying.common.BaseEntity; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import io.swagger.models.auth.In; |
| | | import lombok.Data; |
| | | |
| | | import javax.persistence.Column; |
| | |
| | | @Column(columnDefinition = "int comment '未发现违章:0 发现违章:1'") |
| | | private int status; |
| | | |
| | | @ApiModelProperty(value = "图片id") |
| | | @Column(columnDefinition = "int comment '图片id'") |
| | | private Integer imgId; |
| | | |
| | | |
| | | @Transient |
| | | @TableField(exist = false) |
| | | private String parkName; |
| | | |
| | | @Transient |
| | | @TableField(exist = false) |
| | | private String imgPath; |
| | | |
| | | } |
| | |
| | | import com.boying.common.BaseEntity; |
| | | import com.fasterxml.jackson.annotation.JsonFormat; |
| | | import io.swagger.annotations.ApiModel; |
| | | import io.swagger.annotations.ApiModelProperty; |
| | | import lombok.Data; |
| | | import org.springframework.format.annotation.DateTimeFormat; |
| | | |
| | | import javax.persistence.Column; |
| | | import javax.persistence.Entity; |
| | | import javax.persistence.Transient; |
| | | import java.time.LocalDateTime; |
| | |
| | | */ |
| | | private int status3; |
| | | |
| | | @ApiModelProperty(value = "图片id") |
| | | @Column(columnDefinition = "int comment '图片id'") |
| | | private Integer imgId; |
| | | |
| | | @Transient |
| | | @TableField(exist = false) |
| | | private String parkName; |
| | | |
| | | @Transient |
| | | @TableField(exist = false) |
| | | private String imgPath; |
| | | } |
| | |
| | | private FileInfoService fileInfoService; |
| | | private Boolean taskFlag = false; |
| | | |
| | | // @Scheduled(cron = "0/10 * * * * ?") |
| | | //@Scheduled(cron = "0/10 * * * * ?") |
| | | public void execute() throws Exception { |
| | | if(taskFlag == true){ |
| | | System.out.println("正在运行,强制退出-------》"); |
| | |
| | | } |
| | | QueryWrapper<OrderRecord> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda() |
| | | .eq(OrderRecord::getTicketStatus, 0) |
| | | .isNotNull(OrderRecord::getEinvoicecode) |
| | | .orderByDesc(OrderRecord::getCreateTime); |
| | | // .eq(OrderRecord::getTicketStatus, 0) |
| | | // .isNotNull(OrderRecord::getEinvoicecode) |
| | | // .orderByDesc(OrderRecord::getCreateTime); |
| | | .in(OrderRecord::getPayCode,"13040623000000055070","13040623000000062406","13040623000000232508","13040623000000363081","13040623000000242992","13040623000000319574","13040623000000362919","13040623000000154458","13040623000000151150", |
| | | "13040623000000155450","13040623000000241009","13040623000000363014","13040623000000220187","13040623000000231732","13040623000000362898","13040623000000362900","13040623000000362951","13040623000000153156","13040623000000150991", |
| | | "13040623000000327435","13040623000000226482"); |
| | | List<OrderRecord> list = orderRecordService.list(wrapper); |
| | | if (list.size() > 0) { |
| | | if (list.size() > 50) { |
| | |
| | | import com.boying.service.OrderRecordService; |
| | | import lombok.extern.slf4j.Slf4j; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.scheduling.annotation.Scheduled; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.io.IOException; |
| | |
| | | @Autowired |
| | | private ErrorLogService errorLogService; |
| | | |
| | | //@Scheduled(cron = "0 30 14 * * ?") |
| | | //@Scheduled(cron = "0 40 18 * * ?") |
| | | public void execute() throws Exception { |
| | | Path path = Paths.get("E:\\ycCheckBill\\Bank_PSBC_20230422.txt"); |
| | | Path path = Paths.get("E:\\ycCheckBill\\Bank_PSBC_20230421.txt"); |
| | | |
| | | DateTime start = DateUtil.parse( "2023-04-21 22:30:00"); |
| | | DateTime end = DateUtil.parse("2023-04-22 22:29:59"); |
| | | DateTime start = DateUtil.parse( "2023-04-20 22:30:00"); |
| | | DateTime end = DateUtil.parse("2023-04-21 22:29:59"); |
| | | |
| | | QueryWrapper<OrderRecord> wrapper = new QueryWrapper<>(); |
| | | wrapper.lambda() |
| | |
| | | void downloadPng(FileInfo byId,HttpServletRequest request, HttpServletResponse response); |
| | | |
| | | void getFile(String downloadPath, HttpServletResponse response); |
| | | |
| | | void getFileById(Long fileId, HttpServletResponse response); |
| | | } |
| | |
| | | public class FileInfoServiceImpl extends ServiceImpl<FileInfoMapper, FileInfo> implements FileInfoService { |
| | | |
| | | private final SystemConfigProperties systemConfigProperties; |
| | | private final FileInfoMapper fileInfoMapper; |
| | | @Override |
| | | public String downloadPathFile(String downloadPath, HttpServletRequest request, HttpServletResponse response) { |
| | | //设置文件路径 |
| | |
| | | System.out.println("文件读取异常,"+e.getLocalizedMessage()); |
| | | } |
| | | } |
| | | |
| | | @Override |
| | | public void getFileById(Long fileId, HttpServletResponse response) { |
| | | try { |
| | | FileInfo fileInfo = fileInfoMapper.selectById(fileId); |
| | | InputStream input = new FileInputStream(new File(fileInfo.getFileBaseDir()+fileInfo.getFileName()+fileInfo.getFileLast())); |
| | | response.setContentType(MediaType.IMAGE_PNG_VALUE); |
| | | IoUtil.copy(input, response.getOutputStream()); |
| | | }catch (Exception e){ |
| | | System.out.println("文件读取异常,"+e.getLocalizedMessage()); |
| | | } |
| | | } |
| | | } |