| | |
| | | package com.gkhy.exam.pay.service.impl; |
| | | |
| | | import com.alibaba.fastjson2.JSONObject; |
| | | import com.baomidou.mybatisplus.core.toolkit.Wrappers; |
| | | import com.gkhy.exam.pay.entity.CoalPayStudent; |
| | | import com.gkhy.exam.pay.entity.NonCoalPayStudent; |
| | |
| | | @Override |
| | | public void notifyConfirm(String orderNo) { |
| | | try { |
| | | String resultStr1 = payUtils.affirmPost(orderNo); |
| | | JSONObject result1 = JSONObject.parseObject(resultStr1); |
| | | log.info("通知确定回参===" + result1); |
| | | JSONObject result = payUtils.query(orderNo); |
| | | log.info("查询财政订单返回结果:" + result); |
| | | String respcode = result.getString("respcode"); |
| | | if (CaiZhengConstans.CAI_ZHENG_SUCCESS.equals(respcode)) { |
| | | JSONObject respdata = result.getJSONObject("respdata"); |
| | | if (respdata != null && "1".equals(respdata.getString("status"))) { |
| | | nonCoalPayStudentMapper.update(null, Wrappers.<NonCoalPayStudent>lambdaUpdate() |
| | | .set(NonCoalPayStudent::getPayStatus, 1) |
| | | .set(NonCoalPayStudent::getPayTime, respdata.getDate("payTime")) |
| | | .eq(NonCoalPayStudent::getOrderNo, orderNo).eq(NonCoalPayStudent::getDelFlag, 0) |
| | | .eq(NonCoalPayStudent::getPayStatus, 0)); |
| | | payUtils.affirmPost(orderNo); |
| | | }else { |
| | | log.error("查询财政订单失败:" + result.getString("respmsg") + ",错误编码:" + result.getString("respcode")); |
| | | } |
| | | } |
| | | |
| | | } catch (Exception e) { |
| | | e.printStackTrace(); |
| | | } |
| | |
| | | .eq(CoalPayStudent::getOrderNo, orderNo).eq(CoalPayStudent::getDelFlag, 0) |
| | | .eq(CoalPayStudent::getPayStatus, 0)); |
| | | } |
| | | notifyConfirm(orderNo); |
| | | payUtils.asyncNotrify(orderNo); |
| | | |
| | | } |
| | | |