|
|
@@ -1,5 +1,7 @@
|
|
|
package org.dromara.backstage.business.self;
|
|
|
|
|
|
+import cn.hutool.core.date.DateUtil;
|
|
|
+
|
|
|
import cn.hutool.core.codec.Base64;
|
|
|
import cn.hutool.core.collection.CollectionUtil;
|
|
|
import cn.hutool.core.util.ObjectUtil;
|
|
|
@@ -9,6 +11,7 @@ import cn.hutool.http.HttpUtil;
|
|
|
import cn.hutool.json.JSONUtil;
|
|
|
import lombok.RequiredArgsConstructor;
|
|
|
import lombok.extern.slf4j.Slf4j;
|
|
|
+import org.dromara.backstage.business.payments.ThirdPayBusiness;
|
|
|
import org.dromara.backstage.consumption.domain.bo.XfCreditAccountBackBo;
|
|
|
import org.dromara.backstage.consumption.domain.vo.XfCreditAccountBackVo;
|
|
|
import org.dromara.backstage.consumption.service.IXfCreditAccountBackService;
|
|
|
@@ -18,9 +21,8 @@ import org.dromara.backstage.payment.domain.vo.PayOrderVo;
|
|
|
import org.dromara.backstage.payment.service.IPayOrderService;
|
|
|
import org.dromara.backstage.task.AsyncTaskService;
|
|
|
import org.dromara.common.core.api.ReturnResult;
|
|
|
-import org.dromara.common.core.enums.CreditStatusEnum;
|
|
|
-import org.dromara.common.core.enums.CreditTypeEnum;
|
|
|
-import org.dromara.common.core.enums.ResultCodeEnum;
|
|
|
+import org.dromara.common.core.domain.R;
|
|
|
+import org.dromara.common.core.enums.*;
|
|
|
import org.dromara.common.core.exception.ApiException;
|
|
|
import org.dromara.common.redis.utils.RedisUtils;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
@@ -63,6 +65,7 @@ public class SelfBusiness {
|
|
|
private final AsyncTaskService asyncTaskService;
|
|
|
private final IPayOrderService wxOrderService;
|
|
|
private final IXfCreditAccountBackService creditAccountBackService;
|
|
|
+ private final ThirdPayBusiness thirdPayBusiness;
|
|
|
|
|
|
/**
|
|
|
* 获取短信平台token
|
|
|
@@ -119,10 +122,7 @@ public class SelfBusiness {
|
|
|
public void sendSmsNoRoom(String phone,String realName,String className){
|
|
|
sendSms(phone, String.format(messageNoRoom.replace("rn", "\r\n"), realName, className));
|
|
|
}
|
|
|
- public ReturnResult getWechatRechargeQrCode(Map<String, String> mapParams){
|
|
|
- long cardNo = Long.parseLong(mapParams.get("cardNo"));
|
|
|
- int termNo = Integer.parseInt(mapParams.get("termNo"));
|
|
|
- int bagCode = Integer.parseInt(mapParams.get("bagCode"));
|
|
|
+ public R<Map<String, String>> getWechatRechargeQrCode(Map<String, String> mapParams){
|
|
|
int workStationNumb = Integer.parseInt(mapParams.get("workStationNumb"));
|
|
|
String userId = mapParams.get("userId");
|
|
|
String userXm = mapParams.get("userXm");
|
|
|
@@ -130,12 +130,31 @@ public class SelfBusiness {
|
|
|
String deptId = mapParams.get("deptId");
|
|
|
String mobile = mapParams.get("mobile");
|
|
|
BigDecimal dealValue = new BigDecimal(mapParams.get("dealValue"));
|
|
|
- String dealDate = mapParams.get("dealDate");
|
|
|
- String operatorId = mapParams.get("operatorId");
|
|
|
|
|
|
- CreditTypeEnum creditType = CreditTypeEnum.WECHAT_RECHARGE;
|
|
|
String callBackUrl = rechargeBackUrl + "/teacher/recharge/" + userId + "/" + dealValue + "/" + workStationNumb + "/";
|
|
|
- return createQrCode(creditType, userId, userXm, deptId, deptName, mobile, dealValue, callBackUrl);
|
|
|
+ PayOrderBo payOrderBo = new PayOrderBo();
|
|
|
+ payOrderBo.setCreditTime(DateUtil.date());
|
|
|
+ payOrderBo.setCreditType(CreditTypeEnum.WECHAT_RECHARGE.code().toString());
|
|
|
+ payOrderBo.setPayStyle(PayStyleEnum.WECHAT.code().toString());
|
|
|
+ payOrderBo.setPayStatus(PayStatusEnum.UNPAID.code().toString());
|
|
|
+ payOrderBo.setReceiptMoney(dealValue);
|
|
|
+ payOrderBo.setCreditStatus(CreditStatusEnum.CREATE.code().toString());
|
|
|
+ payOrderBo.setTitle("");
|
|
|
+ payOrderBo.setBackUrl(callBackUrl);
|
|
|
+ payOrderBo.setRealName(userXm);
|
|
|
+ payOrderBo.setUserId(Long.parseLong(userId));
|
|
|
+ payOrderBo.setPhone(mobile);
|
|
|
+ payOrderBo.setDeptName(deptName);
|
|
|
+ payOrderBo.setDeptId(Long.parseLong(deptId));
|
|
|
+ payOrderBo.setCreateBy(Long.parseLong(userId));
|
|
|
+ payOrderBo.setCreateTime(DateUtil.date());
|
|
|
+
|
|
|
+ R<Map<String,String>> getResult = thirdPayBusiness.createCollectQrCode(payOrderBo);
|
|
|
+ if (R.isSuccess(getResult)) {
|
|
|
+ return getResult;
|
|
|
+ }
|
|
|
+ return R.fail(getResult.getMsg());
|
|
|
+ //return createQrCode(creditType, userId, userXm, deptId, deptName, mobile, dealValue, callBackUrl);
|
|
|
}
|
|
|
|
|
|
/**
|