|
@@ -10,6 +10,7 @@ import com.rongwei.commonservice.service.impl.RedisServiceImpl;
|
|
|
import com.rongwei.rwcommon.base.BaseDo;
|
|
|
import com.rongwei.rwcommon.base.R;
|
|
|
import com.rongwei.rwcommon.base.exception.CustomException;
|
|
|
+import com.rongwei.rwcommon.utils.Constants;
|
|
|
import com.rongwei.rwcommonentity.commonservers.domain.TenantDo;
|
|
|
import com.rongwei.zhsw.system.config.WeChatAboutApiPara;
|
|
|
import com.rongwei.zhsw.system.dao.CommonBusinessDao;
|
|
@@ -25,10 +26,13 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.http.HttpStatus;
|
|
|
import org.springframework.http.ResponseEntity;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
+import org.springframework.web.context.request.RequestContextHolder;
|
|
|
+import org.springframework.web.context.request.ServletRequestAttributes;
|
|
|
|
|
|
import javax.crypto.Cipher;
|
|
|
import javax.crypto.spec.GCMParameterSpec;
|
|
|
import javax.crypto.spec.SecretKeySpec;
|
|
|
+import javax.servlet.http.HttpServletRequest;
|
|
|
import java.io.IOException;
|
|
|
import java.util.*;
|
|
|
import java.util.stream.Collectors;
|
|
@@ -164,6 +168,10 @@ public class PayMentServiceImpl implements PayMentService {
|
|
|
log.error("回调函数解析异常");
|
|
|
return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(error.toString());
|
|
|
}
|
|
|
+ ServletRequestAttributes attributes = (ServletRequestAttributes) RequestContextHolder.getRequestAttributes();
|
|
|
+ HttpServletRequest request = attributes.getRequest();
|
|
|
+ // 设置租户信息 自动切库
|
|
|
+ request.setAttribute(Constants.SAAS_LOGIN_TOKEN, deKey);
|
|
|
ObjectMapper mapper = new ObjectMapper();
|
|
|
WeChatPayTransactionVo transaction = null;
|
|
|
try {
|
|
@@ -182,7 +190,12 @@ public class PayMentServiceImpl implements PayMentService {
|
|
|
log.debug("支付回调:{}", transaction);
|
|
|
log.error("开始更新缴费记录信息");
|
|
|
// 更新缴费记录相关信息
|
|
|
- swBillingRecordService.getBaseMapper().updateWeChatPayInfo(deKey, outTradeNo, transactionId, analysisStr, successTime);
|
|
|
- return ResponseEntity.status(HttpStatus.OK).body("");
|
|
|
+ int i = swBillingRecordService.getBaseMapper().updateWeChatPayInfo(deKey, outTradeNo, transactionId, analysisStr, successTime);
|
|
|
+ log.debug("受影响的行数:{}", i);
|
|
|
+ if (i > 0) {
|
|
|
+ return ResponseEntity.status(HttpStatus.OK).body("");
|
|
|
+ } else {
|
|
|
+ return ResponseEntity.status(HttpStatus.INTERNAL_SERVER_ERROR).body(error.toString());
|
|
|
+ }
|
|
|
}
|
|
|
}
|