| | |
| | | package cc.mrbird.febs; |
| | | |
| | | import cc.mrbird.febs.common.entity.FebsResponse; |
| | | import cc.mrbird.febs.common.enumerates.MemberLevelNewEnum; |
| | | import cc.mrbird.febs.common.enumerates.ProductEnum; |
| | | import cc.mrbird.febs.common.utils.MallUtils; |
| | | import cc.mrbird.febs.mall.entity.MallMember; |
| | | import cc.mrbird.febs.mall.entity.MallOrderItem; |
| | | import cc.mrbird.febs.mall.mapper.MallMemberMapper; |
| | | import cc.mrbird.febs.mall.mapper.MallOrderInfoMapper; |
| | | import cc.mrbird.febs.mall.mapper.MallOrderItemMapper; |
| | | import cc.mrbird.febs.mall.dto.TeamPerkDto; |
| | | import cc.mrbird.febs.mall.entity.*; |
| | | import cc.mrbird.febs.mall.mapper.*; |
| | | import cc.mrbird.febs.mall.quartz.OrderSettlementJob; |
| | | import cc.mrbird.febs.mall.service.IAgentService; |
| | | import cc.mrbird.febs.mall.service.IApiMallOrderInfoService; |
| | | import cc.mrbird.febs.mall.service.IMallAchieveService; |
| | | import cc.mrbird.febs.mall.service.IMemberProfitService; |
| | | import cc.mrbird.febs.mall.service.*; |
| | | import cc.mrbird.febs.pay.model.*; |
| | | import cc.mrbird.febs.pay.service.LaKaLaService; |
| | | import cc.mrbird.febs.pay.service.NBYHService; |
| | | import cc.mrbird.febs.pay.service.UnipayService; |
| | | import cc.mrbird.febs.rabbit.consumer.AgentConsumer; |
| | | import cc.mrbird.febs.rabbit.producter.AgentProducer; |
| | | import cn.hutool.core.collection.CollUtil; |
| | | import cn.hutool.core.date.DateUtil; |
| | | import cn.hutool.core.util.ObjectUtil; |
| | | import cn.hutool.core.util.StrUtil; |
| | | import com.alibaba.fastjson.JSON; |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper; |
| | | import org.junit.jupiter.api.Test; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.boot.test.context.SpringBootTest; |
| | | import org.springframework.core.io.ClassPathResource; |
| | | import org.springframework.core.io.ResourceLoader; |
| | | |
| | | import java.io.IOException; |
| | | import java.math.BigDecimal; |
| | | import java.text.DecimalFormat; |
| | | import java.util.*; |
| | |
| | | public class ProfitTest { |
| | | |
| | | @Autowired |
| | | private AgentConsumer agentConsumer; |
| | | |
| | | @Autowired |
| | | private IAgentService agentService; |
| | | |
| | | @Autowired |
| | | private IMemberProfitService memberProfitService; |
| | | |
| | | @Autowired |
| | | private IApiMallOrderInfoService iApiMallOrderInfoService; |
| | | |
| | | @Autowired |
| | | private MallMemberMapper memberMapper; |
| | | @Autowired |
| | | private DataDictionaryCustomMapper dataDictionaryCustomMapper; |
| | | @Autowired |
| | | private MallProductBuyMapper mallProductBuyMapper; |
| | | // @Test |
| | | // public void dynamicProfit(){ |
| | | // |
| | | // QueryWrapper<MallProductBuy> query = new QueryWrapper<>(); |
| | | // query.eq("state", ProductEnum.PRODUCT_BUY_SUCCESS.getValue()); |
| | | // query.eq("mate_state",ProductEnum.PRODUCT_BUY_MATE_STATE_FAIL.getValue()); |
| | | // List<MallProductBuy> mallProductBuys = mallProductBuyMapper.selectList(query); |
| | | // if(CollUtil.isEmpty(mallProductBuys)){ |
| | | // return; |
| | | // } |
| | | // |
| | | // Set<Long> collect = mallProductBuys.stream().map(MallProductBuy::getMemberId).collect(Collectors.toSet()); |
| | | // if(CollUtil.isEmpty(collect)){ |
| | | // return; |
| | | // } |
| | | // for(Long memberId : collect){ |
| | | // MallMember mallMember = memberMapper.selectById(memberId); |
| | | // if(ObjectUtil.isEmpty(mallMember)){ |
| | | // continue; |
| | | // } |
| | | // //上级 |
| | | // String referrerId = mallMember.getReferrerId(); |
| | | // MallMember mallMemberRef = memberMapper.selectInfoByInviteId(referrerId); |
| | | // if(ObjectUtil.isEmpty(mallMemberRef)){ |
| | | // continue; |
| | | // } |
| | | // List<MallMember> mallMembersAll = memberMapper.selectAllChildAgentListByInviteId(referrerId); |
| | | // |
| | | // List<MallMember> mallMembers = memberMapper.selectByRefererId(referrerId); |
| | | // Set<Long> mallMembersSet = mallMembers.stream().map(MallMember::getId).collect(Collectors.toSet()); |
| | | // mallMembersSet.retainAll(collect); |
| | | // List<Long> intersection = new ArrayList<>(mallMembersSet);//上级直推有效人数 |
| | | // if(CollUtil.isEmpty(intersection)){ |
| | | // mallMemberRef.setLevel(MemberLevelNewEnum.ZERO_LEVEL.getType()); |
| | | // memberMapper.updateById(mallMemberRef); |
| | | // continue; |
| | | // } |
| | | // /** |
| | | // * 从会员等级最低到最高,比较intersection与会员设置的直推人数directCntLevel比较 |
| | | // * directCntLevel >= intersection.size(),则满足升级会员等级条件,跳出循环 |
| | | // * teamCnt >= mallMembersAll.size(),则满足升级会员等级条件,跳出循环 |
| | | // * 达到最高级别后,升级会员等级,跳出循环 |
| | | // */ |
| | | // String level = MemberLevelNewEnum.ZERO_LEVEL.getType(); |
| | | // boolean flag = false; |
| | | // while (!flag){ |
| | | // DataDictionaryCustom levelDic = dataDictionaryCustomMapper.selectDicDataByTypeAndCode( |
| | | // level, level |
| | | // ); |
| | | // TeamPerkDto teamPerkDto = JSONObject.parseObject(levelDic.getValue(), TeamPerkDto.class); |
| | | // Integer directCntLevel = teamPerkDto.getDirectCnt(); |
| | | // Integer teamCnt = teamPerkDto.getTeamCnt(); |
| | | // if(directCntLevel <= intersection.size()){ |
| | | // if(teamCnt <= mallMembersAll.size()){ |
| | | // mallMemberRef.setLevel(level); |
| | | // memberMapper.updateById(mallMemberRef); |
| | | // |
| | | // String nextLevel = MemberLevelNewEnum.ZERO_LEVEL.getNextLevel(level); |
| | | // level = nextLevel; |
| | | // if(level.equals(MemberLevelNewEnum.WU_LEVEL.getType()) && |
| | | // nextLevel.equals(MemberLevelNewEnum.WU_LEVEL.getType()) ){ |
| | | // mallMemberRef.setLevel(level); |
| | | // memberMapper.updateById(mallMemberRef); |
| | | // flag = true; |
| | | // } |
| | | // }else{ |
| | | // flag = true; |
| | | // } |
| | | // }else{ |
| | | // flag = true; |
| | | // } |
| | | // } |
| | | // } |
| | | // } |
| | | // @Autowired |
| | | // private AgentConsumer agentConsumer; |
| | | // |
| | | // @Autowired |
| | | // private IAgentService agentService; |
| | | // |
| | | // @Autowired |
| | | // private IMemberProfitService memberProfitService; |
| | | // |
| | | // @Autowired |
| | | // private IApiMallOrderInfoService iApiMallOrderInfoService; |
| | | // |
| | | // @Autowired |
| | | // private MallMemberMapper memberMapper; |
| | | // |
| | | // @Autowired |
| | | // private AgentProducer agentProducer; |
| | | // |
| | | // @Test |
| | | // public void dynamicProfit() { |
| | | // agentService.perkMoneyConsumer(Long.parseLong("796")); |
| | | //// memberProfitService.dynamicProfit(Long.parseLong("709")); |
| | | //// memberProfitService.scoreRecordReleaseJob(); |
| | | //// memberProfitService.achieveReleaseJob(); |
| | | //// agentProducer.sendPerkMoneyMsg(679L); |
| | | //// agentService.perkMoneyConsumer(665L); |
| | | //// memberProfitService.teamEqualsPerkJob(null); |
| | | //// List<MallMember> mallMemberTeamPerk = new ArrayList<>(); |
| | | //// MallMember mallMember = memberMapper.selectById(233L); |
| | | //// List<String> ids = StrUtil.split(mallMember.getReferrerIds(), ','); |
| | | //// List<MallMember> mallMembers = memberMapper.selectByInviteIds(ids); |
| | | //// Map<String, List<MallMember>> collect = mallMembers.stream().collect(Collectors.groupingBy(MallMember::getLevel)); |
| | | //// Set<String> set = collect.keySet(); // 得到所有key的集合 |
| | | //// for (String key : set) { |
| | | //// List<MallMember> value = collect.get(key); |
| | | //// System.out.println(key + " " + value); |
| | | //// mallMemberTeamPerk.add(value.get(0)); |
| | | //// |
| | | //// System.out.println(value.get(0).getName()); |
| | | //// |
| | | //// } |
| | | //// List<Long> mallMemberStarIds = mallMemberTeamPerk.stream().map(MallMember::getId).collect(Collectors.toList()); |
| | | //// |
| | | //// System.out.println(mallMemberStarIds); |
| | | // } |
| | | |
| | | |
| | | @Autowired |
| | | private AgentProducer agentProducer; |
| | | private LaKaLaService laKaLaService; |
| | | @Autowired |
| | | ResourceLoader resourceLoader; |
| | | @Autowired |
| | | private NBYHService nbyhService; |
| | | @Autowired |
| | | private IAdminMallMemberService mallMemberService; |
| | | @Autowired |
| | | private MallProductNftMapper mallProductNftMapper; |
| | | |
| | | @Test |
| | | public void dynamicProfit() { |
| | | agentService.perkMoneyConsumer(Long.parseLong("712")); |
| | | // memberProfitService.dynamicProfit(Long.parseLong("709")); |
| | | // memberProfitService.scoreRecordReleaseJob(); |
| | | // memberProfitService.achieveReleaseJob(); |
| | | // agentProducer.sendPerkMoneyMsg(679L); |
| | | // agentService.perkMoneyConsumer(665L); |
| | | // memberProfitService.teamEqualsPerkJob(null); |
| | | // List<MallMember> mallMemberTeamPerk = new ArrayList<>(); |
| | | // MallMember mallMember = memberMapper.selectById(233L); |
| | | // List<String> ids = StrUtil.split(mallMember.getReferrerIds(), ','); |
| | | // List<MallMember> mallMembers = memberMapper.selectByInviteIds(ids); |
| | | // Map<String, List<MallMember>> collect = mallMembers.stream().collect(Collectors.groupingBy(MallMember::getLevel)); |
| | | // Set<String> set = collect.keySet(); // 得到所有key的集合 |
| | | // for (String key : set) { |
| | | // List<MallMember> value = collect.get(key); |
| | | // System.out.println(key + " " + value); |
| | | // mallMemberTeamPerk.add(value.get(0)); |
| | | // |
| | | // System.out.println(value.get(0).getName()); |
| | | // |
| | | // } |
| | | // List<Long> mallMemberStarIds = mallMemberTeamPerk.stream().map(MallMember::getId).collect(Collectors.toList()); |
| | | // |
| | | // System.out.println(mallMemberStarIds); |
| | | public void agentProfitTrade() { |
| | | MallProductNft mallProductNft = mallProductNftMapper.selectById(4L); |
| | | BigDecimal profitPercent = mallProductNft.getProfit(); |
| | | System.out.println(profitPercent); |
| | | MallProductBuy mallProductBuy = mallProductBuyMapper.selectById(184L); |
| | | BigDecimal nftTotal = mallProductBuy.getNftTotal(); |
| | | System.out.println(nftTotal); |
| | | BigDecimal totalPerk = mallProductBuy.getTotalPerk(); |
| | | System.out.println(totalPerk); |
| | | BigDecimal profit = nftTotal.multiply(profitPercent.multiply(new BigDecimal(0.01))).setScale(2,BigDecimal.ROUND_DOWN); |
| | | System.out.println(profit); |
| | | BigDecimal bigDecimal = totalPerk.subtract(profit).setScale(2, BigDecimal.ROUND_DOWN); |
| | | System.out.println(bigDecimal); |
| | | } |
| | | @Test |
| | | public void agentProfit() { |
| | | iApiMallOrderInfoService.changeWallet(665L); |
| | | // try { |
| | | // System.out.println(resourceLoader.getResource("classpath:lkl/api_private_key.pem").getInputStream()); |
| | | // } catch (IOException e) { |
| | | // e.printStackTrace(); |
| | | // } |
| | | // LaKaLaCreateOrderReqDate laKaLaCreateOrderReqDate = new LaKaLaCreateOrderReqDate(); |
| | | // //订单编号 |
| | | // laKaLaCreateOrderReqDate.setOut_order_no("2023041918302032901"); |
| | | // //订单金额,分计 |
| | | // laKaLaCreateOrderReqDate.setTotal_amount(new BigDecimal(1).longValue()); |
| | | // laKaLaCreateOrderReqDate.setOrder_info("礼品一"); |
| | | // laKaLaService.verifyCreateOrder(laKaLaCreateOrderReqDate); |
| | | } |
| | | |
| | | |
| | | // |
| | | // |
| | | //// @Test |
| | | //// public void staticProfit() { |
| | | //// memberProfitService.staticProfit(new Date()); |
| | | //// } |
| | | // |
| | | // @Test |
| | | // public void staticProfit() { |
| | | // memberProfitService.staticProfit(new Date()); |
| | | // public void thankfulProfit() { |
| | | // memberProfitService.mqPerkRetryJob(); |
| | | // } |
| | | |
| | | @Test |
| | | public void thankfulProfit() { |
| | | memberProfitService.mqPerkRetryJob(); |
| | | } |
| | | |
| | | @Test |
| | | public void rankProfit() { |
| | | memberProfitService.rankProfit(); |
| | | } |
| | | |
| | | @Autowired |
| | | private MallOrderInfoMapper mallOrderInfoMapper; |
| | | |
| | | @Test |
| | | public void directorProfitTest() { |
| | | memberProfitService.storeAndDirectorProfit(new Date()); |
| | | } |
| | | |
| | | @Autowired |
| | | private MallOrderItemMapper mallOrderItemMapper; |
| | | |
| | | @Autowired |
| | | private IMallAchieveService mallAchieveService; |
| | | |
| | | @Test |
| | | public void achieveTest() { |
| | | List<MallOrderItem> items = mallOrderItemMapper.selectList(null); |
| | | for (MallOrderItem item : items) { |
| | | mallAchieveService.add(item.getId()); |
| | | } |
| | | } |
| | | |
| | | @Test |
| | | public void paramTest() { |
| | | Map<String, Integer> map = new HashMap<>(); |
| | | BigDecimal amount = new BigDecimal("100"); |
| | | map.put("amount", 1); |
| | | changeAmount(map); |
| | | System.out.println(map.get("amount")); |
| | | } |
| | | |
| | | public void changeAmount(Map<String, Integer> amount) { |
| | | amount.put("amount", 2); |
| | | } |
| | | |
| | | @Test |
| | | public void scorePool(){ |
| | | memberProfitService.scorePool(); |
| | | } |
| | | |
| | | @Test |
| | | public void staticProfit(){ |
| | | memberProfitService.staticProfit(null); |
| | | } |
| | | |
| | | @Autowired |
| | | private OrderSettlementJob orderSettlementJob; |
| | | |
| | | @Test |
| | | public void orderSettlementJobTest() { |
| | | // orderSettlementJob.normalGoodsSettlementJob(); |
| | | |
| | | mallAchieveService.add(83L); |
| | | } |
| | | |
| | | |
| | | @Autowired |
| | | private UnipayService unipayService; |
| | | @Test |
| | | public void unipay(){ |
| | | UnipayDto unipayDto = new UnipayDto(); |
| | | unipayDto.setAmount(new BigDecimal("0.01")); |
| | | unipayDto.setFrpCode("ALIPAY_H5"); |
| | | unipayDto.setTradeMerchantNo("777180800385820"); |
| | | // unipayDto.setFrpCode("WEIXIN_APP3"); |
| | | unipayDto.setOrderNo("2022082316415386395"); |
| | | unipayDto.setProductName("洗护套装"); |
| | | unipayService.unipay(unipayDto); |
| | | } |
| | | @Test |
| | | public void getAgreeMentPaySms(){ |
| | | AgreeMentPaySmsDto agreeMentPaySmsDto = new AgreeMentPaySmsDto(); |
| | | agreeMentPaySmsDto.setOrderNo("2022082617305930328"); |
| | | |
| | | BigDecimal value = new BigDecimal("0.1").setScale(2, BigDecimal.ROUND_DOWN); |
| | | DecimalFormat decimalFormat = new DecimalFormat("0.00#"); |
| | | String strVal = decimalFormat.format(value); |
| | | agreeMentPaySmsDto.setOrderAmount(new BigDecimal(strVal)); |
| | | agreeMentPaySmsDto.setName("肖永"); |
| | | agreeMentPaySmsDto.setCreatedTime(DateUtil.now()); |
| | | agreeMentPaySmsDto.setIdType("1"); |
| | | agreeMentPaySmsDto.setIdCardNum("430321199310113713"); |
| | | agreeMentPaySmsDto.setBankNo("6222031901002389639"); |
| | | agreeMentPaySmsDto.setPhone("15274802129"); |
| | | String agreeMentPaySms = unipayService.getAgreeMentPaySms(agreeMentPaySmsDto); |
| | | if("JS000000".equals(agreeMentPaySms)){ |
| | | System.out.println("获取成功"); |
| | | }else{ |
| | | System.out.println(agreeMentPaySms); |
| | | } |
| | | } |
| | | |
| | | @Test |
| | | public void agreementSign(){ |
| | | AgreementSignDto agreementSignDto = new AgreementSignDto(); |
| | | agreementSignDto.setOrderNo("2022082614465345250"); |
| | | agreementSignDto.setSmsCode("841243"); |
| | | unipayService.agreementSign(agreementSignDto); |
| | | } |
| | | |
| | | @Test |
| | | public void agreementPay(){ |
| | | AgreementPayDto agreementPayDto = new AgreementPayDto(); |
| | | agreementPayDto.setOrderNo("2022082614465345250"); |
| | | |
| | | BigDecimal value = new BigDecimal("0.1").setScale(2, BigDecimal.ROUND_DOWN); |
| | | DecimalFormat decimalFormat = new DecimalFormat("0.00#"); |
| | | String strVal = decimalFormat.format(value); |
| | | agreementPayDto.setOrderAmount(new BigDecimal(strVal)); |
| | | agreementPayDto.setOrderTime(DateUtil.now()); |
| | | agreementPayDto.setOrderDesc("测试"); |
| | | agreementPayDto.setBankNo("6222031901002389639"); |
| | | unipayService.agreementPay(agreementPayDto); |
| | | } |
| | | |
| | | @Test |
| | | public void singlePay(){ |
| | | /** |
| | | * 调用汇聚代付 |
| | | */ |
| | | String orderNo = MallUtils.getOrderNum("W"); |
| | | SinglePayDto singlePayDto = new SinglePayDto(); |
| | | singlePayDto.setMerchantOrderNo(orderNo); |
| | | singlePayDto.setReceiverAccountNoEncBankNo("6222031903210023839639"); |
| | | singlePayDto.setReceiverAccountNoEncName("肖永"); |
| | | singlePayDto.setReceiverAccountType("201"); |
| | | BigDecimal paidAmount = new BigDecimal(1.00); |
| | | singlePayDto.setPaidAmount(paidAmount); |
| | | singlePayDto.setCurrency("201"); |
| | | singlePayDto.setIsChecked("202"); |
| | | singlePayDto.setPaidDesc("用户提现"); |
| | | singlePayDto.setPaidUse("202"); |
| | | String singlePayRep = unipayService.singlePay(singlePayDto); |
| | | |
| | | System.out.println(singlePayRep); |
| | | } |
| | | // |
| | | // @Test |
| | | // public void rankProfit() { |
| | | // memberProfitService.rankProfit(); |
| | | // } |
| | | // |
| | | // @Autowired |
| | | // private MallOrderInfoMapper mallOrderInfoMapper; |
| | | // |
| | | // @Test |
| | | // public void directorProfitTest() { |
| | | // memberProfitService.storeAndDirectorProfit(new Date()); |
| | | // } |
| | | // |
| | | // @Autowired |
| | | // private MallOrderItemMapper mallOrderItemMapper; |
| | | // |
| | | // @Autowired |
| | | // private IMallAchieveService mallAchieveService; |
| | | // |
| | | // @Test |
| | | // public void achieveTest() { |
| | | // List<MallOrderItem> items = mallOrderItemMapper.selectList(null); |
| | | // for (MallOrderItem item : items) { |
| | | // mallAchieveService.add(item.getId()); |
| | | // } |
| | | // } |
| | | // |
| | | // @Test |
| | | // public void paramTest() { |
| | | // Map<String, Integer> map = new HashMap<>(); |
| | | // BigDecimal amount = new BigDecimal("100"); |
| | | // map.put("amount", 1); |
| | | // changeAmount(map); |
| | | // System.out.println(map.get("amount")); |
| | | // } |
| | | // |
| | | // public void changeAmount(Map<String, Integer> amount) { |
| | | // amount.put("amount", 2); |
| | | // } |
| | | // |
| | | // @Test |
| | | // public void scorePool(){ |
| | | // memberProfitService.scorePool(); |
| | | // } |
| | | // |
| | | // @Test |
| | | // public void staticProfit(){ |
| | | // memberProfitService.staticProfit(null); |
| | | // } |
| | | // |
| | | // @Autowired |
| | | // private OrderSettlementJob orderSettlementJob; |
| | | // |
| | | // @Test |
| | | // public void orderSettlementJobTest() { |
| | | //// orderSettlementJob.normalGoodsSettlementJob(); |
| | | // |
| | | // mallAchieveService.add(83L); |
| | | // } |
| | | // |
| | | // |
| | | // @Autowired |
| | | // private UnipayService unipayService; |
| | | // @Test |
| | | // public void unipay(){ |
| | | // UnipayDto unipayDto = new UnipayDto(); |
| | | // unipayDto.setAmount(new BigDecimal("0.01")); |
| | | // unipayDto.setFrpCode("ALIPAY_H5"); |
| | | // unipayDto.setTradeMerchantNo("777180800385820"); |
| | | //// unipayDto.setFrpCode("WEIXIN_APP3"); |
| | | // unipayDto.setOrderNo("2022082316415386395"); |
| | | // unipayDto.setProductName("洗护套装"); |
| | | // unipayService.unipay(unipayDto); |
| | | // } |
| | | // @Test |
| | | // public void getAgreeMentPaySms(){ |
| | | // AgreeMentPaySmsDto agreeMentPaySmsDto = new AgreeMentPaySmsDto(); |
| | | // agreeMentPaySmsDto.setOrderNo("2022082617305930328"); |
| | | // |
| | | // BigDecimal value = new BigDecimal("0.1").setScale(2, BigDecimal.ROUND_DOWN); |
| | | // DecimalFormat decimalFormat = new DecimalFormat("0.00#"); |
| | | // String strVal = decimalFormat.format(value); |
| | | // agreeMentPaySmsDto.setOrderAmount(new BigDecimal(strVal)); |
| | | // agreeMentPaySmsDto.setName("肖永"); |
| | | // agreeMentPaySmsDto.setCreatedTime(DateUtil.now()); |
| | | // agreeMentPaySmsDto.setIdType("1"); |
| | | // agreeMentPaySmsDto.setIdCardNum("430321199310113713"); |
| | | // agreeMentPaySmsDto.setBankNo("6222031901002389639"); |
| | | // agreeMentPaySmsDto.setPhone("15274802129"); |
| | | // String agreeMentPaySms = unipayService.getAgreeMentPaySms(agreeMentPaySmsDto); |
| | | // if("JS000000".equals(agreeMentPaySms)){ |
| | | // System.out.println("获取成功"); |
| | | // }else{ |
| | | // System.out.println(agreeMentPaySms); |
| | | // } |
| | | // } |
| | | // |
| | | // @Test |
| | | // public void agreementSign(){ |
| | | // AgreementSignDto agreementSignDto = new AgreementSignDto(); |
| | | // agreementSignDto.setOrderNo("2022082614465345250"); |
| | | // agreementSignDto.setSmsCode("841243"); |
| | | // unipayService.agreementSign(agreementSignDto); |
| | | // } |
| | | // |
| | | // @Test |
| | | // public void agreementPay(){ |
| | | // AgreementPayDto agreementPayDto = new AgreementPayDto(); |
| | | // agreementPayDto.setOrderNo("2022082614465345250"); |
| | | // |
| | | // BigDecimal value = new BigDecimal("0.1").setScale(2, BigDecimal.ROUND_DOWN); |
| | | // DecimalFormat decimalFormat = new DecimalFormat("0.00#"); |
| | | // String strVal = decimalFormat.format(value); |
| | | // agreementPayDto.setOrderAmount(new BigDecimal(strVal)); |
| | | // agreementPayDto.setOrderTime(DateUtil.now()); |
| | | // agreementPayDto.setOrderDesc("测试"); |
| | | // agreementPayDto.setBankNo("6222031901002389639"); |
| | | // unipayService.agreementPay(agreementPayDto); |
| | | // } |
| | | // |
| | | // @Test |
| | | // public void singlePay(){ |
| | | // /** |
| | | // * 调用汇聚代付 |
| | | // */ |
| | | // String orderNo = MallUtils.getOrderNum("W"); |
| | | // SinglePayDto singlePayDto = new SinglePayDto(); |
| | | // singlePayDto.setMerchantOrderNo(orderNo); |
| | | // singlePayDto.setReceiverAccountNoEncBankNo("6222031903210023839639"); |
| | | // singlePayDto.setReceiverAccountNoEncName("肖永"); |
| | | // singlePayDto.setReceiverAccountType("201"); |
| | | // BigDecimal paidAmount = new BigDecimal(1.00); |
| | | // singlePayDto.setPaidAmount(paidAmount); |
| | | // singlePayDto.setCurrency("201"); |
| | | // singlePayDto.setIsChecked("202"); |
| | | // singlePayDto.setPaidDesc("用户提现"); |
| | | // singlePayDto.setPaidUse("202"); |
| | | // String singlePayRep = unipayService.singlePay(singlePayDto); |
| | | // |
| | | // System.out.println(singlePayRep); |
| | | // } |
| | | } |