Commit be3b3d30 by guojuxing

提现回调函数填写

parent a4ad9cff
...@@ -2,6 +2,7 @@ package com.gic.finance.service.outer.impl; ...@@ -2,6 +2,7 @@ package com.gic.finance.service.outer.impl;
import java.util.Date; import java.util.Date;
import com.gic.finance.util.AsynCallbackUtils;
import org.apache.commons.lang.StringUtils; import org.apache.commons.lang.StringUtils;
import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service; import org.springframework.stereotype.Service;
...@@ -101,6 +102,9 @@ public class CashWithdrawalApiServiceImpl implements CashWithdrawalApiService{ ...@@ -101,6 +102,9 @@ public class CashWithdrawalApiServiceImpl implements CashWithdrawalApiService{
record.setCashWithdrawalStatus(WithdrawalStatusEnum.REJECT.getCode()); record.setCashWithdrawalStatus(WithdrawalStatusEnum.REJECT.getCode());
record.setRejectReason(rejectReason); record.setRejectReason(rejectReason);
cashWithdrawalService.update(record); cashWithdrawalService.update(record);
//回调
AsynCallbackUtils.callBack(record, "com.gic.open.api.service.market.PayCallbackApiService", "callbackWithdraw");
return ServiceResponse.success(); return ServiceResponse.success();
} }
...@@ -128,6 +132,9 @@ public class CashWithdrawalApiServiceImpl implements CashWithdrawalApiService{ ...@@ -128,6 +132,9 @@ public class CashWithdrawalApiServiceImpl implements CashWithdrawalApiService{
record.setBankSerialNumber(bankSerialNumber); record.setBankSerialNumber(bankSerialNumber);
record.setCashWithdrawalStatus(WithdrawalStatusEnum.COMPLETE.getCode()); record.setCashWithdrawalStatus(WithdrawalStatusEnum.COMPLETE.getCode());
cashWithdrawalService.update(record); cashWithdrawalService.update(record);
//回调
AsynCallbackUtils.callBack(record, "com.gic.open.api.service.market.PayCallbackApiService", "callbackWithdraw");
return ServiceResponse.success(); return ServiceResponse.success();
} }
......
package com.gic.finance.util;
import org.apache.dubbo.config.ReferenceConfig;
import org.apache.dubbo.config.RegistryConfig;
import org.apache.dubbo.rpc.service.GenericService;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import com.alibaba.fastjson.JSONObject;
/**
* 回调方法工具
* @ClassName: AsynCallbackUtils

* @Description: 

* @author guojuxing

* @date 2019/9/12 1:52 PM

*/
public class AsynCallbackUtils {
private static final Logger LOGGER = LoggerFactory.getLogger(AsynCallbackUtils.class);
/**
* 回调
* @Title: callBack

* @Description:

 * @author guojuxing
* @param obj 需要传递的参数对象
* @param interfaceUrl 接口路径 例如com.gic.open.api.service.market.PayCallbackApiService
* @param method
 方法名称 payCallbackTransfer
* @return void


 */
public static void callBack(Object obj, String interfaceUrl, String method) {
LOGGER.info("转账审批回调:{},接口路径:{},接口方法名称:{}" ,JSONObject.toJSONString(obj), interfaceUrl, method);
RegistryConfig registry = new RegistryConfig();
registry.setAddress("zookeeper://10.105.220.75:2199");
registry.setCheck(false);
ReferenceConfig<GenericService> reference = new ReferenceConfig<>();
reference.setInterface(interfaceUrl);
reference.setRegistry(registry);
reference.setGeneric(true);
GenericService genericService = reference.get();
genericService.$invoke(method, new String[]{String.class.getName()}, new String[]{JSONObject.toJSONString(obj)});
}
}
...@@ -369,5 +369,6 @@ ...@@ -369,5 +369,6 @@
<if test="applyType != null"> <if test="applyType != null">
and apply_type = #{applyType} and apply_type = #{applyType}
</if> </if>
order by create_time desc
</select> </select>
</mapper> </mapper>
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment