exam-system/src/main/java/com/gkhy/exam/pay/controller/NonCoalPayController.java
@@ -174,7 +174,6 @@ @PostMapping("/updateNonCoalStu") @ApiOperation(value = "更新财政缴款码") @Anonymous public AjaxResult updateNonCoalStu(@RequestBody NonCoalPayStudentReqDto nonCoalPayStudent) { return toAjax(nonCoalPayStudentService.updateNonCoalStu(nonCoalPayStudent)); } @@ -207,14 +206,14 @@ @PostMapping("/queryOrder") @ApiOperation(value = "查询是否生成缴费订单") @ApiOperation(value = "查询是否缴费成功") @Anonymous @ApiImplicitParams({ @ApiImplicitParam(name = "id", dataTypeClass = Long.class, value = "个人缴费学员数据id,团队缴费数据id", required = true), @ApiImplicitParam(name = "payType", dataTypeClass = String.class, value = "1个人2是团队", required = true), }) public AjaxResult queryOrder(@RequestParam("id") Long id, @RequestParam("payType") String payType) { return success(nonCoalPayStudentService.sendOrder(id, payType)); return success(nonCoalPayStudentService.queryOrder(id, payType)); } exam-system/src/main/java/com/gkhy/exam/pay/controller/PaymentApiController.java
@@ -2,6 +2,7 @@ import com.alibaba.fastjson2.JSONObject; import com.gkhy.exam.pay.service.PaymentService; import com.ruoyi.common.annotation.Anonymous; import io.swagger.annotations.Api; import io.swagger.annotations.ApiOperation; import lombok.extern.slf4j.Slf4j; @@ -25,6 +26,7 @@ @ApiOperation(value = "支付Api-回调", notes = "支付Api-回调") @PostMapping({"/callBack"}) @Anonymous public JSONObject add(@RequestParam Map<String, Object> callBackParam) { String jsonStr = baseToString(callBackParam.get("reqdata").toString()); JSONObject jsonObject = JSONObject.parseObject(jsonStr); exam-system/src/main/java/com/gkhy/exam/pay/mapper/NonCoalPayMapper.java
@@ -60,7 +60,7 @@ */ public int insertNonCoalPay(NonCoalPay nonCoalPay); List<NonCoalPayOrder> selectNonCoalPayOrderByParam(@Param("dataId") Long dataId, @Param("payType") Long payType); List<NonCoalPayOrder> selectNonCoalPayOrderByParam(@Param("dataId") Long dataId, @Param("payType") Long payType, @Param("isPay") Long isPay); /** * 修改【请填写功能名称】 exam-system/src/main/java/com/gkhy/exam/pay/service/impl/NonCoalPayStudentServiceImpl.java
@@ -66,7 +66,7 @@ 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, "未找到相关缴费信息"); } @@ -161,7 +161,7 @@ @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, "未找到相关缴费信息"); } @@ -174,22 +174,27 @@ } 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, respdata.getDate("payTime")) .eq(NonCoalPayStudent::getOrderNo, nonCoalStuRep.getOrderNo()).eq(NonCoalPayStudent::getDelFlag, 0) .eq(NonCoalPayStudent::getPayStatus, 0)); } else { log.error("查询财政订单失败:" + result.getString("respmsg") + ",错误编码:" + result.getString("respcode")); } nonCoalPayStudentMapper.update(null, Wrappers.<NonCoalPayStudent>lambdaUpdate() .set(NonCoalPayStudent::getPayStatus, 1) .set(NonCoalPayStudent::getPayTime, result.getDate("payTime")) .eq(NonCoalPayStudent::getOrderNo, nonCoalStuRep.getOrderNo()).eq(NonCoalPayStudent::getDelFlag, 0) .eq(NonCoalPayStudent::getPayStatus, 0)); } else if (status == null) { log.error("查询财政订单失败:" + result.getString("respmsg") + ",错误编码:" + result.getString("respcode")); } } catch (Exception e) { log.error("查询财政订单失败:" + e.getMessage()); exam-system/src/main/resources/mapper/pay/NonCoalPayMapper.xml
@@ -269,7 +269,8 @@ t.gov_pay_status, t.order_no from non_coal_pay a inner join non_coal_pay_student t on t.non_coal_pay_id = a.id and t.del_flag = 0 and t.pay_status = 0 inner join non_coal_pay_student t on t.non_coal_pay_id = a.id and t.del_flag = 0 <if test="isPay != null and isPay == 1 ">and t.pay_status = 0</if> inner join non_coal_pay_category b on a.id = b.non_coal_pay_id and b.del_flag = 0 left join non_coal_category c on b.category_id = c.id and c.del_flag = 0 where a.del_flag = 0 ruoyi-admin/src/main/resources/application-pro.yml
@@ -87,7 +87,7 @@ # 数据库索引 database: 5 # 密码 password: akj78avauba789a password: # 连接超时时间 timeout: 10s lettuce: @@ -132,9 +132,9 @@ finance: apiId: ED76A5F1703540BE977D34780B371FEB apiId: A1749891493E4CDDBFE4506357B1F0AB orderUrl: http://finpt.xjcz.gov.cn/fs-service/fs-pay/invoice.do payNotifyUrl: http://finpt.xjcz.gov.cn/fs-service/fs-pay/notifyConfirm.do payQueryUrl: http://finpt.xjcz.gov.cn/fs-service-test/fs-pay/query.do payQueryUrl: http://finpt.xjcz.gov.cn/fs-service/fs-pay/query.do queryUrl: http://finpt.xjcz.gov.cn/fs-service/fs-pay/queryFile.do uploadXmlUrl: http://finpt.xjcz.gov.cn/fs-service/fs-pay/uploadXml.do ruoyi-common/src/main/java/com/ruoyi/common/config/RedissonConfig.java
@@ -1,5 +1,6 @@ package com.ruoyi.common.config; import com.ruoyi.common.utils.StringUtils; import org.redisson.Redisson; import org.redisson.api.RedissonClient; import org.redisson.config.Config; @@ -23,8 +24,10 @@ @ConditionalOnMissingBean(RedissonClient.class) public RedissonClient redissonClient() { Config config = new Config(); config.useSingleServer().setAddress("redis://" + host + ":" + port) .setPassword(password); // 更多.set config.useSingleServer().setAddress("redis://" + host + ":" + port); if (StringUtils.isNotEmpty(password)) { config.useSingleServer().setPassword(password); } return Redisson.create(config); } }