kongdeqiang
2023-09-20 3ef02177eae63e4287e27aa36493d696b53c5621
src/main/java/com/boying/controller/phone/YCPayController.java
@@ -107,6 +107,18 @@
        if(StringUtils.isBlank(outPark.getPayCode())){
            String logs = sdf.format(new Date())+" 车牌号为:"+outPark.getCarNo()+",申请缴费------》\n";
            writeTxt(logs);
            List<EnterPark> byCarNo = enterParkService.findByCarNo(outPark.getCarNo(),outPark.getParkId());
            if(byCarNo.size()>0){
                EnterPark enterPark = byCarNo.get(0);
                if(enterPark != null && enterPark.getIsPay() == 1){
                    if(outPark.getPrice()==enterPark.getPrice()){
                        return R.failed("已缴费");
                    }else {
                        outPark.setPrice(outPark.getPrice()-enterPark.getPrice());
                        outParkService.updateById(outPark);
                    }
                }
            }
            addOrderRecord(outPark);
            return R.ok("跳转邮储支付","https://openpayment.psbc.com/h5/static/router.html?rurl=router&router=psbc&appid=CUP14094502391&params={\"payMode\":\"B\",\"payItemNo\":\"41304508000500\",\"userNo\":"+id+"}");
        }else {
@@ -131,6 +143,12 @@
                updateOrderRecord(queryId,"03");
                String logs = sdf.format(new Date())+" 车牌号为:"+byId.getCarNo()+",缴费成功------》\n";
                writeTxt(logs);
                List<EnterPark> byCarNo = enterParkService.findByCarNo(byId.getCarNo(),byId.getParkId());
                if(byCarNo.size()>0){
                    EnterPark enterPark = byCarNo.get(0);
                    enterPark.setIsPay(1);
                    enterParkService.updateById(enterPark);
                }
                return R.ok(null,"回调成功");
            }else {
                String logs = sdf.format(new Date())+" 出场id为:"+queryId+",缴费失败------》\n";
@@ -259,9 +277,16 @@
        String logs = sdf.format(new Date())+" 车牌号为:"+outPark.getCarNo()+",创建订单------》\n";
        writeTxt(logs);
        outPark.setPayCode(outPark.getId()+"");
        List<EnterPark> byCarNo = enterParkService.findByCarNo(outPark.getCarNo(),outPark.getParkId());
        outParkService.updateById(outPark);
        Park park = parkService.getById(outPark.getParkId());
        OrderRecord orderRecord = new OrderRecord();
        if(byCarNo.size() >0){
            EnterPark enterPark = byCarNo.get(0);
            if(enterPark != null && enterPark.getImgId() != null){
                orderRecord.setImgInId(enterPark.getImgId());
            }
        }
        orderRecord.setAddress(park.getName());
        orderRecord.setCarNo(outPark.getCarNo());
        orderRecord.setCode(outPark.getCode());
@@ -273,13 +298,6 @@
        orderRecord.setPayCode(outPark.getPayCode());
        if(outPark.getImgId() != null){
            orderRecord.setImgOutId(outPark.getImgId());
        }
        List<EnterPark> byCarNo = enterParkService.findByCarNo(outPark.getCarNo(),outPark.getParkId());
        if(byCarNo.size() >0){
            EnterPark enterPark = byCarNo.get(0);
            if(enterPark != null && enterPark.getImgId() != null){
                orderRecord.setImgInId(enterPark.getImgId());
            }
        }
        orderRecordService.saveOrUpdate(orderRecord);
    }