|
|
@@ -5,9 +5,7 @@ import com.github.microservice.core.util.bean.BeanUtil;
|
|
|
import com.github.microservice.net.ResultContent;
|
|
|
import com.github.microservice.pay.client.model.AccountModel;
|
|
|
import com.github.microservice.pay.client.model.PayProductParameter;
|
|
|
-import com.github.microservice.pay.client.model.chinaSenseless.ChinaSenselessPayRequest;
|
|
|
-import com.github.microservice.pay.client.model.chinaSenseless.ChinaSenselessRefundRequest;
|
|
|
-import com.github.microservice.pay.client.model.chinaSenseless.ChinaSenselessSignRet;
|
|
|
+import com.github.microservice.pay.client.model.chinaSenseless.*;
|
|
|
import com.github.microservice.pay.client.model.ledger.TransferTransactionsModel;
|
|
|
import com.github.microservice.pay.client.product.senseless.chinaumsSenseless.conf.ChinaumsSenselessConf;
|
|
|
import com.github.microservice.pay.client.ret.ResultState;
|
|
|
@@ -35,6 +33,7 @@ import org.springframework.beans.factory.annotation.Autowired;
|
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
import java.math.BigDecimal;
|
|
|
+import java.util.List;
|
|
|
import java.util.Map;
|
|
|
|
|
|
@Slf4j
|
|
|
@@ -147,6 +146,7 @@ public class ChinaumsSenselessPayService extends SuperService {
|
|
|
userSignInfo.setCqpMpAppId((String) resultMap.get("cqpMpAppId"));
|
|
|
userSignInfo.setCqpMpPath((String) resultMap.get("cqpMpPath"));
|
|
|
userSignInfo.setExpireTime(System.currentTimeMillis() + 30*60*1000);
|
|
|
+ userSignInfo.setExpire(false);
|
|
|
chinaumsSenselessUserSignInfoDao.save(userSignInfo);
|
|
|
return signApplyResultContent;
|
|
|
}else {
|
|
|
@@ -247,16 +247,22 @@ public class ChinaumsSenselessPayService extends SuperService {
|
|
|
* 支付
|
|
|
*/
|
|
|
public ResultContent senselessPay(String projectOid, String oid, String userId, BigDecimal total, String orderNo, String remark) {
|
|
|
-
|
|
|
+ String projectAccountName = orgPayAccountService.queryOgPayAccount(projectOid, PaymentType.UnionFrictionlessPay);
|
|
|
//获取银联支付产品账户及需要签约的商户号
|
|
|
- String accountName = orgPayAccountService.queryOgPayAccount(oid, PaymentType.UnionFrictionlessPay);
|
|
|
+ String orgAccountName = orgPayAccountService.queryOgPayAccount(oid, PaymentType.UnionFrictionlessPay);
|
|
|
|
|
|
- com.github.microservice.pay.client.ret.ResultContent<AccountModel> accountModelResultContent = payProductAccountService.get(accountName);
|
|
|
- if (!accountModelResultContent.getState().equals(ResultState.Success)){
|
|
|
- return ResultContent.buildFail(accountModelResultContent.getMsg());
|
|
|
+ com.github.microservice.pay.client.ret.ResultContent<AccountModel> orgAccountModelResultContent = payProductAccountService.get(orgAccountName);
|
|
|
+ if (!orgAccountModelResultContent.getState().equals(ResultState.Success)){
|
|
|
+ return ResultContent.buildFail(orgAccountModelResultContent.getMsg());
|
|
|
}
|
|
|
- ChinaumsSenselessConf conf = (ChinaumsSenselessConf) accountModelResultContent.getContent().getConf();
|
|
|
- String mid = conf.getMchId();
|
|
|
+ ChinaumsSenselessConf orgConf = (ChinaumsSenselessConf) orgAccountModelResultContent.getContent().getConf();
|
|
|
+
|
|
|
+ com.github.microservice.pay.client.ret.ResultContent<AccountModel> projectAccountModelResultContent = payProductAccountService.get(projectAccountName);
|
|
|
+ if (!projectAccountModelResultContent.getState().equals(ResultState.Success)){
|
|
|
+ return ResultContent.buildFail(projectAccountModelResultContent.getMsg());
|
|
|
+ }
|
|
|
+ ChinaumsSenselessConf projectConf = (ChinaumsSenselessConf) projectAccountModelResultContent.getContent().getConf();
|
|
|
+ String mid = projectConf.getMchId();
|
|
|
|
|
|
//获取用户签约协议号
|
|
|
ChinaumsSenselessUserSignInfo userSignInfo = chinaumsSenselessUserSignInfoDao.findTopByUserIdAndMidAndExpire(userId, mid, false);
|
|
|
@@ -265,13 +271,23 @@ public class ChinaumsSenselessPayService extends SuperService {
|
|
|
}
|
|
|
|
|
|
PayProductParameter<Object> payProductParameter = new PayProductParameter<>();
|
|
|
- payProductParameter.setAccountName(accountName);
|
|
|
+ payProductParameter.setAccountName(projectAccountName);
|
|
|
ChinaSenselessPayRequest request = new ChinaSenselessPayRequest();
|
|
|
request.setMchntOrderId(orderNo);
|
|
|
request.setSrcReserve(JsonUtil.toJson(Map.of("userId", userId, "oid", oid, "projectOid", projectOid)));
|
|
|
request.setContractId(userSignInfo.getContractId());
|
|
|
- request.setTotalAmount(total.toString());
|
|
|
+ request.setTotalAmount(total.toBigInteger().toString());
|
|
|
request.setAttachedData(remark);
|
|
|
+
|
|
|
+
|
|
|
+ VaFld vaFld = new VaFld();
|
|
|
+ SatInfo satInfo = new SatInfo();
|
|
|
+ satInfo.setMerId(orgConf.getMchId());
|
|
|
+ satInfo.setFeeBear("Y");
|
|
|
+ satInfo.setSatAmt(total.toBigInteger().toString());
|
|
|
+ vaFld.setSatInfo(List.of(satInfo));
|
|
|
+ request.setVaFld(vaFld);
|
|
|
+
|
|
|
payProductParameter.setMeta(BeanUtil.bean2Map(request));
|
|
|
com.github.microservice.pay.client.ret.ResultContent<Object> collectionResultContent = senselessPayService.collection(payProductParameter);
|
|
|
return ResultContent.buildContent(collectionResultContent.getContent());
|