package com.yifu.cloud.plus.v1.yifu.insurances.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.yifu.cloud.plus.v1.yifu.common.core.constant.CommonConstants;
import com.yifu.cloud.plus.v1.yifu.common.core.util.R;
import com.yifu.cloud.plus.v1.yifu.insurances.entity.TInsuranceEkp;
import com.yifu.cloud.plus.v1.yifu.insurances.mapper.TInsuranceEkpMapper;
import com.yifu.cloud.plus.v1.yifu.insurances.service.TInsuranceEkpService;
import com.yifu.cloud.plus.v1.yifu.insurances.util.BeanCopyUtils;
import com.yifu.cloud.plus.v1.yifu.insurances.vo.EKPInteractiveParam;
import org.apache.commons.collections.CollectionUtils;
import org.springframework.stereotype.Service;

import java.util.List;

/**
* @author Administrator
* @description 针对表【t_insurance_ekp(ekp交互失败存储表)】的数据库操作Service实现
* @createDate 2022-08-23 17:02:49
*/
@Service
public class TInsuranceEkpServiceImpl extends ServiceImpl<TInsuranceEkpMapper, TInsuranceEkp> implements TInsuranceEkpService {

	@Override
	public R resend() {
		List<TInsuranceEkp> ekpRefundList = this.baseMapper.getEkpRefundList();
		if (CollectionUtils.isNotEmpty(ekpRefundList)){
			for (TInsuranceEkp tInsuranceEkp : ekpRefundList) {
				EKPInteractiveParam ekpParam = new EKPInteractiveParam();
				BeanCopyUtils.copyProperties(tInsuranceEkp,ekpParam);
				String detailId = ekpParam.getDetailId();
				String defaultSettleId = ekpParam.getDefaultSettleId();
				//查询当前结算状态
				String status = CommonConstants.ONE_STRING;
				if(status.equals(CommonConstants.ONE_STRING)){

				}
			}
			return R.ok("发送成功");
		}else{
			return R.failed("无需要发送的信息");
		}
	}
}
