|
@@ -70,25 +70,26 @@ public class ChinaumsSenselessPayService extends SuperService {
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
|
* 银联申请签约
|
|
* 银联申请签约
|
|
|
|
|
+ *
|
|
|
* @return
|
|
* @return
|
|
|
*/
|
|
*/
|
|
|
- public Object signApply(UnionApplySignParam param){
|
|
|
|
|
|
|
+ public Object signApply(UnionApplySignParam param) {
|
|
|
|
|
|
|
|
String projectOid = param.getProjectOid();
|
|
String projectOid = param.getProjectOid();
|
|
|
String userId = param.getUserId();
|
|
String userId = param.getUserId();
|
|
|
|
|
|
|
|
- if (StringUtils.isBlank(userId)){
|
|
|
|
|
|
|
+ if (StringUtils.isBlank(userId)) {
|
|
|
userId = getCurrentUserId();
|
|
userId = getCurrentUserId();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (StringUtils.isBlank(projectOid)){
|
|
|
|
|
|
|
+ if (StringUtils.isBlank(projectOid)) {
|
|
|
projectOid = getCurrentProjectOid();
|
|
projectOid = getCurrentProjectOid();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//获取银联支付产品账户及需要签约的商户号
|
|
//获取银联支付产品账户及需要签约的商户号
|
|
|
String accountName = orgPayAccountService.queryOgPayAccount(projectOid, PaymentType.UnionFrictionlessPay);
|
|
String accountName = orgPayAccountService.queryOgPayAccount(projectOid, PaymentType.UnionFrictionlessPay);
|
|
|
com.github.microservice.pay.client.ret.ResultContent<AccountModel> accountModelResultContent = payProductAccountService.get(accountName);
|
|
com.github.microservice.pay.client.ret.ResultContent<AccountModel> accountModelResultContent = payProductAccountService.get(accountName);
|
|
|
- if (!accountModelResultContent.getState().equals(ResultState.Success)){
|
|
|
|
|
|
|
+ if (!accountModelResultContent.getState().equals(ResultState.Success)) {
|
|
|
return accountModelResultContent;
|
|
return accountModelResultContent;
|
|
|
}
|
|
}
|
|
|
ChinaumsSenselessConf conf = (ChinaumsSenselessConf) accountModelResultContent.getContent().getConf();
|
|
ChinaumsSenselessConf conf = (ChinaumsSenselessConf) accountModelResultContent.getContent().getConf();
|
|
@@ -97,21 +98,21 @@ public class ChinaumsSenselessPayService extends SuperService {
|
|
|
ChinaumsSenselessUserSignInfo userSignInfo = chinaumsSenselessUserSignInfoDao.findTopByUserIdAndMidAndExpire(userId, mid, false);
|
|
ChinaumsSenselessUserSignInfo userSignInfo = chinaumsSenselessUserSignInfoDao.findTopByUserIdAndMidAndExpire(userId, mid, false);
|
|
|
param.setContractNo(CommonUtil.UUID());
|
|
param.setContractNo(CommonUtil.UUID());
|
|
|
|
|
|
|
|
- if (userSignInfo!=null && userSignInfo.getContractState()!=null){
|
|
|
|
|
- switch (userSignInfo.getContractState()){
|
|
|
|
|
|
|
+ if (userSignInfo != null && userSignInfo.getContractState() != null) {
|
|
|
|
|
+ switch (userSignInfo.getContractState()) {
|
|
|
case SIGNED -> {//已签约
|
|
case SIGNED -> {//已签约
|
|
|
return ResultContent.buildFail("签约已完成,请勿重复请求");
|
|
return ResultContent.buildFail("签约已完成,请勿重复请求");
|
|
|
}
|
|
}
|
|
|
case UNSIGNED -> {//未签约,已解约
|
|
case UNSIGNED -> {//未签约,已解约
|
|
|
return signApply(param, accountName, userId, mid);
|
|
return signApply(param, accountName, userId, mid);
|
|
|
}
|
|
}
|
|
|
- case RESCISSION ->{
|
|
|
|
|
|
|
+ case RESCISSION -> {
|
|
|
userSignInfo.setExpire(true);
|
|
userSignInfo.setExpire(true);
|
|
|
chinaumsSenselessUserSignInfoDao.save(userSignInfo);
|
|
chinaumsSenselessUserSignInfoDao.save(userSignInfo);
|
|
|
return signApply(param, accountName, userId, mid);
|
|
return signApply(param, accountName, userId, mid);
|
|
|
}
|
|
}
|
|
|
case APPLY -> {
|
|
case APPLY -> {
|
|
|
- if (System.currentTimeMillis() >= userSignInfo.getExpireTime()){
|
|
|
|
|
|
|
+ if (System.currentTimeMillis() >= userSignInfo.getExpireTime()) {
|
|
|
userSignInfo.setExpire(true);
|
|
userSignInfo.setExpire(true);
|
|
|
chinaumsSenselessUserSignInfoDao.save(userSignInfo);
|
|
chinaumsSenselessUserSignInfoDao.save(userSignInfo);
|
|
|
ChinaumsSenselessUserSignInfo newUserSignInfo = new ChinaumsSenselessUserSignInfo();
|
|
ChinaumsSenselessUserSignInfo newUserSignInfo = new ChinaumsSenselessUserSignInfo();
|
|
@@ -120,14 +121,14 @@ public class ChinaumsSenselessPayService extends SuperService {
|
|
|
}
|
|
}
|
|
|
return ResultContent.buildContent(toUserSignModel(userSignInfo));
|
|
return ResultContent.buildContent(toUserSignModel(userSignInfo));
|
|
|
}
|
|
}
|
|
|
- case UNKNOWN ->{
|
|
|
|
|
|
|
+ case UNKNOWN -> {
|
|
|
return ResultContent.buildFail("未知状态,请联系管理人员");
|
|
return ResultContent.buildFail("未知状态,请联系管理人员");
|
|
|
}
|
|
}
|
|
|
- case DELETING_CONTRACT ->{
|
|
|
|
|
|
|
+ case DELETING_CONTRACT -> {
|
|
|
return ResultContent.buildFail("解约中,请等待银行返回结果");
|
|
return ResultContent.buildFail("解约中,请等待银行返回结果");
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
- }else {
|
|
|
|
|
|
|
+ } else {
|
|
|
return signApply(param, accountName, userId, mid);
|
|
return signApply(param, accountName, userId, mid);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -140,12 +141,12 @@ public class ChinaumsSenselessPayService extends SuperService {
|
|
|
payProductParameter.setAccountName(accountName);
|
|
payProductParameter.setAccountName(accountName);
|
|
|
payProductParameter.setMeta(BeanUtil.bean2Map(param));
|
|
payProductParameter.setMeta(BeanUtil.bean2Map(param));
|
|
|
com.github.microservice.pay.client.ret.ResultContent<Object> signApplyResultContent = senselessPayService.signApply(payProductParameter);
|
|
com.github.microservice.pay.client.ret.ResultContent<Object> signApplyResultContent = senselessPayService.signApply(payProductParameter);
|
|
|
- if (signApplyResultContent.getState().equals(ResultState.Success)){
|
|
|
|
|
|
|
+ if (signApplyResultContent.getState().equals(ResultState.Success)) {
|
|
|
Object content = signApplyResultContent.getContent();
|
|
Object content = signApplyResultContent.getContent();
|
|
|
String json = JsonUtil.toJson(content);
|
|
String json = JsonUtil.toJson(content);
|
|
|
Map resultMap = JsonUtil.toObject(json, Map.class);
|
|
Map resultMap = JsonUtil.toObject(json, Map.class);
|
|
|
String errMsg = (String) resultMap.get("errMsg");
|
|
String errMsg = (String) resultMap.get("errMsg");
|
|
|
- if ("success".equals(errMsg)){
|
|
|
|
|
|
|
+ if ("success".equals(errMsg)) {
|
|
|
ChinaumsSenselessUserSignInfo userSignInfo = new ChinaumsSenselessUserSignInfo();
|
|
ChinaumsSenselessUserSignInfo userSignInfo = new ChinaumsSenselessUserSignInfo();
|
|
|
userSignInfo.setUserId(userId);
|
|
userSignInfo.setUserId(userId);
|
|
|
userSignInfo.setContractNo(param.getContractNo());
|
|
userSignInfo.setContractNo(param.getContractNo());
|
|
@@ -154,11 +155,11 @@ public class ChinaumsSenselessPayService extends SuperService {
|
|
|
userSignInfo.setRelateSsn((String) resultMap.get("relateSsn"));
|
|
userSignInfo.setRelateSsn((String) resultMap.get("relateSsn"));
|
|
|
userSignInfo.setCqpMpAppId((String) resultMap.get("cqpMpAppId"));
|
|
userSignInfo.setCqpMpAppId((String) resultMap.get("cqpMpAppId"));
|
|
|
userSignInfo.setCqpMpPath((String) resultMap.get("cqpMpPath"));
|
|
userSignInfo.setCqpMpPath((String) resultMap.get("cqpMpPath"));
|
|
|
- userSignInfo.setExpireTime(System.currentTimeMillis() + 30*60*1000);
|
|
|
|
|
|
|
+ userSignInfo.setExpireTime(System.currentTimeMillis() + 30 * 60 * 1000);
|
|
|
userSignInfo.setExpire(false);
|
|
userSignInfo.setExpire(false);
|
|
|
chinaumsSenselessUserSignInfoDao.save(userSignInfo);
|
|
chinaumsSenselessUserSignInfoDao.save(userSignInfo);
|
|
|
return signApplyResultContent;
|
|
return signApplyResultContent;
|
|
|
- }else {
|
|
|
|
|
|
|
+ } else {
|
|
|
return ResultContent.buildFail((String) resultMap.get("errMsg"));
|
|
return ResultContent.buildFail((String) resultMap.get("errMsg"));
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
@@ -170,51 +171,51 @@ public class ChinaumsSenselessPayService extends SuperService {
|
|
|
*/
|
|
*/
|
|
|
@SneakyThrows
|
|
@SneakyThrows
|
|
|
public Object signCancel(String userId, String projectOid) {
|
|
public Object signCancel(String userId, String projectOid) {
|
|
|
- if (StringUtils.isBlank(userId)){
|
|
|
|
|
|
|
+ if (StringUtils.isBlank(userId)) {
|
|
|
userId = getCurrentUserId();
|
|
userId = getCurrentUserId();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (StringUtils.isBlank(projectOid)){
|
|
|
|
|
|
|
+ if (StringUtils.isBlank(projectOid)) {
|
|
|
projectOid = getCurrentProjectOid();
|
|
projectOid = getCurrentProjectOid();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//获取银联支付产品账户及需要签约的商户号
|
|
//获取银联支付产品账户及需要签约的商户号
|
|
|
String accountName = orgPayAccountService.queryOgPayAccount(projectOid, PaymentType.UnionFrictionlessPay);
|
|
String accountName = orgPayAccountService.queryOgPayAccount(projectOid, PaymentType.UnionFrictionlessPay);
|
|
|
com.github.microservice.pay.client.ret.ResultContent<AccountModel> accountModelResultContent = payProductAccountService.get(accountName);
|
|
com.github.microservice.pay.client.ret.ResultContent<AccountModel> accountModelResultContent = payProductAccountService.get(accountName);
|
|
|
- if (!accountModelResultContent.getState().equals(ResultState.Success)){
|
|
|
|
|
|
|
+ if (!accountModelResultContent.getState().equals(ResultState.Success)) {
|
|
|
return accountModelResultContent;
|
|
return accountModelResultContent;
|
|
|
}
|
|
}
|
|
|
ChinaumsSenselessConf conf = (ChinaumsSenselessConf) accountModelResultContent.getContent().getConf();
|
|
ChinaumsSenselessConf conf = (ChinaumsSenselessConf) accountModelResultContent.getContent().getConf();
|
|
|
String mid = conf.getMchId();
|
|
String mid = conf.getMchId();
|
|
|
|
|
|
|
|
ChinaumsSenselessUserSignInfo userSignInfo = chinaumsSenselessUserSignInfoDao.findTopByUserIdAndMidAndExpire(userId, mid, false);
|
|
ChinaumsSenselessUserSignInfo userSignInfo = chinaumsSenselessUserSignInfoDao.findTopByUserIdAndMidAndExpire(userId, mid, false);
|
|
|
- if (userSignInfo==null){
|
|
|
|
|
|
|
+ if (userSignInfo == null) {
|
|
|
return ResultContent.buildFail("用户与该商户未签约");
|
|
return ResultContent.buildFail("用户与该商户未签约");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (userSignInfo.getContractState()==null){
|
|
|
|
|
|
|
+ if (userSignInfo.getContractState() == null) {
|
|
|
return ResultContent.buildFail("签约状态数据异常");
|
|
return ResultContent.buildFail("签约状态数据异常");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (userSignInfo.getContractState().equals(ContractState.RESCISSION)){
|
|
|
|
|
|
|
+ if (userSignInfo.getContractState().equals(ContractState.RESCISSION)) {
|
|
|
return ResultContent.buildFail("当前已经处于解约状态");
|
|
return ResultContent.buildFail("当前已经处于解约状态");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (userSignInfo.getContractState().equals(ContractState.SIGNED)){
|
|
|
|
|
|
|
+ if (userSignInfo.getContractState().equals(ContractState.SIGNED)) {
|
|
|
PayProductParameter<Object> payProductParameter = new PayProductParameter<>();
|
|
PayProductParameter<Object> payProductParameter = new PayProductParameter<>();
|
|
|
payProductParameter.setAccountName(accountName);
|
|
payProductParameter.setAccountName(accountName);
|
|
|
payProductParameter.setMeta(Map.of("contractId", userSignInfo.getContractId()));
|
|
payProductParameter.setMeta(Map.of("contractId", userSignInfo.getContractId()));
|
|
|
com.github.microservice.pay.client.ret.ResultContent<Object> objectResultContent = senselessPayService.signCancel(payProductParameter);
|
|
com.github.microservice.pay.client.ret.ResultContent<Object> objectResultContent = senselessPayService.signCancel(payProductParameter);
|
|
|
- if (objectResultContent.getState().equals(ResultState.Success)){
|
|
|
|
|
|
|
+ if (objectResultContent.getState().equals(ResultState.Success)) {
|
|
|
String json = JsonUtil.toJson(objectResultContent.getContent());
|
|
String json = JsonUtil.toJson(objectResultContent.getContent());
|
|
|
Map resultMap = JsonUtil.toObject(json, Map.class);
|
|
Map resultMap = JsonUtil.toObject(json, Map.class);
|
|
|
String errMsg = (String) resultMap.get("errMsg");
|
|
String errMsg = (String) resultMap.get("errMsg");
|
|
|
- if ("success".equals(errMsg)){
|
|
|
|
|
|
|
+ if ("success".equals(errMsg)) {
|
|
|
userSignInfo.setContractState(ContractState.RESCISSION);
|
|
userSignInfo.setContractState(ContractState.RESCISSION);
|
|
|
chinaumsSenselessUserSignInfoDao.save(userSignInfo);
|
|
chinaumsSenselessUserSignInfoDao.save(userSignInfo);
|
|
|
return ResultContent.buildSuccess();
|
|
return ResultContent.buildSuccess();
|
|
|
}
|
|
}
|
|
|
- return ResultContent.buildFail((String) resultMap.get("errMsg"));
|
|
|
|
|
|
|
+ return ResultContent.buildFail((String) resultMap.get("errMsg"));
|
|
|
}
|
|
}
|
|
|
return ResultContent.buildFail("解约失败");
|
|
return ResultContent.buildFail("解约失败");
|
|
|
}
|
|
}
|
|
@@ -224,26 +225,26 @@ public class ChinaumsSenselessPayService extends SuperService {
|
|
|
|
|
|
|
|
|
|
|
|
|
//TODO 添加 判断是否在平台外已经签约逻辑
|
|
//TODO 添加 判断是否在平台外已经签约逻辑
|
|
|
- public Object queryUserSignInfo(String userId, String projectOid){
|
|
|
|
|
- if (StringUtils.isBlank(userId)){
|
|
|
|
|
|
|
+ public Object queryUserSignInfo(String userId, String projectOid) {
|
|
|
|
|
+ if (StringUtils.isBlank(userId)) {
|
|
|
userId = getCurrentUserId();
|
|
userId = getCurrentUserId();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- if (StringUtils.isBlank(projectOid)){
|
|
|
|
|
|
|
+ if (StringUtils.isBlank(projectOid)) {
|
|
|
projectOid = getCurrentProjectOid();
|
|
projectOid = getCurrentProjectOid();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
//获取银联支付产品账户及需要签约的商户号
|
|
//获取银联支付产品账户及需要签约的商户号
|
|
|
String accountName = orgPayAccountService.queryOgPayAccount(projectOid, PaymentType.UnionFrictionlessPay);
|
|
String accountName = orgPayAccountService.queryOgPayAccount(projectOid, PaymentType.UnionFrictionlessPay);
|
|
|
com.github.microservice.pay.client.ret.ResultContent<AccountModel> accountModelResultContent = payProductAccountService.get(accountName);
|
|
com.github.microservice.pay.client.ret.ResultContent<AccountModel> accountModelResultContent = payProductAccountService.get(accountName);
|
|
|
- if (!accountModelResultContent.getState().equals(ResultState.Success)){
|
|
|
|
|
|
|
+ if (!accountModelResultContent.getState().equals(ResultState.Success)) {
|
|
|
return accountModelResultContent;
|
|
return accountModelResultContent;
|
|
|
}
|
|
}
|
|
|
ChinaumsSenselessConf conf = (ChinaumsSenselessConf) accountModelResultContent.getContent().getConf();
|
|
ChinaumsSenselessConf conf = (ChinaumsSenselessConf) accountModelResultContent.getContent().getConf();
|
|
|
String mid = conf.getMchId();
|
|
String mid = conf.getMchId();
|
|
|
|
|
|
|
|
ChinaumsSenselessUserSignInfo userSignInfo = chinaumsSenselessUserSignInfoDao.findTopByUserIdAndMidAndExpire(userId, mid, false);
|
|
ChinaumsSenselessUserSignInfo userSignInfo = chinaumsSenselessUserSignInfoDao.findTopByUserIdAndMidAndExpire(userId, mid, false);
|
|
|
- if (userSignInfo==null){
|
|
|
|
|
|
|
+ if (userSignInfo == null) {
|
|
|
ChinaumsSenselessUserSignInfoModel model = new ChinaumsSenselessUserSignInfoModel();
|
|
ChinaumsSenselessUserSignInfoModel model = new ChinaumsSenselessUserSignInfoModel();
|
|
|
model.setUserId(userId);
|
|
model.setUserId(userId);
|
|
|
model.setContractState(ContractState.UNSIGNED);
|
|
model.setContractState(ContractState.UNSIGNED);
|
|
@@ -255,19 +256,20 @@ public class ChinaumsSenselessPayService extends SuperService {
|
|
|
/**
|
|
/**
|
|
|
* 支付
|
|
* 支付
|
|
|
*/
|
|
*/
|
|
|
|
|
+ @SneakyThrows
|
|
|
public ResultContent senselessPay(String projectOid, String oid, String userId, BigDecimal total, String orderNo, String remark) {
|
|
public ResultContent senselessPay(String projectOid, String oid, String userId, BigDecimal total, String orderNo, String remark) {
|
|
|
String projectAccountName = orgPayAccountService.queryOgPayAccount(projectOid, PaymentType.UnionFrictionlessPay);
|
|
String projectAccountName = orgPayAccountService.queryOgPayAccount(projectOid, PaymentType.UnionFrictionlessPay);
|
|
|
//获取银联支付产品账户及需要签约的商户号
|
|
//获取银联支付产品账户及需要签约的商户号
|
|
|
String orgAccountName = orgPayAccountService.queryOgPayAccount(oid, PaymentType.UnionFrictionlessPay);
|
|
String orgAccountName = orgPayAccountService.queryOgPayAccount(oid, PaymentType.UnionFrictionlessPay);
|
|
|
|
|
|
|
|
com.github.microservice.pay.client.ret.ResultContent<AccountModel> orgAccountModelResultContent = payProductAccountService.get(orgAccountName);
|
|
com.github.microservice.pay.client.ret.ResultContent<AccountModel> orgAccountModelResultContent = payProductAccountService.get(orgAccountName);
|
|
|
- if (!orgAccountModelResultContent.getState().equals(ResultState.Success)){
|
|
|
|
|
|
|
+ if (!orgAccountModelResultContent.getState().equals(ResultState.Success)) {
|
|
|
return ResultContent.buildFail(orgAccountModelResultContent.getMsg());
|
|
return ResultContent.buildFail(orgAccountModelResultContent.getMsg());
|
|
|
}
|
|
}
|
|
|
ChinaumsSenselessConf orgConf = (ChinaumsSenselessConf) orgAccountModelResultContent.getContent().getConf();
|
|
ChinaumsSenselessConf orgConf = (ChinaumsSenselessConf) orgAccountModelResultContent.getContent().getConf();
|
|
|
|
|
|
|
|
com.github.microservice.pay.client.ret.ResultContent<AccountModel> projectAccountModelResultContent = payProductAccountService.get(projectAccountName);
|
|
com.github.microservice.pay.client.ret.ResultContent<AccountModel> projectAccountModelResultContent = payProductAccountService.get(projectAccountName);
|
|
|
- if (!projectAccountModelResultContent.getState().equals(ResultState.Success)){
|
|
|
|
|
|
|
+ if (!projectAccountModelResultContent.getState().equals(ResultState.Success)) {
|
|
|
return ResultContent.buildFail(projectAccountModelResultContent.getMsg());
|
|
return ResultContent.buildFail(projectAccountModelResultContent.getMsg());
|
|
|
}
|
|
}
|
|
|
ChinaumsSenselessConf projectConf = (ChinaumsSenselessConf) projectAccountModelResultContent.getContent().getConf();
|
|
ChinaumsSenselessConf projectConf = (ChinaumsSenselessConf) projectAccountModelResultContent.getContent().getConf();
|
|
@@ -275,7 +277,7 @@ public class ChinaumsSenselessPayService extends SuperService {
|
|
|
|
|
|
|
|
//获取用户签约协议号
|
|
//获取用户签约协议号
|
|
|
ChinaumsSenselessUserSignInfo userSignInfo = chinaumsSenselessUserSignInfoDao.findTopByUserIdAndMidAndExpire(userId, mid, false);
|
|
ChinaumsSenselessUserSignInfo userSignInfo = chinaumsSenselessUserSignInfoDao.findTopByUserIdAndMidAndExpire(userId, mid, false);
|
|
|
- if (userSignInfo==null || !userSignInfo.getContractState().equals(ContractState.SIGNED)){
|
|
|
|
|
|
|
+ if (userSignInfo == null || !userSignInfo.getContractState().equals(ContractState.SIGNED)) {
|
|
|
return ResultContent.buildFail("用户未签约或状态未知");
|
|
return ResultContent.buildFail("用户未签约或状态未知");
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -311,11 +313,11 @@ public class ChinaumsSenselessPayService extends SuperService {
|
|
|
request.setSrcReserve(JsonUtil.toJson(Map.of("userId", userId, "oid", oid, "projectOid", projectOid, "orderNo", orderNo)));
|
|
request.setSrcReserve(JsonUtil.toJson(Map.of("userId", userId, "oid", oid, "projectOid", projectOid, "orderNo", orderNo)));
|
|
|
payProductParameter.setMeta(BeanUtil.bean2Map(request));
|
|
payProductParameter.setMeta(BeanUtil.bean2Map(request));
|
|
|
com.github.microservice.pay.client.ret.ResultContent<Object> collectionResultContent = senselessPayService.collection(payProductParameter);
|
|
com.github.microservice.pay.client.ret.ResultContent<Object> collectionResultContent = senselessPayService.collection(payProductParameter);
|
|
|
- if (!collectionResultContent.getState().equals(ResultState.Success)){
|
|
|
|
|
|
|
+ if (!collectionResultContent.getState().equals(ResultState.Success)) {
|
|
|
return ResultContent.buildFail("请求失败");
|
|
return ResultContent.buildFail("请求失败");
|
|
|
}
|
|
}
|
|
|
- Map<String, Object> bodyMap = BeanUtil.bean2Map(collectionResultContent.getContent());
|
|
|
|
|
- if (bodyMap.get("respCode").equals("0000")){
|
|
|
|
|
|
|
+ Map bodyMap = JsonUtil.toObject(JsonUtil.toJson(collectionResultContent.getContent()), Map.class);
|
|
|
|
|
+ if (bodyMap.get("respCode").equals("0000")) {
|
|
|
return ResultContent.buildContent(collectionResultContent.getContent());
|
|
return ResultContent.buildContent(collectionResultContent.getContent());
|
|
|
}
|
|
}
|
|
|
return ResultContent.buildFail(bodyMap.get("respDesc").toString());
|
|
return ResultContent.buildFail(bodyMap.get("respDesc").toString());
|
|
@@ -328,13 +330,13 @@ public class ChinaumsSenselessPayService extends SuperService {
|
|
|
String orgAccountName = orgPayAccountService.queryOgPayAccount(oid, PaymentType.UnionFrictionlessPay);
|
|
String orgAccountName = orgPayAccountService.queryOgPayAccount(oid, PaymentType.UnionFrictionlessPay);
|
|
|
|
|
|
|
|
com.github.microservice.pay.client.ret.ResultContent<AccountModel> orgAccountModelResultContent = payProductAccountService.get(orgAccountName);
|
|
com.github.microservice.pay.client.ret.ResultContent<AccountModel> orgAccountModelResultContent = payProductAccountService.get(orgAccountName);
|
|
|
- if (!orgAccountModelResultContent.getState().equals(ResultState.Success)){
|
|
|
|
|
|
|
+ if (!orgAccountModelResultContent.getState().equals(ResultState.Success)) {
|
|
|
return ResultContent.buildFail(orgAccountModelResultContent.getMsg());
|
|
return ResultContent.buildFail(orgAccountModelResultContent.getMsg());
|
|
|
}
|
|
}
|
|
|
ChinaumsSenselessConf orgConf = (ChinaumsSenselessConf) orgAccountModelResultContent.getContent().getConf();
|
|
ChinaumsSenselessConf orgConf = (ChinaumsSenselessConf) orgAccountModelResultContent.getContent().getConf();
|
|
|
|
|
|
|
|
com.github.microservice.pay.client.ret.ResultContent<AccountModel> projectAccountModelResultContent = payProductAccountService.get(projectAccountName);
|
|
com.github.microservice.pay.client.ret.ResultContent<AccountModel> projectAccountModelResultContent = payProductAccountService.get(projectAccountName);
|
|
|
- if (!projectAccountModelResultContent.getState().equals(ResultState.Success)){
|
|
|
|
|
|
|
+ if (!projectAccountModelResultContent.getState().equals(ResultState.Success)) {
|
|
|
return ResultContent.buildFail(projectAccountModelResultContent.getMsg());
|
|
return ResultContent.buildFail(projectAccountModelResultContent.getMsg());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
@@ -375,11 +377,11 @@ public class ChinaumsSenselessPayService extends SuperService {
|
|
|
request.setSysSource(JsonUtil.toJson(Map.of("userId", userId, "oid", oid, "projectOid", projectOid, "orderNo", orderNo)));
|
|
request.setSysSource(JsonUtil.toJson(Map.of("userId", userId, "oid", oid, "projectOid", projectOid, "orderNo", orderNo)));
|
|
|
payProductParameter.setMeta(BeanUtil.bean2Map(request));
|
|
payProductParameter.setMeta(BeanUtil.bean2Map(request));
|
|
|
com.github.microservice.pay.client.ret.ResultContent<Object> refundResultContent = senselessPayService.refund(payProductParameter);
|
|
com.github.microservice.pay.client.ret.ResultContent<Object> refundResultContent = senselessPayService.refund(payProductParameter);
|
|
|
- if (!refundResultContent.getState().equals(ResultState.Success)){
|
|
|
|
|
|
|
+ if (!refundResultContent.getState().equals(ResultState.Success)) {
|
|
|
return ResultContent.buildFail("请求失败");
|
|
return ResultContent.buildFail("请求失败");
|
|
|
}
|
|
}
|
|
|
Map<String, Object> bodyMap = BeanUtil.bean2Map(refundResultContent.getContent());
|
|
Map<String, Object> bodyMap = BeanUtil.bean2Map(refundResultContent.getContent());
|
|
|
- if (bodyMap.get("respCode").equals("0000")){
|
|
|
|
|
|
|
+ if (bodyMap.get("respCode").equals("0000")) {
|
|
|
return ResultContent.buildContent(refundResultContent.getContent());
|
|
return ResultContent.buildContent(refundResultContent.getContent());
|
|
|
}
|
|
}
|
|
|
return ResultContent.buildFail(bodyMap.get("respDesc").toString());
|
|
return ResultContent.buildFail(bodyMap.get("respDesc").toString());
|
|
@@ -406,7 +408,7 @@ public class ChinaumsSenselessPayService extends SuperService {
|
|
|
sourceTransaction.setTransactionStatus(TransactionStatus.Success);
|
|
sourceTransaction.setTransactionStatus(TransactionStatus.Success);
|
|
|
sourceTransaction.setAmount(total.negate().longValue());
|
|
sourceTransaction.setAmount(total.negate().longValue());
|
|
|
sourceTransaction.setRemark(remark);
|
|
sourceTransaction.setRemark(remark);
|
|
|
- sourceTransaction.setMeta(Map.of("paymentType",PaymentType.UnionFrictionlessPay, "description", "银联无感支付"));
|
|
|
|
|
|
|
+ sourceTransaction.setMeta(Map.of("paymentType", PaymentType.UnionFrictionlessPay, "description", "银联无感支付"));
|
|
|
transferModel.setSource(new TransferTransactionsModel.GeneralLedgerTransaction[]{sourceTransaction});
|
|
transferModel.setSource(new TransferTransactionsModel.GeneralLedgerTransaction[]{sourceTransaction});
|
|
|
|
|
|
|
|
//构建入账账户
|
|
//构建入账账户
|
|
@@ -418,7 +420,7 @@ public class ChinaumsSenselessPayService extends SuperService {
|
|
|
destinationTransaction.setTransactionStatus(TransactionStatus.Success);
|
|
destinationTransaction.setTransactionStatus(TransactionStatus.Success);
|
|
|
destinationTransaction.setAmount(total.longValue());
|
|
destinationTransaction.setAmount(total.longValue());
|
|
|
destinationTransaction.setRemark(remark);
|
|
destinationTransaction.setRemark(remark);
|
|
|
- destinationTransaction.setMeta(Map.of("paymentType",PaymentType.UnionFrictionlessPay, "description", "用户余额支付"));
|
|
|
|
|
|
|
+ destinationTransaction.setMeta(Map.of("paymentType", PaymentType.UnionFrictionlessPay, "description", "用户余额支付"));
|
|
|
transferModel.setDestinations(new TransferTransactionsModel.GeneralLedgerTransaction[]{destinationTransaction});
|
|
transferModel.setDestinations(new TransferTransactionsModel.GeneralLedgerTransaction[]{destinationTransaction});
|
|
|
// transactionLogService.transfer(transferModel);
|
|
// transactionLogService.transfer(transferModel);
|
|
|
|
|
|
|
@@ -433,7 +435,7 @@ public class ChinaumsSenselessPayService extends SuperService {
|
|
|
userSourceTransaction.setTransactionStatus(TransactionStatus.Success);
|
|
userSourceTransaction.setTransactionStatus(TransactionStatus.Success);
|
|
|
userSourceTransaction.setAmount(total.negate().longValue());
|
|
userSourceTransaction.setAmount(total.negate().longValue());
|
|
|
userSourceTransaction.setRemark(remark);
|
|
userSourceTransaction.setRemark(remark);
|
|
|
- userSourceTransaction.setMeta(Map.of("paymentType",PaymentType.UnionFrictionlessPay, "description", "银联无感支付"));
|
|
|
|
|
|
|
+ userSourceTransaction.setMeta(Map.of("paymentType", PaymentType.UnionFrictionlessPay, "description", "银联无感支付"));
|
|
|
payTransferModel.setSource(new TransferTransactionsModel.GeneralLedgerTransaction[]{userSourceTransaction});
|
|
payTransferModel.setSource(new TransferTransactionsModel.GeneralLedgerTransaction[]{userSourceTransaction});
|
|
|
|
|
|
|
|
//构建入账账户
|
|
//构建入账账户
|
|
@@ -444,7 +446,7 @@ public class ChinaumsSenselessPayService extends SuperService {
|
|
|
orgDestinationTransaction.setTransactionStatus(TransactionStatus.Success);
|
|
orgDestinationTransaction.setTransactionStatus(TransactionStatus.Success);
|
|
|
orgDestinationTransaction.setAmount(total.longValue());
|
|
orgDestinationTransaction.setAmount(total.longValue());
|
|
|
orgDestinationTransaction.setRemark(remark);
|
|
orgDestinationTransaction.setRemark(remark);
|
|
|
- orgDestinationTransaction.setMeta(Map.of("paymentType",PaymentType.UnionFrictionlessPay, "description", "银联无感支付"));
|
|
|
|
|
|
|
+ orgDestinationTransaction.setMeta(Map.of("paymentType", PaymentType.UnionFrictionlessPay, "description", "银联无感支付"));
|
|
|
payTransferModel.setDestinations(new TransferTransactionsModel.GeneralLedgerTransaction[]{orgDestinationTransaction});
|
|
payTransferModel.setDestinations(new TransferTransactionsModel.GeneralLedgerTransaction[]{orgDestinationTransaction});
|
|
|
TransferTransactionsModels transactionsModels = new TransferTransactionsModels();
|
|
TransferTransactionsModels transactionsModels = new TransferTransactionsModels();
|
|
|
transactionsModels.setItems(new TransferTransactionsModel[]{transferModel, payTransferModel});
|
|
transactionsModels.setItems(new TransferTransactionsModel[]{transferModel, payTransferModel});
|
|
@@ -472,7 +474,7 @@ public class ChinaumsSenselessPayService extends SuperService {
|
|
|
sourceTransaction.setTransactionStatus(TransactionStatus.Success);
|
|
sourceTransaction.setTransactionStatus(TransactionStatus.Success);
|
|
|
sourceTransaction.setAmount(total.negate().longValue());
|
|
sourceTransaction.setAmount(total.negate().longValue());
|
|
|
sourceTransaction.setRemark(remark);
|
|
sourceTransaction.setRemark(remark);
|
|
|
- sourceTransaction.setMeta(Map.of("paymentType",PaymentType.UnionFrictionlessPay, "description", "银联无感支付"));
|
|
|
|
|
|
|
+ sourceTransaction.setMeta(Map.of("paymentType", PaymentType.UnionFrictionlessPay, "description", "银联无感支付"));
|
|
|
transferModel.setSource(new TransferTransactionsModel.GeneralLedgerTransaction[]{sourceTransaction});
|
|
transferModel.setSource(new TransferTransactionsModel.GeneralLedgerTransaction[]{sourceTransaction});
|
|
|
|
|
|
|
|
//构建入账账户
|
|
//构建入账账户
|
|
@@ -484,7 +486,7 @@ public class ChinaumsSenselessPayService extends SuperService {
|
|
|
destinationTransaction.setTransactionStatus(TransactionStatus.Success);
|
|
destinationTransaction.setTransactionStatus(TransactionStatus.Success);
|
|
|
destinationTransaction.setAmount(total.longValue());
|
|
destinationTransaction.setAmount(total.longValue());
|
|
|
destinationTransaction.setRemark(remark);
|
|
destinationTransaction.setRemark(remark);
|
|
|
- destinationTransaction.setMeta(Map.of("paymentType",PaymentType.UnionFrictionlessPay, "description", "用户余额支付"));
|
|
|
|
|
|
|
+ destinationTransaction.setMeta(Map.of("paymentType", PaymentType.UnionFrictionlessPay, "description", "用户余额支付"));
|
|
|
transferModel.setDestinations(new TransferTransactionsModel.GeneralLedgerTransaction[]{destinationTransaction});
|
|
transferModel.setDestinations(new TransferTransactionsModel.GeneralLedgerTransaction[]{destinationTransaction});
|
|
|
transactionLogService.transfer(transferModel);
|
|
transactionLogService.transfer(transferModel);
|
|
|
|
|
|
|
@@ -499,7 +501,7 @@ public class ChinaumsSenselessPayService extends SuperService {
|
|
|
userSourceTransaction.setTransactionStatus(TransactionStatus.Success);
|
|
userSourceTransaction.setTransactionStatus(TransactionStatus.Success);
|
|
|
userSourceTransaction.setAmount(total.negate().longValue());
|
|
userSourceTransaction.setAmount(total.negate().longValue());
|
|
|
userSourceTransaction.setRemark(remark);
|
|
userSourceTransaction.setRemark(remark);
|
|
|
- userSourceTransaction.setMeta(Map.of("paymentType",PaymentType.UnionFrictionlessPay, "description", "银联无感支付"));
|
|
|
|
|
|
|
+ userSourceTransaction.setMeta(Map.of("paymentType", PaymentType.UnionFrictionlessPay, "description", "银联无感支付"));
|
|
|
payTransferModel.setSource(new TransferTransactionsModel.GeneralLedgerTransaction[]{userSourceTransaction});
|
|
payTransferModel.setSource(new TransferTransactionsModel.GeneralLedgerTransaction[]{userSourceTransaction});
|
|
|
|
|
|
|
|
//构建入账账户
|
|
//构建入账账户
|
|
@@ -510,23 +512,23 @@ public class ChinaumsSenselessPayService extends SuperService {
|
|
|
destinationTransaction.setTransactionStatus(TransactionStatus.Success);
|
|
destinationTransaction.setTransactionStatus(TransactionStatus.Success);
|
|
|
destinationTransaction.setAmount(total.longValue());
|
|
destinationTransaction.setAmount(total.longValue());
|
|
|
destinationTransaction.setRemark(remark);
|
|
destinationTransaction.setRemark(remark);
|
|
|
- destinationTransaction.setMeta(Map.of("paymentType",PaymentType.UnionFrictionlessPay, "description", "银联无感支付"));
|
|
|
|
|
|
|
+ destinationTransaction.setMeta(Map.of("paymentType", PaymentType.UnionFrictionlessPay, "description", "银联无感支付"));
|
|
|
payTransferModel.setDestinations(new TransferTransactionsModel.GeneralLedgerTransaction[]{orgDestinationTransaction});
|
|
payTransferModel.setDestinations(new TransferTransactionsModel.GeneralLedgerTransaction[]{orgDestinationTransaction});
|
|
|
return transactionLogService.transfer(payTransferModel);
|
|
return transactionLogService.transfer(payTransferModel);
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
- private ChinaumsSenselessUserSignInfoModel toUserSignModel(ChinaumsSenselessUserSignInfo userSignInfo){
|
|
|
|
|
|
|
+ private ChinaumsSenselessUserSignInfoModel toUserSignModel(ChinaumsSenselessUserSignInfo userSignInfo) {
|
|
|
ChinaumsSenselessUserSignInfoModel model = new ChinaumsSenselessUserSignInfoModel();
|
|
ChinaumsSenselessUserSignInfoModel model = new ChinaumsSenselessUserSignInfoModel();
|
|
|
- if (userSignInfo!=null){
|
|
|
|
|
|
|
+ if (userSignInfo != null) {
|
|
|
BeanUtils.copyProperties(userSignInfo, model);
|
|
BeanUtils.copyProperties(userSignInfo, model);
|
|
|
}
|
|
}
|
|
|
return model;
|
|
return model;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- public void handleSignRetMessage(ChinaSenselessSignRet chinaSenselessSignRet){
|
|
|
|
|
|
|
+ public void handleSignRetMessage(ChinaSenselessSignRet chinaSenselessSignRet) {
|
|
|
ChinaumsSenselessUserSignInfo userSignInfo = chinaumsSenselessUserSignInfoDao.findTopByContractNo(chinaSenselessSignRet.getContractNo());
|
|
ChinaumsSenselessUserSignInfo userSignInfo = chinaumsSenselessUserSignInfoDao.findTopByContractNo(chinaSenselessSignRet.getContractNo());
|
|
|
- if (userSignInfo == null){
|
|
|
|
|
|
|
+ if (userSignInfo == null) {
|
|
|
log.info("签约通知回调:找不到签约用户信息 contractNo:{}", chinaSenselessSignRet.getContractNo());
|
|
log.info("签约通知回调:找不到签约用户信息 contractNo:{}", chinaSenselessSignRet.getContractNo());
|
|
|
return;
|
|
return;
|
|
|
}
|
|
}
|