kongdeqiang
2023-07-10 85f5baee0e3d255860395278dcb5cbb5cc766023
src/main/java/com/boying/controller/phone/YCPayController.java
@@ -64,6 +64,7 @@
     */
    @PostMapping("park")
    public Object park(Long id){
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss");
        OutPark outPark =  outParkService.getById(id);
        if(outPark.getPrice()==0){
            updateOutPark(outPark.getId(),"03");
@@ -94,6 +95,8 @@
            }
        }
        if(StringUtils.isNotBlank(outPark.getPayCode()) && outPark.getStatus() == 0){
            String logs = sdf.format(new Date())+" 车牌号为:"+outPark.getCarNo()+",申请缴费2------》\n";
            writeTxt(logs);
           // "http://wxtest.smeia.cn/h5/static/router.html?rurl=router&router=psbc&appid=CUP16522400671&params={\"payMode\":\"B\",\"payItemNo\":\"41301106100124\",\"userNo\":"+id+"}"
            return R.ok("跳转邮储支付","https://openpayment.psbc.com/h5/static/router.html?rurl=router&router=psbc&appid=CUP14094502391&params={\"payMode\":\"B\",\"payItemNo\":\"41304508000500\",\"userNo\":"+id+"}");
          //  return R.ok("跳转邮储支付","http://wxtest.smeia.cn/h5/static/router.html?rurl=router&router=psbc&appid=CUP16522400671&params={\"payMode\":\"B\",\"payItemNo\":\"41301106100124\",\"userNo\":"+id+"}");
@@ -102,6 +105,8 @@
        }
        if(StringUtils.isBlank(outPark.getPayCode())){
            String logs = sdf.format(new Date())+" 车牌号为:"+outPark.getCarNo()+",申请缴费------》\n";
            writeTxt(logs);
            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 {
@@ -117,15 +122,17 @@
    @GetMapping("/result")
    public Object result(Long queryId,int success,int msg){
        OutPark byId = outParkService.getById(queryId);
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss");
        if(byId == null){
            return R.failed("未查询到订单");
        }else {
            //修改订单状态 0成功
            if(success==0){
                updateOrderRecord(queryId,"03");
                String logs = sdf.format(new Date())+" 车牌号为:"+byId.getCarNo()+",缴费成功------》\n";
                writeTxt(logs);
                return R.ok(null,"回调成功");
            }else {
                SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss");
                String logs = sdf.format(new Date())+" 出场id为:"+queryId+",缴费失败------》\n";
                logs += "回执原因:"+msg+",\n";
                writeTxt(logs);
@@ -248,8 +255,11 @@
    //插入停车订单记录
    public void addOrderRecord(OutPark outPark){
        SimpleDateFormat sdf = new SimpleDateFormat("yyyy-MM-dd_HH:mm:ss");
        String logs = sdf.format(new Date())+" 车牌号为:"+outPark.getCarNo()+",创建订单------》\n";
        writeTxt(logs);
        outPark.setPayCode(outPark.getId()+"");
        outParkService.saveOrUpdate(outPark);
        outParkService.updateById(outPark);
        Park park = parkService.getById(outPark.getParkId());
        OrderRecord orderRecord = new OrderRecord();
        orderRecord.setAddress(park.getName());