| | |
| | | @PostMapping("result") |
| | | 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{ |
| | | System.out.println(payCode+"-------"+status); |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd_HH_mm_ss"); |
| | | String s = "payCode===="+payCode+",\n"; |
| | | try { |
| | | s += "开始走回调接口------>"; |
| | | s += sdf.format(new Date())+"开始走回调接口------>\n"; |
| | | writeTxt(s); |
| | | updateOrderRecord(payCode,status); |
| | | }catch (Exception e){ |
| | |
| | | |
| | | //更新订单记录 |
| | | public void updateOrderRecord(String payCode,String status){ |
| | | String s = "更新订单记录:payCode===="+payCode+",status==="+status+",\n"; |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd_HH_mm_ss"); |
| | | String s = sdf.format(new Date())+"更新订单记录:payCode===="+payCode+",status==="+status+",\n"; |
| | | Specification<OrderRecord> specification = new Specification<OrderRecord>() { |
| | | @Override |
| | | public Predicate toPredicate(Root<OrderRecord> root, CriteriaQuery<?> cq, CriteriaBuilder cb) { |
| | |
| | | list.add(cb.equal(root.get("payCode").as(String.class), payCode)); |
| | | Predicate[] arr = new Predicate[list.size()]; |
| | | cq.where(list.toArray(arr)); |
| | | cq.orderBy(cb.desc(root.get("createTime"))); |
| | | return null; |
| | | } |
| | | }; |
| | | List<OrderRecord> all = orderRecordService.findAll(specification); |
| | | s += "查询到订单记录为:"+all.size()+"条,\n"; |
| | | if(all.size()==1){ |
| | | if(all.size()>=1){ |
| | | OrderRecord orderRecord = all.get(0); |
| | | s += "查询到订单为:"+orderRecord.getId()+",\n"; |
| | | if(status.equals("01")){ |
| | |
| | | // } |
| | | |
| | | public void updateOutPark(Long outParkId,String status){ |
| | | String s = "开始修改出场表-----》,\n"; |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd_HH_mm_ss"); |
| | | String s = sdf.format(new Date())+"开始修改出场表-----》\n"; |
| | | s+= "outparkId==="+outParkId+",status==="+status+",\n"; |
| | | writeTxt(s); |
| | | OutPark outPark = (OutPark) outParkService.findById(outParkId); |
| | | if(outPark!=null){ |
| | | s += "找到出场数据:"+outPark.getId()+",\n"; |
| | |
| | | outPark.setStatus(1); |
| | | outParkService.save(outPark); |
| | | } |
| | | }else { |
| | | s += "未找到出场数据-----》"; |
| | | writeTxt(s); |
| | | } |
| | | s += "未找到出场数据-----》"; |
| | | writeTxt(s); |
| | | |
| | | } |
| | | |
| | | //删除进停车场的数据 |
| | |
| | | //生成电子缴款码 |
| | | @PostMapping("park") |
| | | public Object park(Long id){ |
| | | String logs = "开始缴费流程------》"; |
| | | logs += "出场id为:"+id+",\n"; |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss"); |
| | | String logs = sdf.format(new Date())+"开始扫码缴费------》\n"; |
| | | logs += "出场表id为:"+id+",\n"; |
| | | OutPark outPark = (OutPark) outParkService.findById(id); |
| | | if(outPark.getPrice()==0){ |
| | | updateOutPark(outPark.getId(),"03"); |
| | |
| | | s.append("&payKey=df937eda27cb4a59a12347966678e232");//财政给的 |
| | | s.append("&payerName="+outPark.getCarNo()); |
| | | s.append("&payerNum="+ outPark.getCode());//订单号 |
| | | s.append("&payerTypeCode=1304062100000001");////财政给的 |
| | | //s.append("&payerTypeCode=1304062100000001");////财政给的 |
| | | s.append("&payerTypeCode=072101");////财政给的 |
| | | s.append("&reserve1="); |
| | | s.append("&reserve2="); |
| | | s.append("&reserve3="); |
| | |
| | | //插入停车订单记录 |
| | | public void addOrderRecord(OutPark outPark){ |
| | | Park park = (Park) parkService.findById(outPark.getParkId()); |
| | | |
| | | OrderRecord orderRecord = new OrderRecord(); |
| | | orderRecord.setAddress(park.getName()); |
| | | orderRecord.setCarNo(outPark.getCarNo()); |