|
|
@@ -26,12 +26,10 @@ import com.fs.common.utils.ServletUtils;
|
|
|
import com.fs.common.utils.StringUtils;
|
|
|
import com.fs.common.utils.ip.IpUtils;
|
|
|
import com.fs.company.domain.Company;
|
|
|
-import com.fs.company.domain.CompanyDivItem;
|
|
|
import com.fs.company.domain.CompanyUser;
|
|
|
import com.fs.company.mapper.CompanyConfigMapper;
|
|
|
import com.fs.company.param.FsStoreStatisticsParam;
|
|
|
import com.fs.company.service.ICompanyConfigService;
|
|
|
-import com.fs.company.service.ICompanyDivItemService;
|
|
|
import com.fs.company.service.ICompanyService;
|
|
|
import com.fs.company.service.ICompanyUserService;
|
|
|
import com.fs.company.vo.FsStorePaymentStatisticsVO;
|
|
|
@@ -114,8 +112,7 @@ import com.wechat.pay.java.service.transferbatch.model.InitiateBatchTransferRequ
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
import me.chanjar.weixin.common.bean.WxJsapiSignature;
|
|
|
import me.chanjar.weixin.common.error.WxErrorException;
|
|
|
-
|
|
|
-import org.apache.commons.lang3.exception.ExceptionUtils;
|
|
|
+import org.apache.commons.lang.exception.ExceptionUtils;
|
|
|
import org.redisson.api.RLock;
|
|
|
import org.redisson.api.RedissonClient;
|
|
|
import org.slf4j.Logger;
|
|
|
@@ -223,9 +220,6 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService {
|
|
|
@Autowired
|
|
|
private RedPacketLogMapper redPacketLogMapper;
|
|
|
|
|
|
- @Autowired
|
|
|
- private ICompanyDivItemService companyDivItemService;
|
|
|
-
|
|
|
/**
|
|
|
* 红包账户锁
|
|
|
*/
|
|
|
@@ -441,8 +435,6 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService {
|
|
|
orderType="course";
|
|
|
}else if (fsStorePayment.getBusinessType()==5){
|
|
|
orderType="appvip";
|
|
|
- } else if (fsStorePayment.getBusinessType()==7){
|
|
|
- orderType="payment";
|
|
|
}
|
|
|
|
|
|
if(fsStorePayment.getPayMode().equals("wx")){
|
|
|
@@ -530,14 +522,6 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService {
|
|
|
Map<String, Object> extendInfoMap = new HashMap<>();
|
|
|
extendInfoMap.put("org_req_seq_id", orderType+"-"+fsStorePayment.getPayCode());
|
|
|
request.setExtendInfo(extendInfoMap);
|
|
|
- //处理分账退款
|
|
|
- //1.判断是否是全额退款
|
|
|
- CompanyDivItem companyDivItem = null;
|
|
|
- try {
|
|
|
- companyDivItem = HuiFuUtils.doRefundDiv(fsStorePayment.getPayMoney(), fsStorePayment.getPayMoney(), fsStorePayment, extendInfoMap);
|
|
|
- } catch (Exception e) {
|
|
|
- logger.error("-----------------分账退款处理失败{}", e.getMessage());
|
|
|
- }
|
|
|
HuiFuRefundResult refund = huiFuService.refund(request);
|
|
|
logger.info("订单退款返回结果:"+paymentId+""+refund);
|
|
|
if((refund.getResp_code().equals("00000000")||refund.getResp_code().equals("00000100"))&&(refund.getTrans_stat().equals("S")||refund.getTrans_stat().equals("P"))){
|
|
|
@@ -547,15 +531,6 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService {
|
|
|
paymentMap.setRefundTime(DateUtils.getNowDate());
|
|
|
paymentMap.setRefundMoney(fsStorePayment.getPayMoney());
|
|
|
fsStorePaymentMapper.updateFsStorePayment(paymentMap);
|
|
|
- try {
|
|
|
- //处理分账退款明细表
|
|
|
- if (companyDivItem !=null && companyDivItem.getId() != null) {
|
|
|
- companyDivItem.setIsRefund(1);
|
|
|
- companyDivItemService.updateCompanyDivItem(companyDivItem);
|
|
|
- }
|
|
|
- } catch (Exception e) {
|
|
|
- logger.error("-----------------分账退款明细处理失败{}", e.getMessage());
|
|
|
- }
|
|
|
}else {
|
|
|
throw new CustomException("退款请求失败"+refund.getResp_desc());
|
|
|
}
|
|
|
@@ -660,7 +635,7 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService {
|
|
|
redisTemplateInteger.opsForValue().increment(userLimitKey, 1);
|
|
|
return result;
|
|
|
}catch (Exception e){
|
|
|
- logger.error("领取红包失败原因:{}", ExceptionUtils.getMessage(e),e);
|
|
|
+ logger.error("领取红包失败原因:{}", ExceptionUtils.getFullStackTrace(e),e);
|
|
|
throw new RuntimeException(e);
|
|
|
}finally {
|
|
|
if (lock.isHeldByCurrentThread()) {
|
|
|
@@ -790,10 +765,10 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService {
|
|
|
|
|
|
return result;
|
|
|
}catch (Exception e){
|
|
|
- log.error("领取红包失败原因:{}", ExceptionUtils.getFullStackTrace(e),e);
|
|
|
+ log.error("领取红包失败原因",e);
|
|
|
if(redPacketLog != null) {
|
|
|
redPacketLog.setStatus(2);
|
|
|
- redPacketLog.setErrorMsg(ExceptionUtils.getMessage(e));
|
|
|
+ redPacketLog.setErrorMsg(ExceptionUtils.getFullStackTrace(e));
|
|
|
}
|
|
|
throw new RuntimeException(e);
|
|
|
}finally {
|
|
|
@@ -1618,7 +1593,6 @@ public class FsStorePaymentServiceImpl implements IFsStorePaymentService {
|
|
|
storePayment.setRemark("商城收款订单支付");
|
|
|
storePayment.setOpenId(openId);
|
|
|
storePayment.setUserId(user.getUserId());
|
|
|
- storePayment.setPayMode("hf");//目前微信收款仅支持汇付
|
|
|
fsStorePaymentMapper.insertFsStorePayment(storePayment);
|
|
|
|
|
|
//汇付支付
|