| | |
| | | @RequiredArgsConstructor |
| | | public class YCPayController { |
| | | private final OutParkService outParkService; |
| | | private final ParkService parkService; |
| | | private final OrderRecordService orderRecordService; |
| | | private final TicketService ticketService; |
| | | private final TicketBlackService ticketBlackService; |
| | |
| | | updateOutPark(outPark.getId(),"03"); |
| | | return R.failed("本次停车无需支付费用!"); |
| | | }else{ |
| | | if(w.getParkId()!=null){ |
| | | if(w.getEndTime()!=null){ |
| | | if(w.getParkId().equals(outPark.getParkId())&&System.currentTimeMillis()<w.getEndTime().getTime()){ |
| | | updateOutPark(outPark.getId(),"03"); |
| | | return R.failed("本次停车无需支付费用!"); |
| | | if(StringUtils.isNotBlank(w.getParkIds())){ |
| | | if(w.getParkIds().contains(outPark.getParkId()+"")){ |
| | | if(w.getEndTime()!=null){ |
| | | if(System.currentTimeMillis()<w.getEndTime().getTime()){ |
| | | updateOutPark(outPark.getId(),"03"); |
| | | return R.failed("本次停车无需支付费用!"); |
| | | } |
| | | } |
| | | } |
| | | |
| | | } |
| | | } |
| | | } |
| | | if(outPark.getStatus() == 0){ |
| | | // return R.ok("跳转邮储支付", "https://hbfs.govpay.ccb.com/online/fssm?fee=130000000001&PyfScnCgycd=01&pyfTpcd=3&BNo="+outPark.getPayCode()); |
| | | // return R.ok("跳转邮储支付", "http://wxtest.smeia.cn/h5/?appid=CUP11234601101¶ms={\"payMode\":\"B\",\"payItemNo\":\"41301106100124\",\"userNo\":"+id+"}"); |
| | | if(StringUtils.isNotBlank(outPark.getPayCode()) && outPark.getStatus() == 0){ |
| | | return R.ok("跳转邮储支付", "http://wxtest.smeia.cn/h5/static/router.html?rurl=router&router=psbc&appid=CUP16522400671¶ms={\"payMode\":\"B\",\"payItemNo\":\"41301106100124\",\"userNo\":"+id+"}"); |
| | | |
| | | }else if(outPark.getStatus() == 1){ |
| | | }else if(StringUtils.isNotBlank(outPark.getPayCode()) && outPark.getStatus() == 1){ |
| | | return R.failed("已缴费"); |
| | | } |
| | | |
| | | if(StringUtils.isBlank(outPark.getPayCode())){ |
| | | addOrderRecord(outPark); |
| | | return R.ok("跳转邮储支付", "http://wxtest.smeia.cn/h5/static/router.html?rurl=router&router=psbc&appid=CUP16522400671¶ms={\"payMode\":\"B\",\"payItemNo\":\"41301106100124\",\"userNo\":"+id+"}"); |
| | | }else { |
| | | return R.failed("系统异常"); |
| | | return R.failed("出错"); |
| | | } |
| | | } |
| | | |
| | |
| | | } |
| | | } |
| | | |
| | | //插入停车订单记录 |
| | | public void addOrderRecord(OutPark outPark){ |
| | | outPark.setPayCode(outPark.getId()+""); |
| | | outParkService.saveOrUpdate(outPark); |
| | | Park park = parkService.getById(outPark.getParkId()); |
| | | OrderRecord orderRecord = new OrderRecord(); |
| | | orderRecord.setAddress(park.getName()); |
| | | orderRecord.setCarNo(outPark.getCarNo()); |
| | | orderRecord.setCode(outPark.getCode()); |
| | | orderRecord.setCode2(outPark.getCode2()); |
| | | orderRecord.setMoney(outPark.getPrice()); |
| | | orderRecord.setQueryId(outPark.getId()); |
| | | orderRecord.setType(1); |
| | | orderRecord.setTicketStatus(0); |
| | | orderRecord.setPayCode(outPark.getPayCode()); |
| | | orderRecordService.saveOrUpdate(orderRecord); |
| | | } |
| | | |
| | | //插入执法订单记录 |
| | | public void addOrderRecord2(Ticket ticket){ |
| | | OrderRecord orderRecord = new OrderRecord(); |
| | | orderRecord.setAddress(ticket.getAddress()); |
| | | orderRecord.setCarNo(ticket.getCarNo()); |
| | | orderRecord.setCode(ticket.getCode()); |
| | | orderRecord.setMoney(ticket.getMoney()); |
| | | orderRecord.setQueryId(ticket.getId()); |
| | | orderRecord.setType(0); |
| | | orderRecord.setPayCode(ticket.getPayCode()); |
| | | orderRecordService.saveOrUpdate(orderRecord); |
| | | } |
| | | |
| | | |
| | | |
| | | private void writeTxt( String txt) |
| | | { |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMdd"); |