|
|
@@ -28,6 +28,8 @@ import com.fs.his.mapper.FsUserMapper;
|
|
|
import com.fs.his.param.WxSendRedPacketParam;
|
|
|
import com.fs.his.service.IFsStorePaymentService;
|
|
|
import com.fs.system.service.ISysConfigService;
|
|
|
+import com.github.binarywang.wxpay.bean.transfer.QueryTransferBatchesRequest;
|
|
|
+import com.github.binarywang.wxpay.bean.transfer.QueryTransferBatchesResult;
|
|
|
import com.github.binarywang.wxpay.bean.transfer.TransferBillsGetResult;
|
|
|
import com.github.binarywang.wxpay.bean.transfer.TransferBillsResult;
|
|
|
import com.github.binarywang.wxpay.config.WxPayConfig;
|
|
|
@@ -476,6 +478,34 @@ public class FsCourseRedPacketLogServiceImpl implements IFsCourseRedPacketLogSer
|
|
|
company.getCompanyId(), moneyLog.getMoney());
|
|
|
}
|
|
|
|
|
|
+ @Override
|
|
|
+ public R transferBatchesBatchId(String batchId) {
|
|
|
+ FsCourseRedPacketLog log = fsCourseRedPacketLogMapper.selectFsCourseRedPacketLogByBatchId(batchId);
|
|
|
+ if (log ==null){
|
|
|
+ return R.error("未查询到红包记录!");
|
|
|
+ }
|
|
|
+ String json = configService.selectConfigByKey("redPacket.config");
|
|
|
+ RedPacketConfig config = JSONUtil.toBean(json, RedPacketConfig.class);
|
|
|
+ //创建微信订单
|
|
|
+ WxPayConfig payConfig = new WxPayConfig();
|
|
|
+ BeanUtils.copyProperties(config,payConfig);
|
|
|
+ WxPayService wxPayService = new WxPayServiceImpl();
|
|
|
+ wxPayService.setConfig(payConfig);
|
|
|
+ TransferService transferService=wxPayService.getTransferService();
|
|
|
+
|
|
|
+ QueryTransferBatchesRequest request = new QueryTransferBatchesRequest();
|
|
|
+ request.setBatchId(batchId);
|
|
|
+
|
|
|
+ try {
|
|
|
+ QueryTransferBatchesResult queryTransferBatchesResult = transferService.transferBatchesBatchId(request);
|
|
|
+ logger.info("FsCourseRedPacketLog-log_id:{},【红包处理】查询批次结果:{}",log.getLogId(),queryTransferBatchesResult);
|
|
|
+ return R.ok(queryTransferBatchesResult.toString());
|
|
|
+ } catch (WxPayException e) {
|
|
|
+ logger.error(e.getMessage());
|
|
|
+ return R.error(e.getMessage());
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
@Override
|
|
|
public R getBillsByTransferBillNo(String batchId) {
|
|
|
FsCourseRedPacketLog log = fsCourseRedPacketLogMapper.selectFsCourseRedPacketLogByBatchId(batchId);
|
|
|
@@ -499,5 +529,7 @@ public class FsCourseRedPacketLogServiceImpl implements IFsCourseRedPacketLogSer
|
|
|
logger.error(e.getMessage());
|
|
|
return R.error(e.getMessage());
|
|
|
}
|
|
|
+
|
|
|
+
|
|
|
}
|
|
|
}
|