提交代码

master
胡锐 3 months ago
parent a25ac3f9b6
commit 829e638cdd
  1. 4
      cweb/src/main/java/com/cweb/controller/CommonController.java
  2. 6
      service/src/main/java/com/hfkj/service/hlt/HltCardRefundService.java
  3. 8
      service/src/main/java/com/hfkj/service/hlt/HuiLianTongUnionCardService.java

@ -73,8 +73,8 @@ public class CommonController {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, refundObj.getString("respMessage")); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, refundObj.getString("respMessage"));
} }
JSONObject consumptionResult = HuiLianTongUnionCardService.resolveResponse(refundObj.getString("data")); JSONObject consumptionResult = HuiLianTongUnionCardService.resolveResponse(refundObj.getString("data"));
if (!(consumptionResult.getBoolean("success") || Objects.equals(consumptionResult.getString("message"), "原交易已撤销,不可再次操作"))) { if (consumptionResult.getBoolean("success") != true) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "退款失败!"+consumptionResult.getString("message")); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "交易失败!"+consumptionResult.getString("message"));
} }
return ResponseMsgUtil.success(consumptionResult); return ResponseMsgUtil.success(consumptionResult);

@ -62,8 +62,8 @@ public class HltCardRefundService {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, refundObj.getString("respMessage")); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, refundObj.getString("respMessage"));
} }
JSONObject consumptionResult = HuiLianTongUnionCardService.resolveResponse(refundObj.getString("data")); JSONObject consumptionResult = HuiLianTongUnionCardService.resolveResponse(refundObj.getString("data"));
if (!(consumptionResult.getBoolean("success") || Objects.equals(consumptionResult.getString("message"), "原交易已撤销,不可再次操作"))) { if (consumptionResult.getBoolean("success") != true) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "退款失败!"+consumptionResult.getString("message")); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, "交易失败!"+consumptionResult.getString("message"));
} }
oldCardRecord.setRefundTime(new Date()); oldCardRecord.setRefundTime(new Date());
oldCardRecord.setPayStatus(HltCardRecordPayStatusEnum.status3.getCode()); oldCardRecord.setPayStatus(HltCardRecordPayStatusEnum.status3.getCode());
@ -119,7 +119,7 @@ public class HltCardRefundService {
} }
// 响应参数 // 响应参数
JSONObject payConsumptionResult = HuiLianTongUnionCardService.resolveResponse(consumption.getString("data")); JSONObject payConsumptionResult = HuiLianTongUnionCardService.resolveResponse(consumption.getString("data"));
if (consumptionResult.getBoolean("success") != true) { if (payConsumptionResult.getBoolean("success") != true) {
throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, payConsumptionResult.getString("message")); throw ErrorHelp.genException(SysCode.System, ErrorCode.COMMON_ERROR, payConsumptionResult.getString("message"));
} }
newRecord.setPaySerialNo(consumptionResult.getString("orderId")); newRecord.setPaySerialNo(consumptionResult.getString("orderId"));

@ -252,15 +252,11 @@ public class HuiLianTongUnionCardService {
public static JSONObject resolveResponse(String param) { public static JSONObject resolveResponse(String param) {
String data = param.replace("\\n", ""); String data = param.replace("\\n", "");
String decodeData = DesUtil.decode(HLT_CARD_SIGN_CODE, data, Charset.forName("UTF-8")); String decodeData = DesUtil.decode(HLT_CARD_SIGN_CODE, data, Charset.forName("UTF-8"));
log.info("响应data参数: " + data);
log.info("============请求任务Start=============");
log.info("解析响应的参数-请求参数: " + data);
JSONObject returnObject = JSONObject.parseObject(decodeData); JSONObject returnObject = JSONObject.parseObject(decodeData);
log.info("解析响应的参数-响应参数: " + returnObject.toJSONString()); log.info("解析响应参数: " + returnObject.toJSONString());
log.info("============请求任务End==============");
return returnObject; return returnObject;
} }

Loading…
Cancel
Save