| | |
| | | Boolean b = redisLock.tryLock(lockKey, 30, 40, TimeUnit.SECONDS); |
| | | if (b) { |
| | | String orderNo = RandomUtil.generateOrderNumber(dataId, "NC"); |
| | | List<NonCoalPayOrder> nonCoalPayOrders = nonCoalPayMapper.selectNonCoalPayOrderByParam(dataId, Long.valueOf(payType)); |
| | | List<NonCoalPayOrder> nonCoalPayOrders = nonCoalPayMapper.selectNonCoalPayOrderByParam(dataId, Long.valueOf(payType), 1L); |
| | | if (StringUtils.isEmpty(nonCoalPayOrders)) { |
| | | throw new BusinessException(this.getClass(), ResultConstants.BUSINESS_ERROR, "未找到相关缴费信息"); |
| | | } |
| | |
| | | |
| | | @Override |
| | | public NonCoalStuRep queryOrder(Long dataId, String payType) { |
| | | List<NonCoalPayOrder> nonCoalPayOrders = nonCoalPayMapper.selectNonCoalPayOrderByParam(dataId, Long.valueOf(payType)); |
| | | List<NonCoalPayOrder> nonCoalPayOrders = nonCoalPayMapper.selectNonCoalPayOrderByParam(dataId, Long.valueOf(payType), 2L); |
| | | if (StringUtils.isEmpty(nonCoalPayOrders)) { |
| | | throw new BusinessException(this.getClass(), ResultConstants.BUSINESS_ERROR, "未找到相关缴费信息"); |
| | | } |
| | |
| | | } |
| | | NonCoalStuRep nonCoalStuRep = nonCoalStuList.get(0); |
| | | |
| | | if (nonCoalStuRep.getPayStatus() == 1) { |
| | | throw new BusinessException(this.getClass(), ResultConstants.BUSINESS_ERROR, "已缴费请勿重复缴费"); |
| | | } |
| | | // if (nonCoalStuRep.getPayStatus() == 1) { |
| | | // throw new BusinessException(this.getClass(), ResultConstants.BUSINESS_ERROR, "已缴费请勿重复缴费"); |
| | | // } |
| | | |
| | | if (nonCoalStuRep.getGovPayStatus() == 2 && nonCoalStuRep.getPayStatus() == 0) { |
| | | try { |
| | | JSONObject result = payUtils.query(nonCoalStuRep.getOrderNo()); |
| | | String status = result.getString("status"); |
| | | if (("1").equals(status)) { |
| | | |
| | | log.info("查询财政订单返回结果:" + result); |
| | | String respcode = result.getString("respcode"); |
| | | if ("BUS0000".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, result.getDate("payTime")) |
| | | .set(NonCoalPayStudent::getPayTime, respdata.getDate("payTime")) |
| | | .eq(NonCoalPayStudent::getOrderNo, nonCoalStuRep.getOrderNo()).eq(NonCoalPayStudent::getDelFlag, 0) |
| | | .eq(NonCoalPayStudent::getPayStatus, 0)); |
| | | } else if (status == null) { |
| | | } else { |
| | | log.error("查询财政订单失败:" + result.getString("respmsg") + ",错误编码:" + result.getString("respcode")); |
| | | } |
| | | |
| | | } |
| | | } catch (Exception e) { |
| | | log.error("查询财政订单失败:" + e.getMessage()); |
| | | |