Parcourir la source

fix: 税邦云回调日志

shc il y a 3 ans
Parent
commit
d8f0d6ec13

+ 1 - 0
hnqz-common/hnqz-common-security/src/main/java/com/qunzhixinxi/hnqz/common/security/component/GlobalExceptionHandlerResolver.java

@@ -48,6 +48,7 @@ public class GlobalExceptionHandlerResolver {
 	@ResponseStatus(HttpStatus.INTERNAL_SERVER_ERROR)
 	public R handleGlobalException(Exception e) {
 		log.error("全局异常信息 ex={}", e.getMessage(), e);
+		e.printStackTrace();
 		return R.failed(e.getLocalizedMessage());
 	}
 

+ 22 - 13
hnqz-upms/hnqz-upms-biz/src/main/java/com/qunzhixinxi/hnqz/admin/controller/WmTaxHelperController.java

@@ -880,12 +880,13 @@ public class WmTaxHelperController {
 			throw new RuntimeException("存在在途操作");
 		}
 
+		// 获取税邦云账号
+		SysSocialDetails condition = new SysSocialDetails();
+		condition.setType(LoginTypeEnum.TAX_HELPER.getType());
+		SysSocialDetails socialDetails = sysSocialDetailsMapper.selectOne(new QueryWrapper<>(condition));
+		String randomKey = socialDetails.getRandomKey();
+
 		try {
-			// 获取税邦云账号
-			SysSocialDetails condition = new SysSocialDetails();
-			condition.setType(LoginTypeEnum.TAX_HELPER.getType());
-			SysSocialDetails socialDetails = sysSocialDetailsMapper.selectOne(new QueryWrapper<>(condition));
-			String randomKey = socialDetails.getRandomKey();
 
 			//解密回调信息
 			String resInfo = taxHelperService.decryptResp(body, randomKey);
@@ -893,17 +894,20 @@ public class WmTaxHelperController {
 			String code = jsonObject.getStr("code");
 			String streamId = jsonObject.getStr("streamId");
 
+			log.info("回调解密信息:{}", jsonObject);
+
 			int settleStatus = 1;
 			// 回调成功操作
 			if (!"2000".equals(code)) {
 				settleStatus = 2;
 			}
-
+			log.info("更新结算状态:{}", settleStatus);
 			settleNoteService.settleNotify(streamId, settleStatus, true);
 
 
 		} catch (Exception e) {
-			log.error("税邦云解密失败");
+			log.error("税邦云回调失败");
+			e.printStackTrace();
 			throw new RuntimeException(e.getMessage());
 		}
 		return responseJson(2000,"结算通知回调成功");
@@ -934,12 +938,13 @@ public class WmTaxHelperController {
 			throw new RuntimeException("存在在途操作");
 		}
 
+		// 获取税邦云账号
+		SysSocialDetails condition = new SysSocialDetails();
+		condition.setType(LoginTypeEnum.TAX_HELPER.getType());
+		SysSocialDetails socialDetails = sysSocialDetailsMapper.selectOne(new QueryWrapper<>(condition));
+		String randomKey = socialDetails.getRandomKey();
+
 		try {
-			// 获取税邦云账号
-			SysSocialDetails condition = new SysSocialDetails();
-			condition.setType(LoginTypeEnum.TAX_HELPER.getType());
-			SysSocialDetails socialDetails = sysSocialDetailsMapper.selectOne(new QueryWrapper<>(condition));
-			String randomKey = socialDetails.getRandomKey();
 
 			//解密回调信息
 			String resInfo = taxHelperService.decryptResp(body, randomKey);
@@ -947,12 +952,15 @@ public class WmTaxHelperController {
 			String code = jsonObject.getStr("code");
 			String streamId = jsonObject.getStr("streamId");
 
+			log.info("回调解密信息:{}", jsonObject);
+
 			int settleStatus = 1;
 			// 回调成功操作
 			if (!"2000".equals(code)) {
 				settleStatus = 2;
 			}
 
+			log.info("更新结算状态:{}", settleStatus);
 			R<?> r = settleNoteService.settleNotify(streamId, settleStatus, !userId.contains("|"));
 
 			//回调
@@ -963,7 +971,8 @@ public class WmTaxHelperController {
 
 
 		} catch (Exception e) {
-			log.error("税邦云解密失败");
+			log.error("税邦云回调失败");
+			e.printStackTrace();
 			throw new RuntimeException(e.getMessage());
 		}