|
@@ -1,5 +1,6 @@
|
|
|
package com.poteviohealth.ym.ipos.service.impl;
|
|
package com.poteviohealth.ym.ipos.service.impl;
|
|
|
|
|
|
|
|
|
|
+import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
|
|
|
import com.google.common.collect.Lists;
|
|
import com.google.common.collect.Lists;
|
|
|
import com.poteviohealth.cgp.common.model.VaultsResponse;
|
|
import com.poteviohealth.cgp.common.model.VaultsResponse;
|
|
|
import com.poteviohealth.ym.ipos.model.back.BaseBack;
|
|
import com.poteviohealth.ym.ipos.model.back.BaseBack;
|
|
@@ -9,11 +10,14 @@ import com.poteviohealth.ym.ipos.model.split.back.PayConfirmBack;
|
|
|
import com.poteviohealth.ym.ipos.model.split.back.PayConfirmQueryBack;
|
|
import com.poteviohealth.ym.ipos.model.split.back.PayConfirmQueryBack;
|
|
|
import com.poteviohealth.ym.ipos.model.split.back.SettlementQueryBack;
|
|
import com.poteviohealth.ym.ipos.model.split.back.SettlementQueryBack;
|
|
|
import com.poteviohealth.ym.ipos.model.split.detail.*;
|
|
import com.poteviohealth.ym.ipos.model.split.detail.*;
|
|
|
|
|
+import com.poteviohealth.ym.ipos.service.ISplitRecordsDetailService;
|
|
|
|
|
+import com.poteviohealth.ym.ipos.service.ISplitRecordsService;
|
|
|
import com.poteviohealth.ym.ipos.service.ISplitService;
|
|
import com.poteviohealth.ym.ipos.service.ISplitService;
|
|
|
import com.poteviohealth.ym.ipos.utils.YmUtil;
|
|
import com.poteviohealth.ym.ipos.utils.YmUtil;
|
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
import org.springframework.beans.factory.annotation.Value;
|
|
|
import org.springframework.stereotype.Service;
|
|
import org.springframework.stereotype.Service;
|
|
|
|
|
|
|
|
|
|
+import javax.annotation.Resource;
|
|
|
import java.util.List;
|
|
import java.util.List;
|
|
|
|
|
|
|
|
/**
|
|
/**
|
|
@@ -26,6 +30,11 @@ public class SplitServiceImpl implements ISplitService {
|
|
|
@Value("${pay.field.code}")
|
|
@Value("${pay.field.code}")
|
|
|
private String code;
|
|
private String code;
|
|
|
|
|
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ private ISplitRecordsService splitRecordsService;
|
|
|
|
|
+ @Resource
|
|
|
|
|
+ private ISplitRecordsDetailService splitRecordsDetailService;
|
|
|
|
|
+
|
|
|
@Override
|
|
@Override
|
|
|
public VaultsResponse delayConfirm(SplitRecords records, List<SplitRecordsDetail> details) {
|
|
public VaultsResponse delayConfirm(SplitRecords records, List<SplitRecordsDetail> details) {
|
|
|
PayConfirm payConfirm = new PayConfirm();
|
|
PayConfirm payConfirm = new PayConfirm();
|
|
@@ -94,8 +103,47 @@ public class SplitServiceImpl implements ISplitService {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|
|
|
- public BaseBack delayConfirmRefund(PayConfirmRefund payConfirmRefund) {
|
|
|
|
|
- return null;
|
|
|
|
|
|
|
+ public VaultsResponse delayConfirmRefund(Long splitId) {
|
|
|
|
|
+ QueryWrapper queryWrapper = new QueryWrapper<>();
|
|
|
|
|
+ queryWrapper.eq("split_id",splitId);
|
|
|
|
|
+ SplitRecords splitRecords = splitRecordsService.getOne(queryWrapper);
|
|
|
|
|
+ List<SplitRecordsDetail> list = splitRecordsDetailService.list(queryWrapper);
|
|
|
|
|
+ PayConfirmRefund payConfirmRefund = new PayConfirmRefund();
|
|
|
|
|
+ payConfirmRefund.setPos_id(code);
|
|
|
|
|
+ payConfirmRefund.setStore_id(splitRecords.getOperatorId().toString());
|
|
|
|
|
+ PayConfirmDetail detail = new PayConfirmDetail();
|
|
|
|
|
+ detail.setOrg_pos_seq(splitId.toString());
|
|
|
|
|
+ ExtendParamsConfirm extendParamsConfirm = new ExtendParamsConfirm();
|
|
|
|
|
+ SplitInfoConfirm splitInfoConfirm = new SplitInfoConfirm();
|
|
|
|
|
+ List<SplitListConfirm> split_list = Lists.newArrayList();
|
|
|
|
|
+ for (SplitRecordsDetail recordsDetail : list) {
|
|
|
|
|
+ if(recordsDetail.getSourceId().equals(0)){
|
|
|
|
|
+ splitInfoConfirm.setKeep_amt(recordsDetail.getDivAmt());
|
|
|
|
|
+ }else{
|
|
|
|
|
+ SplitListConfirm listConfirm = new SplitListConfirm();
|
|
|
|
|
+ listConfirm.setMerchant_id(recordsDetail.getMerchantId());
|
|
|
|
|
+ listConfirm.setDiv_amt(recordsDetail.getDivAmt());
|
|
|
|
|
+ split_list.add(listConfirm);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ }
|
|
|
|
|
+ splitInfoConfirm.setSplit_list(split_list);
|
|
|
|
|
+ extendParamsConfirm.setSplit_info(splitInfoConfirm);
|
|
|
|
|
+ detail.setExtend_params(extendParamsConfirm);
|
|
|
|
|
+ payConfirmRefund.setDelay_confirmrefund_request(detail);
|
|
|
|
|
+ BaseBack back = null;
|
|
|
|
|
+ try {
|
|
|
|
|
+ back = (BaseBack) YmUtil.resultBack(payConfirmRefund,new BaseBack());
|
|
|
|
|
+ } catch (IllegalAccessException e) {
|
|
|
|
|
+ e.printStackTrace();
|
|
|
|
|
+ return VaultsResponse.failed(e.getMessage());
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ if(YmUtil.SUCCESS.equals(back.getResult().getId())){
|
|
|
|
|
+ return VaultsResponse.success();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ return VaultsResponse.failed(back.getResult().getComment());
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
@Override
|
|
@Override
|