ManagementJYXTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/huifu/biz/FenZhangUtil.java
New file @@ -0,0 +1,119 @@ package com.stylefeng.guns.modular.huifu.biz; import java.util.*; import com.huifu.bspay.sdk.opps.core.config.MerConfig; import com.huifu.bspay.sdk.opps.core.net.BasePayRequest; import com.huifu.bspay.sdk.opps.core.BasePay; import com.stylefeng.guns.modular.huifu.properties.HuiFuProperties; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Component; /** * 余额支付 - 示例 */ public class FenZhangUtil { @Autowired private static HuiFuProperties huiFuProperties; // public static void main(String[] args) throws Exception { // // 1. 数据初始化,填入对应的商户配置 // MerConfig merConfig = new MerConfig(); //// merConfig.setProcutId(huiFuProperties.getProductId()); //// merConfig.setSysId(huiFuProperties.getSysId()); //// merConfig.setRsaPrivateKey(huiFuProperties.getRsaPrivateKey()); //// merConfig.setRsaPublicKey(huiFuProperties.getRsaPublicKey()); // merConfig.setProcutId("KAZX"); // merConfig.setSysId("6666000182995771"); // merConfig.setRsaPrivateKey("MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCR6W3ynQJL7f2C8vFYMcQkcirpkif9ZhLq1374jIlV87nv0T9uIm6DoW8LyNEl9w2Yc5qoBv70tt/oVpemA6IZY6NXzE2USNi/sv2qUTtapcIRYxe4acCfY8K+x+p7W2e6wUWIpl9qgZA+UnFmHQ0HT6Ywzq2jJL92JdIs147Ud1aVi3aX8LYItj0z3ZKwZQkaJawZSWQk2+EdPfN059L2qFkPtnT7JIthAdUTJYZA13K4tzw6mXp/DbgwVmLhrlmwl/ccSv2Q0ABfEk7jIxF1nZmCmSy3HrEw9xWyrg1BC+DgXBdyF0OEtpNfv+UW080syUVBNN0irHVuDP81BaAjAgMBAAECggEAGlBZprZQErdxz6rWgYxADj6UpJjaI2XEJZwFZveZUOnqb2hyIv+MpKp5Z0upBErApey7SHAyjJlqWfE72hGvqxp/+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ZbKZBQhqt+vlQy0FUgONFii1ACZO0A8Sc/bvn4="); // merConfig.setRsaPublicKey("MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsWrruP9JBxrUd8uEX5Z8y7pg/UIr5RNHSgDnHqNI1hbi2MfTzB5vZ275wSFFaLDD9BesgDWqsUepPS/opROlDCg9y6WYH8mkN23NmHL9F8kT48OMmH722am+Hp0XVMMwXqA0oNt4f7oW6kDemjZW8/RT4vIE7cyxoxSsVRvjqSpx9wDgFLPWh3o0pHQaoxLyeUsGBATHFrxEDlosBvsuXjMcgjPKXALrcemzKOhBmBkLgyxNVmh61ZK+FNXd+/X4PeZlnWf54NRQAUKe1308E6IIaszo+CjneKuhj1m/X4f7AIvxAqlhuCV5E/DfKRmGopxaWqdtE960Y/H4SmBh2wIDAQAB"); // BasePay.initWithMerConfig(merConfig); // // // 2.组装请求参数 // Map<String, Object> paramsInfo = new HashMap<>(); // // 请求流水号 // paramsInfo.put("req_seq_id", "rQ20251119164316677154"); // // 请求日期 // paramsInfo.put("req_date", "20251119"); // // 出款方商户号 // paramsInfo.put("out_huifu_id", "6666000182995771"); // // 支付金额 // paramsInfo.put("ord_amt", "0.01"); // // 分账对象 // paramsInfo.put("acct_split_bunch", "{\"acct_infos\":[{\"div_amt\":\"0.01\",\"huifu_id\":\"6666000183361451\"}]}"); // // 安全信息 // paramsInfo.put("risk_check_data", "{\"sub_product\":\"1\",\"transfer_type\":\"05\"}"); // // 手续费承担方标识余额支付手续费承担方标识;商户余额支付扣收规则为接口指定承担方时必填!枚举值:<br/>OUT:出款方;<br/>IN:分账接受方。<br/><font color="green">示例值:IN</font> // paramsInfo.put("trans_fee_take_flag", "OUT"); // // 核验值verify_type不为空时必填。当verify_type=SMS时,填写用户收到的短信验证码 //// paramsInfo.put("verify_value", "test"); // // 3. 发起API调用 // Map<String, Object> response = BasePayRequest.requestBasePay("v2/trade/acctpayment/pay", paramsInfo, null, false);; // System.out.println(response); // } public static Map<String, Object> fenzhang(String req_seq_id,String req_date,String ord_amt,String huifu_id) throws Exception { // 1. 数据初始化,填入对应的商户配置 MerConfig merConfig = new MerConfig(); // merConfig.setProcutId(huiFuProperties.getProductId()); // merConfig.setSysId(huiFuProperties.getSysId()); // merConfig.setRsaPrivateKey(huiFuProperties.getRsaPrivateKey()); // merConfig.setRsaPublicKey(huiFuProperties.getRsaPublicKey()); merConfig.setProcutId("KAZX"); merConfig.setSysId("6666000182995771"); merConfig.setRsaPrivateKey("MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCR6W3ynQJL7f2C8vFYMcQkcirpkif9ZhLq1374jIlV87nv0T9uIm6DoW8LyNEl9w2Yc5qoBv70tt/oVpemA6IZY6NXzE2USNi/sv2qUTtapcIRYxe4acCfY8K+x+p7W2e6wUWIpl9qgZA+UnFmHQ0HT6Ywzq2jJL92JdIs147Ud1aVi3aX8LYItj0z3ZKwZQkaJawZSWQk2+EdPfN059L2qFkPtnT7JIthAdUTJYZA13K4tzw6mXp/DbgwVmLhrlmwl/ccSv2Q0ABfEk7jIxF1nZmCmSy3HrEw9xWyrg1BC+DgXBdyF0OEtpNfv+UW080syUVBNN0irHVuDP81BaAjAgMBAAECggEAGlBZprZQErdxz6rWgYxADj6UpJjaI2XEJZwFZveZUOnqb2hyIv+MpKp5Z0upBErApey7SHAyjJlqWfE72hGvqxp/+7Z5izNz+2ZhPtT1ekyIajBPt89CkLwiA9vz2plKZLC0RIeUj5WcGNEvaDX3AomHtCehwtk+uiTp+XJKbOBtkkQszcdCGY1DVoQ0ppFoINnM9VLbEzaFaG7VS3eFkU4cf2CwcrnJB1RncyPFK+bGFvjkLM/eQbsh8YxkBqaGz/8UM1Na1SEidqdyUF71ltqnI0u8pLe0V+5jugVW+3lPL/p1C3i7mAbQOs4yqRWlFaGVTzOawoQUOPVwDpzeeQKBgQDs1P7F4wURqX1qZR0hSTqOigg48ychaOF66new3SuWk2CVBy8Q8b7odGSPyxJSGZvFLozn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cemzKOhBmBkLgyxNVmh61ZK+FNXd+/X4PeZlnWf54NRQAUKe1308E6IIaszo+CjneKuhj1m/X4f7AIvxAqlhuCV5E/DfKRmGopxaWqdtE960Y/H4SmBh2wIDAQAB"); BasePay.initWithMerConfig(merConfig); // 2.组装请求参数 Map<String, Object> paramsInfo = new HashMap<>(); // 请求流水号 paramsInfo.put("req_seq_id",req_seq_id); // 请求日期 paramsInfo.put("req_date", req_date); // 出款方商户号 paramsInfo.put("out_huifu_id", "6666000182995771"); // 支付金额 paramsInfo.put("ord_amt", ord_amt); // 分账对象 paramsInfo.put("acct_split_bunch", "{\"acct_infos\":[{\"div_amt\":\""+ord_amt+"\",\"huifu_id\":\""+huifu_id+"\"}]}"); // 安全信息 paramsInfo.put("risk_check_data", "{\"sub_product\":\"1\",\"transfer_type\":\"05\"}"); // 手续费承担方标识余额支付手续费承担方标识;商户余额支付扣收规则为接口指定承担方时必填!枚举值:<br/>OUT:出款方;<br/>IN:分账接受方。<br/><font color="green">示例值:IN</font> paramsInfo.put("trans_fee_take_flag", "OUT"); // 核验值verify_type不为空时必填。当verify_type=SMS时,填写用户收到的短信验证码 // paramsInfo.put("verify_value", "test"); // 3. 发起API调用 Map<String, Object> response = BasePayRequest.requestBasePay("v2/trade/acctpayment/pay", paramsInfo, null, false);; return response; } public static Map<String, Object> queryFenzhang(String req_seq_id,String req_date) throws Exception { // 1. 数据初始化,填入对应的商户配置 MerConfig merConfig = new MerConfig(); merConfig.setProcutId("KAZX"); merConfig.setSysId("6666000182995771"); merConfig.setRsaPrivateKey("MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCR6W3ynQJL7f2C8vFYMcQkcirpkif9ZhLq1374jIlV87nv0T9uIm6DoW8LyNEl9w2Yc5qoBv70tt/oVpemA6IZY6NXzE2USNi/sv2qUTtapcIRYxe4acCfY8K+x+p7W2e6wUWIpl9qgZA+UnFmHQ0HT6Ywzq2jJL92JdIs147Ud1aVi3aX8LYItj0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3EyNhbiC/4moyqArehy0Qp1tSvIo7UGotLkzx/69CKBoW+IcNWDyJyXG1trqO7cKoCdqTViM98lIRwyzu9rMydONeN8o0HCT5id4nYDhAsXl1vc+2XY6F1pUCgYEA0dxGHBTKD/WzIvTYGYD6Xx224Y84mO6x2Mu16zFoq/NjuIdKi2O+92yrKDCMMCqaY77fXvWD3eI7QYYlbKAOqdLKVipTbhnBccDyNbtYHVg59t4xS+K6HyD+quVkL9n40UkxSZbKZBQhqt+vlQy0FUgONFii1ACZO0A8Sc/bvn4="); merConfig.setRsaPublicKey("MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAsWrruP9JBxrUd8uEX5Z8y7pg/UIr5RNHSgDnHqNI1hbi2MfTzB5vZ275wSFFaLDD9BesgDWqsUepPS/opROlDCg9y6WYH8mkN23NmHL9F8kT48OMmH722am+Hp0XVMMwXqA0oNt4f7oW6kDemjZW8/RT4vIE7cyxoxSsVRvjqSpx9wDgFLPWh3o0pHQaoxLyeUsGBATHFrxEDlosBvsuXjMcgjPKXALrcemzKOhBmBkLgyxNVmh61ZK+FNXd+/X4PeZlnWf54NRQAUKe1308E6IIaszo+CjneKuhj1m/X4f7AIvxAqlhuCV5E/DfKRmGopxaWqdtE960Y/H4SmBh2wIDAQAB"); BasePay.initWithMerConfig(merConfig); // 2.组装请求参数 Map<String, Object> paramsInfo = new HashMap<>(); // 商户号 paramsInfo.put("huifu_id", "6666000182995771"); // 原交易请求日期 paramsInfo.put("org_req_date", req_date); // 原交易请求流水号 paramsInfo.put("org_req_seq_id", req_seq_id); // 3. 发起API调用 Map<String, Object> response = BasePayRequest.requestBasePay("v2/trade/acctpayment/pay/query", paramsInfo, null, false);; System.out.println(response); return response; } } ManagementJYXTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/dao/mapping/TCompanyMapper.xml
@@ -67,7 +67,7 @@ licenseStartTime, licenseEndTime, licenseNumber, carNum, driverNum, mac, state, flag, upload, insertTime, detailAddress, companyInfo, scale </sql> <update id="updateState"> update t_income set state =1 where allNo =#{s} update t_income set state =1 where reqSeqId =#{s} </update> ManagementJYXTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/model/Income.java
@@ -56,6 +56,34 @@ @TableField("state") private Integer state; /** * 分账流水id */ @TableField("reqSeqId") private String reqSeqId; /** * 分账时间 */ @TableField("reqDate") private String reqDate; public String getReqDate() { return reqDate; } public void setReqDate(String reqDate) { this.reqDate = reqDate; } public String getReqSeqId() { return reqSeqId; } public void setReqSeqId(String reqSeqId) { this.reqSeqId = reqSeqId; } public String getAllNo() { return allNo; } ManagementJYXTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TCompanyServiceImpl.java
@@ -2,38 +2,34 @@ import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.baomidou.mybatisplus.plugins.Page; import com.baomidou.mybatisplus.service.impl.ServiceImpl; import com.stylefeng.guns.core.util.ToolUtil; import com.stylefeng.guns.modular.cloudPayment.example.AllocationExample; import com.stylefeng.guns.modular.cloudPayment.example.WithdrawalExample; import com.stylefeng.guns.modular.cloudPayment.req.AllocationReq; import com.stylefeng.guns.modular.huifu.biz.FenZhangUtil; import com.stylefeng.guns.modular.system.controller.util.Base64Util; import com.stylefeng.guns.modular.system.dao.IncomeMapper; import com.stylefeng.guns.modular.system.dao.TCompanyMapper; import com.stylefeng.guns.modular.system.dao.TEnterpriseWithdrawalMapper; import com.stylefeng.guns.modular.system.model.*; import com.stylefeng.guns.modular.system.dao.TCompanyMapper; import com.stylefeng.guns.modular.system.service.*; import com.baomidou.mybatisplus.service.impl.ServiceImpl; import com.stylefeng.guns.modular.system.util.RedisUtil; import com.stylefeng.guns.modular.system.util.ResultUtil; import com.unionpay.upyzt.exception.UpyztException; import com.unionpay.upyzt.resp.AllocationResp; import com.unionpay.upyzt.resp.WithdrawalResp; import org.apache.poi.hssf.usermodel.*; //import org.apache.poi.ss.usermodel.CellType; import org.apache.poi.ss.formula.functions.T; import org.apache.poi.ss.usermodel.HorizontalAlignment; import org.apache.poi.ss.util.CellRangeAddress; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import javax.annotation.Resource; import java.math.BigDecimal; import java.text.SimpleDateFormat; import java.time.LocalDate; import java.time.ZoneId; import java.time.temporal.ChronoUnit; import java.util.*; import java.util.stream.Collectors; import java.util.stream.Stream; /** * <p> @@ -49,8 +45,6 @@ @Resource private TCompanyMapper companyMapper; @Override @@ -142,7 +136,7 @@ list1.add(""); list1.add("运营商:"); String company = ""; if(null != companyId){ if (null != companyId) { company = companyMapper.selectById(companyId).getName(); } list1.add(company); @@ -180,7 +174,7 @@ List<List<List<String>>> lists1 = new ArrayList<>(); List<List<String>> lists2 = new ArrayList<>(); for(Map<String, Object> map : list){ for (Map<String, Object> map : list) { List<String> list2 = new ArrayList<>(); list2.add(null != map.get("time") ? map.get("time").toString() : ""); list2.add(null != map.get("register") ? map.get("register").toString() : ""); @@ -201,7 +195,7 @@ HSSFSheet hssfSheet = hssfWorkbook.createSheet(); hssfSheet.setColumnWidth(0, 6 * 256); hssfSheet.setDefaultRowHeightInPoints(20f); for(int i = 0; i < lists.size(); i++){ for (int i = 0; i < lists.size(); i++) { HSSFRow hssfRow = hssfSheet.createRow(i);//设置第一行数据(标题) HSSFCellStyle style = hssfWorkbook.createCellStyle(); HSSFFont font = hssfWorkbook.createFont(); @@ -213,8 +207,8 @@ // hssfCell.setCellType(CellType.STRING);//设置表格类型 hssfCell.setCellValue(lists.get(i).get(l)); hssfCell.setCellStyle(style); if(l > 0) { hssfSheet.setColumnWidth(l , 20 * 256); if (l > 0) { hssfSheet.setColumnWidth(l, 20 * 256); } } @@ -222,18 +216,18 @@ //这个就是合并单元格 //参数说明:1:开始行 2:结束行 3:开始列 4:结束列 //比如我要合并 第二行到第四行的 第六列到第八列 sheet.addMergedRegion(new CellRangeAddress(1,3,5,7)); hssfSheet.addMergedRegion(new CellRangeAddress(0,0,1,3)); hssfSheet.addMergedRegion(new CellRangeAddress(0,0,5,7)); hssfSheet.addMergedRegion(new CellRangeAddress(0,0,9,10)); hssfSheet.addMergedRegion(new CellRangeAddress(1,2,0,0)); hssfSheet.addMergedRegion(new CellRangeAddress(1,2,1,1)); hssfSheet.addMergedRegion(new CellRangeAddress(1,2,2,2)); hssfSheet.addMergedRegion(new CellRangeAddress(1,1,3,5)); hssfSheet.addMergedRegion(new CellRangeAddress(1,1,6,10)); hssfSheet.addMergedRegion(new CellRangeAddress(1,2,11,11)); hssfSheet.addMergedRegion(new CellRangeAddress(0, 0, 1, 3)); hssfSheet.addMergedRegion(new CellRangeAddress(0, 0, 5, 7)); hssfSheet.addMergedRegion(new CellRangeAddress(0, 0, 9, 10)); hssfSheet.addMergedRegion(new CellRangeAddress(1, 2, 0, 0)); hssfSheet.addMergedRegion(new CellRangeAddress(1, 2, 1, 1)); hssfSheet.addMergedRegion(new CellRangeAddress(1, 2, 2, 2)); hssfSheet.addMergedRegion(new CellRangeAddress(1, 1, 3, 5)); hssfSheet.addMergedRegion(new CellRangeAddress(1, 1, 6, 10)); hssfSheet.addMergedRegion(new CellRangeAddress(1, 2, 11, 11)); for(int i = 0; i < lists1.size(); i++){ for (int i = 0; i < lists1.size(); i++) { //将数据添加到表格中 List<String> data = null; for (int l = 0; l < lists1.get(i).size(); l++) { @@ -251,18 +245,19 @@ @Override public List<Map<String, Object>> getCompanyIncomeList(Page<Map<String, Object>> page, String beginTime, String endTime, String userId) { return this.baseMapper.getCompanyIncomeList(page,beginTime,endTime,userId); return this.baseMapper.getCompanyIncomeList(page, beginTime, endTime, userId); } @Override public List<Map<String, Object>> getCompanyIncomeListEx(String beginTime, String endTime, String userId) { return this.baseMapper.getCompanyIncomeListEx(beginTime,endTime,userId); return this.baseMapper.getCompanyIncomeListEx(beginTime, endTime, userId); } @Override public Double getSumCompanyIncomeMoney(String beginTime, String endTime, String userId) { return this.baseMapper.getSumCompanyIncomeMoney(beginTime,endTime,userId); return this.baseMapper.getSumCompanyIncomeMoney(beginTime, endTime, userId); } @Resource private TEnterpriseWithdrawalMapper enterpriseWithdrawalMapper; @Resource @@ -281,14 +276,15 @@ @Override public void updateMoney() { SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd"); // 平台 TCompany company1 = baseMapper.selectList(new EntityWrapper<TCompany>().eq("type", 1)).get(0); TEnterpriseWithdrawal enterpriseWithdrawal = enterpriseWithdrawalMapper.selectList(new EntityWrapper<TEnterpriseWithdrawal>().eq("companyId", company1.getId())).get(0); // 转出 电子账簿id String balanceAcctId = enterpriseWithdrawal.getBalanceAcctId(); String code = enterpriseWithdrawal.getTransactionAuthorizationCode(); code = Base64Util.decode(code); code = Base64Util.decode(code); // 获取分公司分账时间 @@ -305,47 +301,56 @@ System.out.println(localDate1); long between = ChronoUnit.DAYS.between(localDate, localDate1); System.out.println(between); if(between%paymentDays==0){ if (between % paymentDays == 0) { // 开始分账 System.out.println("-----------分公司开始分账----------"); // 获取当前收入电子账簿id List<TEnterpriseWithdrawal> enterpriseWithdrawal1 = enterpriseWithdrawalMapper.selectList(new EntityWrapper<TEnterpriseWithdrawal>().eq("companyId", company.getId())); if(enterpriseWithdrawal1.size()>0){ if (enterpriseWithdrawal1.size() > 0) { // 获取当前公司未分账的金额 Double sum = state.stream().filter(e -> e.getUserType() == 1 && company.getId().equals(e.getObjectId())).mapToDouble(Income::getMoney).sum(); System.out.println("金额 分:"+sum); System.out.println("公司id:"+company.getId()); if(sum==null || sum==0){ System.out.println("金额 分:" + sum); System.out.println("公司id:" + company.getId()); if (sum == null || sum == 0) { continue; } Double v = sum * 100; int money = v.intValue(); TEnterpriseWithdrawal enterpriseWithdrawal2 = enterpriseWithdrawal1.get(0); String balanceAcctId1 = enterpriseWithdrawal2.getBalanceAcctId(); AllocationReq allocationReq = new AllocationReq(); allocationReq.setOutOrderNo(ToolUtil.getRandomString(32)); allocationReq.setPayBalanceAcctId(balanceAcctId); allocationReq.setRecvBalanceAcctId(balanceAcctId1); allocationReq.setAmount(money); allocationReq.setPassword(code); allocationReq.setProductCount(1); allocationReq.setProductName("分公司分账"); allocationReq.setOrderNo(ToolUtil.getRandomString(32)); allocationReq.setOrderAmount(1l); // Double v = sum * 100; // int money = v.intValue(); // TEnterpriseWithdrawal enterpriseWithdrawal2 = enterpriseWithdrawal1.get(0); // String balanceAcctId1 = enterpriseWithdrawal2.getBalanceAcctId(); // AllocationReq allocationReq = new AllocationReq(); // allocationReq.setOutOrderNo(ToolUtil.getRandomString(32)); // allocationReq.setPayBalanceAcctId(balanceAcctId); // allocationReq.setRecvBalanceAcctId(balanceAcctId1); // allocationReq.setAmount(money); // allocationReq.setPassword(code); // allocationReq.setProductCount(1); // allocationReq.setProductName("分公司分账"); // allocationReq.setOrderNo(ToolUtil.getRandomString(32)); // allocationReq.setOrderAmount(1l); String req_seq_id = ToolUtil.getRandomString(32); String seq_date = simpleDateFormat.format(new Date()); try { AllocationResp allocationResp = AllocationExample.create(allocationReq); System.out.println(company.getId()+"::"+company.getName()+"-----分账状态"+allocationResp.getStatus()+"--------------"); if("processing".equals(allocationResp.getStatus())){ // AllocationResp allocationResp = AllocationExample.create(allocationReq); Map<String, Object> fenzhang = FenZhangUtil.fenzhang(req_seq_id, seq_date, String.valueOf(sum), "1"); System.out.println(company.getId() + "::" + company.getName() + "-----分账状态" + fenzhang.toString() + "--------------"); if (!"S".equals(fenzhang.get("trans_stat").toString())) { List<Income> collect = state.stream().filter(e -> e.getUserType() == 1 && company.getId().equals(e.getObjectId())).collect(Collectors.toList()); collect.stream().forEach(e->e.setAllNo(allocationResp.getAllocationId())); collect.stream().forEach(e -> { e.setReqSeqId(req_seq_id); e.setReqDate(seq_date); }); incomeService.updateBatchById(collect); } if("succeeded".equals(allocationResp.getStatus())){ if ("S".equals(fenzhang.get("trans_stat").toString())) { List<Income> collect = state.stream().filter(e -> e.getUserType() == 1 && company.getId().equals(e.getObjectId())).collect(Collectors.toList()); collect.stream().forEach(e->e.setState(1)); collect.stream().forEach(e -> { e.setState(1); e.setReqDate(seq_date); }); incomeService.updateBatchById(collect); } } catch (UpyztException e) { } catch (Exception e) { e.printStackTrace(); } } @@ -354,62 +359,70 @@ // 司机分账 List<Integer> collect2 = userWithdrawalService.selectList(new EntityWrapper<UserWithdrawal>().eq("applicationStatus", "succeeded")).stream().map(e -> e.getUserId()).collect(Collectors.toList()); if(collect2.size()==0){ if (collect2.size() == 0) { collect2.add(0); } // 获取所有司机 List<TDriver> tDrivers = driverService.selectList(new EntityWrapper<TDriver>().in("id",collect2)); List<TDriver> tDrivers = driverService.selectList(new EntityWrapper<TDriver>().in("id", collect2)); // 所有司机公司的分账时间 List<TDriverPayDays> tDriverPayDays = driverPayDaysService.selectList(null); redisUtil.setStrValue("获取的司机:"+ new Date(),tDriverPayDays.toString()); redisUtil.setStrValue("获取的司机:" + new Date(), tDriverPayDays.toString()); for (TDriverPayDays tDriverPayDay : tDriverPayDays) { Integer day = tDriverPayDay.getDay(); LocalDate localDate = new Date().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); LocalDate localDate1 = tDriverPayDay.getUpdateTime().toInstant().atZone(ZoneId.systemDefault()).toLocalDate(); long between = ChronoUnit.DAYS.between(localDate, localDate1); if(between%day==0){ if (between % day == 0) { // 当前公司的司机 List<TDriver> collect = tDrivers.stream().filter(e -> e.getCompanyId() == tDriverPayDay.getCompanyId()).collect(Collectors.toList()); for (TDriver tDriver : collect) { // 获取司机的电子账簿 List<UserWithdrawal> userWithdrawals = userWithdrawalService.selectList(new EntityWrapper<UserWithdrawal>().eq("userType",2).eq("userId", tDriver.getId()).eq("applicationStatus", "succeeded")); if(userWithdrawals.size()>0){ List<UserWithdrawal> userWithdrawals = userWithdrawalService.selectList(new EntityWrapper<UserWithdrawal>().eq("userType", 2).eq("userId", tDriver.getId()).eq("applicationStatus", "succeeded")); if (userWithdrawals.size() > 0) { // 当前司机分账金额 Double sum = state.stream().filter(e ->(e.getUserType() == 2 && tDriver.getId().equals(e.getObjectId()))).mapToDouble(Income::getMoney).sum(); if(sum==null || sum==0){ Double sum = state.stream().filter(e -> (e.getUserType() == 2 && tDriver.getId().equals(e.getObjectId()))).mapToDouble(Income::getMoney).sum(); if (sum == null || sum == 0) { continue; } Double v = sum * 100; int money = v.intValue(); UserWithdrawal userWithdrawal = userWithdrawals.get(0); String balanceAcctId1 = userWithdrawal.getBalanceAcctId(); AllocationReq allocationReq = new AllocationReq(); allocationReq.setOutOrderNo(ToolUtil.getRandomString(32)); allocationReq.setPayBalanceAcctId(balanceAcctId); allocationReq.setRecvBalanceAcctId(balanceAcctId1); allocationReq.setAmount(money); allocationReq.setProductName("司机分账"); allocationReq.setProductCount(1); allocationReq.setOrderNo(ToolUtil.getRandomString(32)); allocationReq.setOrderAmount(1l); allocationReq.setPassword(code); String req_seq_id = ToolUtil.getRandomString(32); String seq_date = simpleDateFormat.format(new Date()); // UserWithdrawal userWithdrawal = userWithdrawals.get(0); // String balanceAcctId1 = userWithdrawal.getBalanceAcctId(); // AllocationReq allocationReq = new AllocationReq(); // allocationReq.setOutOrderNo(); // allocationReq.setPayBalanceAcctId(balanceAcctId); // allocationReq.setRecvBalanceAcctId(balanceAcctId1); // allocationReq.setAmount(money); // allocationReq.setProductName("司机分账"); // allocationReq.setProductCount(1); // allocationReq.setOrderNo(ToolUtil.getRandomString(32)); // allocationReq.setOrderAmount(1l); // allocationReq.setPassword(code); try { AllocationResp allocationResp = AllocationExample.create(allocationReq); System.out.println(tDriver.getId()+"::"+tDriver.getName()+"-----分账状态"+allocationResp.getStatus()+"--------------"); if("processing".equals(allocationResp.getStatus())){ List<Income> collect1 = state.stream().filter(e -> e.getUserType() == 2 && tDriver.getId().equals(e.getObjectId()) ).collect(Collectors.toList()); collect1.stream().forEach(e->e.setAllNo(allocationResp.getAllocationId())); Map<String, Object> fenzhang = FenZhangUtil.fenzhang(req_seq_id, seq_date, String.valueOf(sum), "1"); // AllocationResp allocationResp = AllocationExample.create(allocationReq); System.out.println(tDriver.getId() + "::" + tDriver.getName() + "-----分账状态" + fenzhang.toString() + "--------------"); if (!"S".equals(fenzhang.get("trans_stat").toString())) { List<Income> collect1 = state.stream().filter(e -> e.getUserType() == 2 && tDriver.getId().equals(e.getObjectId())).collect(Collectors.toList()); collect1.stream().forEach(e -> { e.setReqSeqId(req_seq_id); e.setReqDate(seq_date); }); incomeService.updateBatchById(collect1); } if("succeeded".equals(allocationResp.getStatus())){ List<Income> collect1 = state.stream().filter(e -> e.getUserType() == 2 && tDriver.getId().equals(e.getObjectId()) ).collect(Collectors.toList()); collect1.stream().forEach(e->e.setState(1)); if ("S".equals(fenzhang.get("trans_stat").toString())) { List<Income> collect1 = state.stream().filter(e -> e.getUserType() == 2 && tDriver.getId().equals(e.getObjectId())).collect(Collectors.toList()); collect1.stream().forEach(e -> { e.setState(1); e.setReqDate(seq_date); }); incomeService.updateBatchById(collect1); } } catch (UpyztException e) { } catch (Exception e) { e.printStackTrace(); } } @@ -422,6 +435,7 @@ } @Override public void aaa() throws UpyztException { AllocationResp allocationResp = AllocationExample.retrieveById("3008203473415955501"); @@ -430,16 +444,26 @@ @Override public void taskDayFenzhang() { List<Income> state = incomeService.selectList(new EntityWrapper<Income>().eq("state", 0).isNotNull("allNo")); List<String> collect = state.stream().map(Income::getAllNo).distinct().collect(Collectors.toList()); List<Income> state = incomeService.selectList(new EntityWrapper<Income>().eq("state", 0).isNotNull("reqSeqId")); // 分组 Set<String> collect = state.stream().map(Income::getReqSeqId).collect(Collectors.toSet()); for (String s : collect) { try { AllocationResp allocationResp = AllocationExample.retrieveById(s); System.out.println("分账定时查询:"+allocationResp); if("succeeded".equals(allocationResp.getStatus())){ companyMapper.updateState(s); Income income = state.stream().filter(e -> e.getReqSeqId().equals(s)).findFirst().orElse(null); if (income != null) { Map<String, Object> map = FenZhangUtil.queryFenzhang(income.getReqSeqId(), income.getReqDate()); System.out.println("分账定时查询:" + map.toString()); if ("S".equals(map.get("map").toString())) { companyMapper.updateState(s); } } } catch (UpyztException e) { // AllocationResp allocationResp = AllocationExample.retrieveById(s); // // if("succeeded".equals(allocationResp.getStatus())){ // companyMapper.updateState(s); // } } catch (Exception e) { e.printStackTrace(); } } @@ -458,9 +482,9 @@ for (TCompanyWithdraw tCompanyWithdraw : tCompanyWithdraws) { try { WithdrawalResp withdrawalResp = WithdrawalExample.retrieveById(tCompanyWithdraw.getWithdrawId()); if("succeeded".equals(withdrawalResp.getStatus())){ if ("succeeded".equals(withdrawalResp.getStatus())) { tCompanyWithdraw.setStatus(1); }else if("failed".equals(withdrawalResp.getStatus())){ } else if ("failed".equals(withdrawalResp.getStatus())) { tCompanyWithdraw.setStatus(2); tCompanyWithdraw.setRemark(withdrawalResp.getReason()); } @@ -474,19 +498,19 @@ for (TPubWithdrawal tPubWithdrawal : tPubWithdrawals) { try { WithdrawalResp withdrawalResp = WithdrawalExample.retrieveById(tPubWithdrawal.getWithdrawId()); if("failed".equals(withdrawalResp.getStatus())){ if ("failed".equals(withdrawalResp.getStatus())) { tPubWithdrawal.setState(3); tPubWithdrawal.setRemark(withdrawalResp.getReason()); if(tPubWithdrawal.getUserType()==1){ if (tPubWithdrawal.getUserType() == 1) { TUser tUser = userService.selectById(tPubWithdrawal.getUserId()); tUser.setBalance(tUser.getBalance().add(tPubWithdrawal.getMoney())); userService.updateById(tUser); }else { } else { TDriver driver = driverService.selectById(tPubWithdrawal.getUserId()); driver.setLaveBusinessMoney(new BigDecimal(driver.getLaveBusinessMoney()).add(tPubWithdrawal.getMoney()).doubleValue()); driverService.updateById(driver); } }else if("succeeded".equals(withdrawalResp.getStatus())){ } else if ("succeeded".equals(withdrawalResp.getStatus())) { tPubWithdrawal.setState(2); tPubWithdrawal.setSuccessTime(new Date()); } @@ -497,6 +521,7 @@ } } @Autowired private ITUserService userService; ManagementJYXTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/TaskUtil.java
@@ -133,7 +133,7 @@ @Scheduled(fixedRate = 1000 * 60) public void taskDayFenzhang() { try { //companyMapper.taskDayFenzhang(); // 分账业务 companyMapper.taskDayFenzhang(); // 分账业务 } catch (Exception e) { e.printStackTrace(); UserJYXTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/CharteredCar/server/impl/OrderCharteredCarServiceImpl.java
@@ -1,6 +1,5 @@ package com.stylefeng.guns.modular.CharteredCar.server.impl; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.baomidou.mybatisplus.service.impl.ServiceImpl; import com.stylefeng.guns.core.util.ToolUtil; @@ -8,9 +7,9 @@ import com.stylefeng.guns.modular.CharteredCar.model.OrderCharteredCar; import com.stylefeng.guns.modular.CharteredCar.server.IOrderCharteredCarService; import com.stylefeng.guns.modular.account.controller.AppOrderController; import com.stylefeng.guns.modular.api.OrderController; import com.stylefeng.guns.modular.crossCity.dao.OrderCrossCityMapper; import com.stylefeng.guns.modular.crossCity.model.OrderCrossCity; import com.stylefeng.guns.modular.huifu.biz.DouGongPayUtil; import com.stylefeng.guns.modular.specialTrain.dao.OrderPrivateCarMapper; import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar; import com.stylefeng.guns.modular.system.dao.SensitiveWordsMapper; UserJYXTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/account/controller/AppOrderController.java
@@ -245,38 +245,38 @@ System.out.println("预留:"+srcReserve); if(integer==3){ orderCrossCityService.payOrderCrossCityCallback(orderId,"",4,targetOrderId); orderCrossCityService.payOrderCrossCityCallback(orderId,"",4,targetOrderId,null); } if(integer==4){ orderCrossCityService.payCancelOrderCrossCity(orderId,"",4); orderCrossCityService.payCancelOrderCrossCity(orderId,"",4,null); } if(integer==5){ orderLogisticsService.payOrderLogisticsCallback(orderId,",",4); orderLogisticsService.payOrderLogisticsCallback(orderId,",",4,null); } if(integer==6){ orderPrivateCarService.payOrderPrivateCarCallback(orderId,",",4); orderPrivateCarService.payOrderPrivateCarCallback(orderId,",",4,null); } if(integer==9){ orderTaxiService.payOrderTaxiCallback(orderId,"",4,paymentId); orderTaxiService.payOrderTaxiCallback(orderId,"",4,paymentId,null); } if(integer==1){ orderPrivateCarService.payCancelOrderPrivateCar(orderId,",",4); orderPrivateCarService.payCancelOrderPrivateCar(orderId,",",4,null); } if(integer==8){ orderTaxiService.payCancelOrderTaxi(orderId,"",4); orderTaxiService.payCancelOrderTaxi(orderId,"",4,null); } if(integer==2){ orderCrossCityService.payThankYouFeeCallback(orderId,targetOrderId,4); orderCrossCityService.payThankYouFeeCallback(orderId,targetOrderId,4,null); } if(integer==10){ orderLogisticsService.payThankYouFeeCallback(orderId,targetOrderId,4); orderLogisticsService.payThankYouFeeCallback(orderId,targetOrderId,4,null); } if(integer==11){ orderPrivateCarService.payThankYouFeeCallback(orderId,targetOrderId,4); orderPrivateCarService.payThankYouFeeCallback(orderId,targetOrderId,4,null); } if(integer==12){ orderTaxiService.payThankYouFeeCallback(orderId,targetOrderId,4); orderTaxiService.payThankYouFeeCallback(orderId,targetOrderId,4,null); } if(integer==13){ //补差价 orderLogisticsService.payOrderLogisticsSpreadCallback(orderId,targetOrderId,4); UserJYXTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/api/OrderController.java
@@ -1566,13 +1566,13 @@ Integer type = Integer.valueOf(split[1]); switch (type){ case 1: orderPrivateCarService.payCancelOrderPrivateCar(id, order_id, 1); orderPrivateCarService.payCancelOrderPrivateCar(id, order_id, 1,null); break; case 2: orderTaxiService.payCancelOrderTaxi(id, order_id, 1); orderTaxiService.payCancelOrderTaxi(id, order_id, 1,null); break; case 3: orderCrossCityService.payCancelOrderCrossCity(id, order_id, 1); orderCrossCityService.payCancelOrderCrossCity(id, order_id, 1,null); break; } } @@ -1603,13 +1603,13 @@ Integer type = Integer.valueOf(split[1]); switch (type){ case 1: orderPrivateCarService.payCancelOrderPrivateCar(id, order_id, 2); orderPrivateCarService.payCancelOrderPrivateCar(id, order_id, 2,null); break; case 2: orderTaxiService.payCancelOrderTaxi(id, order_id, 2); orderTaxiService.payCancelOrderTaxi(id, order_id, 2,null); break; case 3: orderCrossCityService.payCancelOrderCrossCity(id, order_id, 2); orderCrossCityService.payCancelOrderCrossCity(id, order_id, 2,null); break; } PrintWriter out = response.getWriter(); @@ -2211,19 +2211,19 @@ String[] s = out_trade_no.split("_"); switch (Integer.valueOf(s[1])){ case 1: orderPrivateCarService.payThankYouFeeCallback(Integer.valueOf(s[0]), order_id, 1); orderPrivateCarService.payThankYouFeeCallback(Integer.valueOf(s[0]), order_id, 1,null); case 2: orderTaxiService.payThankYouFeeCallback(Integer.valueOf(s[0]), order_id, 1); orderTaxiService.payThankYouFeeCallback(Integer.valueOf(s[0]), order_id, 1,null); case 3: orderCrossCityService.payThankYouFeeCallback(Integer.valueOf(s[0]), order_id, 1); orderCrossCityService.payThankYouFeeCallback(Integer.valueOf(s[0]), order_id, 1,null); case 4: orderLogisticsService.payThankYouFeeCallback(Integer.valueOf(s[0]), order_id, 1); orderLogisticsService.payThankYouFeeCallback(Integer.valueOf(s[0]), order_id, 1,null); case 5: orderLogisticsService.payThankYouFeeCallback(Integer.valueOf(s[0]), order_id, 1); orderLogisticsService.payThankYouFeeCallback(Integer.valueOf(s[0]), order_id, 1,null); case 6: orderCharteredCarService.payThankYouFeeCallback(Integer.valueOf(s[0]), order_id, 1); orderCharteredCarService.payThankYouFeeCallback(Integer.valueOf(s[0]), order_id, 1,null); case 7: orderCallService.payThankYouFeeCallback(Integer.valueOf(s[0]), order_id, 1); orderCallService.payThankYouFeeCallback(Integer.valueOf(s[0]), order_id, 1,null); } } // cloudPay(map.get("total_fee"),map.get("transaction_id"),1); @@ -2251,19 +2251,19 @@ String[] s = out_trade_no.split("_"); switch (Integer.valueOf(s[1])){ case 1: orderPrivateCarService.payThankYouFeeCallback(Integer.valueOf(s[0]), order_id, 2); orderPrivateCarService.payThankYouFeeCallback(Integer.valueOf(s[0]), order_id, 2,null); case 2: orderTaxiService.payThankYouFeeCallback(Integer.valueOf(s[0]), order_id, 2); orderTaxiService.payThankYouFeeCallback(Integer.valueOf(s[0]), order_id, 2,null); case 3: orderCrossCityService.payThankYouFeeCallback(Integer.valueOf(s[0]), order_id, 2); orderCrossCityService.payThankYouFeeCallback(Integer.valueOf(s[0]), order_id, 2,null); case 4: orderLogisticsService.payThankYouFeeCallback(Integer.valueOf(s[0]), order_id, 2); orderLogisticsService.payThankYouFeeCallback(Integer.valueOf(s[0]), order_id, 2,null); case 5: orderLogisticsService.payThankYouFeeCallback(Integer.valueOf(s[0]), order_id, 2); orderLogisticsService.payThankYouFeeCallback(Integer.valueOf(s[0]), order_id, 2,null); case 6: orderCharteredCarService.payThankYouFeeCallback(Integer.valueOf(s[0]), order_id, 2); orderCharteredCarService.payThankYouFeeCallback(Integer.valueOf(s[0]), order_id, 2,null); case 7: orderCallService.payThankYouFeeCallback(Integer.valueOf(s[0]), order_id, 2); orderCallService.payThankYouFeeCallback(Integer.valueOf(s[0]), order_id, 2,null); } PrintWriter out = response.getWriter(); UserJYXTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/call/server/impl/OrderCallServiceImpl.java
@@ -2,7 +2,6 @@ import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.baomidou.mybatisplus.service.impl.ServiceImpl; import com.stylefeng.guns.modular.CharteredCar.model.OrderCharteredCar; import com.stylefeng.guns.modular.account.controller.AppOrderController; import com.stylefeng.guns.modular.call.dao.OrderCallMapper; import com.stylefeng.guns.modular.call.model.OrderCall; @@ -13,10 +12,9 @@ import com.stylefeng.guns.modular.system.service.ISysIntegralService; import com.stylefeng.guns.modular.system.service.ISystemNoticeService; import com.stylefeng.guns.modular.system.service.IUserInfoService; import com.stylefeng.guns.modular.system.util.DouGongPayUtil; import com.stylefeng.guns.modular.huifu.biz.DouGongPayUtil; import com.stylefeng.guns.modular.system.util.PayMoneyUtil; import com.stylefeng.guns.modular.system.util.ResultUtil; import com.stylefeng.guns.modular.system.util.UUIDUtil; import com.stylefeng.guns.modular.taxi.model.PaymentRecord; import com.stylefeng.guns.modular.taxi.service.IPaymentRecordService; import com.stylefeng.guns.modular.taxi.service.ITransactionDetailsService; UserJYXTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/crossCity/server/impl/OrderCrossCityServiceImpl.java
@@ -3,7 +3,6 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.baomidou.mybatisplus.annotations.TableField; import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.baomidou.mybatisplus.service.impl.ServiceImpl; import com.stylefeng.guns.core.util.ToolUtil; @@ -11,14 +10,12 @@ import com.stylefeng.guns.modular.crossCity.dao.LinePriceMapper; import com.stylefeng.guns.modular.crossCity.dao.LineShiftDriverMapper; import com.stylefeng.guns.modular.crossCity.dao.OrderCrossCityMapper; import com.stylefeng.guns.modular.crossCity.model.Line; import com.stylefeng.guns.modular.crossCity.model.LineShiftDriver; import com.stylefeng.guns.modular.crossCity.model.OrderCrossCity; import com.stylefeng.guns.modular.crossCity.server.ILineService; import com.stylefeng.guns.modular.crossCity.server.IOrderCrossCityService; import com.stylefeng.guns.modular.crossCity.warpper.OrderCrossCityWarpper; import com.stylefeng.guns.modular.smallLogistics.dao.OrderLogisticsMapper; import com.stylefeng.guns.modular.smallLogistics.model.OrderLogistics; import com.stylefeng.guns.modular.huifu.biz.DouGongPayUtil; import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService; import com.stylefeng.guns.modular.specialTrain.dao.OrderPrivateCarMapper; import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar; @@ -35,7 +32,6 @@ import com.stylefeng.guns.modular.taxi.dao.OrderTaxiMapper; import com.stylefeng.guns.modular.taxi.model.OrderTaxi; import com.stylefeng.guns.modular.taxi.model.PaymentRecord; import com.stylefeng.guns.modular.taxi.model.TransactionDetails; import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService; import com.stylefeng.guns.modular.taxi.service.IPaymentRecordService; import com.stylefeng.guns.modular.taxi.service.ITransactionDetailsService; @@ -61,8 +57,6 @@ import java.text.SimpleDateFormat; import java.util.*; import java.util.stream.Collectors; import static com.stylefeng.guns.modular.taxi.service.impl.OrderTaxiServiceImpl.orderIds; @Service UserJYXTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/huifu/biz/DouGongBasicDataBiz.java
@@ -235,4 +235,40 @@ log.info("用户业务入驻修改返回参数:{}", response); return response; } public static void main(String[] args) throws Exception { // 1. 数据初始化,填入对应的商户配置 MerConfig merConfig = new MerConfig(); // merConfig.setProcutId(huiFuProperties.getProductId()); // merConfig.setSysId(huiFuProperties.getSysId()); // merConfig.setRsaPrivateKey(huiFuProperties.getRsaPrivateKey()); // merConfig.setRsaPublicKey(huiFuProperties.getRsaPublicKey()); merConfig.setProcutId("KAZX"); merConfig.setSysId("6666000182995771"); merConfig.setRsaPrivateKey("MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCR6W3ynQJL7f2C8vFYMcQkcirpkif9ZhLq1374jIlV87nv0T9uIm6DoW8LyNEl9w2Yc5qoBv70tt/oVpemA6IZY6NXzE2USNi/sv2qUTtapcIRYxe4acCfY8K+x+p7W2e6wUWIpl9qgZA+UnFmHQ0HT6Ywzq2jJL92JdIs147Ud1aVi3aX8LYItj0z3ZKwZQkaJawZSWQk2+EdPfN059L2qFkPtnT7JIthAdUTJYZA13K4tzw6mXp/DbgwVmLhrlmwl/ccSv2Q0ABfEk7jIxF1nZmCmSy3HrEw9xWyrg1BC+DgXBdyF0OEtpNfv+UW080syUVBNN0irHVuDP81BaAjAgMBAAECggEAGlBZprZQErdxz6rWgYxADj6UpJjaI2XEJZwFZveZUOnqb2hyIv+MpKp5Z0upBErApey7SHAyjJlqWfE72hGvqxp/+7Z5izNz+2ZhPtT1ekyIajBPt89CkLwiA9vz2plKZLC0RIeUj5WcGNEvaDX3AomHtCehwtk+uiTp+XJKbOBtkkQszcdCGY1DVoQ0ppFoINnM9VLbEzaFaG7VS3eFkU4cf2CwcrnJB1RncyPFK+bGFvjkLM/eQbsh8YxkBqaGz/8UM1Na1SEidqdyUF71ltqnI0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H8mkN23NmHL9F8kT48OMmH722am+Hp0XVMMwXqA0oNt4f7oW6kDemjZW8/RT4vIE7cyxoxSsVRvjqSpx9wDgFLPWh3o0pHQaoxLyeUsGBATHFrxEDlosBvsuXjMcgjPKXALrcemzKOhBmBkLgyxNVmh61ZK+FNXd+/X4PeZlnWf54NRQAUKe1308E6IIaszo+CjneKuhj1m/X4f7AIvxAqlhuCV5E/DfKRmGopxaWqdtE960Y/H4SmBh2wIDAQAB"); BasePay.initWithMerConfig(merConfig); // 2.组装请求参数 Map<String, Object> paramsInfo = new HashMap<>(); // 请求流水号 paramsInfo.put("req_seq_id", "rQ20251119164316677154"); // 请求日期 paramsInfo.put("req_date", "20251119"); // 出款方商户号 paramsInfo.put("out_huifu_id", "6666000182995771"); // 支付金额 paramsInfo.put("ord_amt", "0.01"); // 分账对象 paramsInfo.put("acct_split_bunch", "{\"acct_infos\":[{\"div_amt\":\"0.01\",\"huifu_id\":\"6666000183361451\"}]}"); // 安全信息 paramsInfo.put("risk_check_data", "{\"sub_product\":\"1\",\"transfer_type\":\"05\"}"); // 手续费承担方标识余额支付手续费承担方标识;商户余额支付扣收规则为接口指定承担方时必填!枚举值:<br/>OUT:出款方;<br/>IN:分账接受方。<br/><font color="green">示例值:IN</font> paramsInfo.put("trans_fee_take_flag", "OUT"); // 核验值verify_type不为空时必填。当verify_type=SMS时,填写用户收到的短信验证码 // paramsInfo.put("verify_value", "test"); // 3. 发起API调用 Map<String, Object> response = BasePayRequest.requestBasePay("v2/trade/acctpayment/pay", paramsInfo, null, false);; System.out.println(response); } } UserJYXTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/huifu/biz/DouGongPayUtil.java
File was renamed from UserJYXTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/util/DouGongPayUtil.java @@ -1,24 +1,13 @@ package com.stylefeng.guns.modular.system.util; package com.stylefeng.guns.modular.huifu.biz; import cn.hutool.http.HttpRequest; import cn.hutool.http.HttpResponse; import cn.hutool.http.HttpUtil; import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONObject; import com.alipay.api.AlipayApiException; import com.alipay.api.AlipayClient; import com.alipay.api.DefaultAlipayClient; import com.alipay.api.request.AlipaySystemOauthTokenRequest; import com.alipay.api.response.AlipaySystemOauthTokenResponse; import com.fasterxml.jackson.databind.ObjectMapper; import com.huifu.bspay.sdk.opps.core.BasePay; import com.huifu.bspay.sdk.opps.core.config.MerConfig; import com.huifu.bspay.sdk.opps.core.utils.DateTools; import com.huifu.bspay.sdk.opps.core.utils.SequenceTools; import com.stylefeng.guns.core.util.HttpUtils; import com.stylefeng.guns.core.util.ToolUtil; import com.stylefeng.guns.modular.huifu.biz.DouGongBasicDataBiz; import com.stylefeng.guns.modular.huifu.properties.HuiFuProperties; import com.stylefeng.guns.modular.system.util.ResultUtil; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; @@ -30,8 +19,6 @@ import java.util.Base64; import java.util.Date; import java.util.TreeMap; import static com.aliyun.oss.model.RoutingRule.Protocol.Http; /** * 斗拱支付工具类 UserJYXTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/smallLogistics/server/impl/OrderLogisticsServiceImpl.java
@@ -9,7 +9,7 @@ import com.stylefeng.guns.modular.account.controller.AppOrderController; import com.stylefeng.guns.modular.crossCity.dao.OrderCrossCityMapper; import com.stylefeng.guns.modular.crossCity.model.OrderCrossCity; import com.stylefeng.guns.modular.crossCity.server.IOrderCrossCityService; import com.stylefeng.guns.modular.huifu.biz.DouGongPayUtil; import com.stylefeng.guns.modular.smallLogistics.dao.OrderLogisticsMapper; import com.stylefeng.guns.modular.smallLogistics.model.OrderLogistics; import com.stylefeng.guns.modular.smallLogistics.model.OrderLogisticsSpread; @@ -17,7 +17,6 @@ import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsSpreadService; import com.stylefeng.guns.modular.specialTrain.dao.OrderPrivateCarMapper; import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar; import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService; import com.stylefeng.guns.modular.system.dao.*; import com.stylefeng.guns.modular.system.model.*; import com.stylefeng.guns.modular.system.service.*; @@ -28,11 +27,9 @@ import com.stylefeng.guns.modular.taxi.dao.OrderTaxiMapper; import com.stylefeng.guns.modular.taxi.model.OrderTaxi; import com.stylefeng.guns.modular.taxi.model.PaymentRecord; import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService; import com.stylefeng.guns.modular.taxi.service.IPaymentRecordService; import com.stylefeng.guns.modular.taxi.service.ITransactionDetailsService; import com.unionpay.upyzt.exception.UpyztException; import org.springframework.beans.BeanUtils; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; UserJYXTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/specialTrain/server/impl/OrderPrivateCarServiceImpl.java
@@ -3,7 +3,6 @@ import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSONArray; import com.alibaba.fastjson.JSONObject; import com.aliyun.oss.ServiceException; import com.baomidou.mybatisplus.mapper.EntityWrapper; import com.baomidou.mybatisplus.service.impl.ServiceImpl; import com.stylefeng.guns.core.util.ToolUtil; @@ -12,7 +11,7 @@ import com.stylefeng.guns.modular.crossCity.model.OrderCrossCity; import com.stylefeng.guns.modular.crossCity.server.IOrderCrossCityService; import com.stylefeng.guns.modular.crossCity.server.impl.OrderCrossCityServiceImpl; import com.stylefeng.guns.modular.smallLogistics.model.OrderLogistics; import com.stylefeng.guns.modular.huifu.biz.DouGongPayUtil; import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService; import com.stylefeng.guns.modular.specialTrain.dao.OrderPrivateCarMapper; import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar; @@ -28,7 +27,6 @@ import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService; import com.stylefeng.guns.modular.taxi.service.IPaymentRecordService; import com.stylefeng.guns.modular.taxi.service.ITransactionDetailsService; import javafx.concurrent.Task; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.http.HttpEntity; UserJYXTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/TaxiCardServiceImpl.java
@@ -10,7 +10,7 @@ import com.stylefeng.guns.modular.system.dao.TaxiCardMapper; import com.stylefeng.guns.modular.system.model.*; import com.stylefeng.guns.modular.system.service.*; import com.stylefeng.guns.modular.system.util.DouGongPayUtil; import com.stylefeng.guns.modular.huifu.biz.DouGongPayUtil; import com.stylefeng.guns.modular.system.util.GDMapGeocodingUtil; import com.stylefeng.guns.modular.system.util.PayMoneyUtil; import com.stylefeng.guns.modular.system.util.ResultUtil; UserJYXTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/system/service/impl/UserInfoServiceImpl.java
@@ -12,6 +12,7 @@ import com.stylefeng.guns.core.util.JwtTokenUtil; import com.stylefeng.guns.core.util.ToolUtil; import com.stylefeng.guns.modular.account.controller.AppOrderController; import com.stylefeng.guns.modular.huifu.biz.DouGongPayUtil; import com.stylefeng.guns.modular.system.dao.*; import com.stylefeng.guns.modular.system.model.*; import com.stylefeng.guns.modular.system.service.*; @@ -29,7 +30,6 @@ import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; import org.springframework.web.bind.annotation.ResponseBody; import javax.annotation.Resource; import javax.crypto.Cipher; UserJYXTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/taxi/service/impl/OrderTaxiServiceImpl.java
@@ -11,7 +11,7 @@ import com.stylefeng.guns.modular.crossCity.model.OrderCrossCity; import com.stylefeng.guns.modular.crossCity.server.IOrderCrossCityService; import com.stylefeng.guns.modular.crossCity.server.impl.OrderCrossCityServiceImpl; import com.stylefeng.guns.modular.smallLogistics.model.OrderLogistics; import com.stylefeng.guns.modular.huifu.biz.DouGongPayUtil; import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService; import com.stylefeng.guns.modular.specialTrain.dao.OrderPrivateCarMapper; import com.stylefeng.guns.modular.specialTrain.model.OrderPrivateCar; @@ -27,7 +27,6 @@ import com.stylefeng.guns.modular.taxi.service.IOrderTaxiService; import com.stylefeng.guns.modular.taxi.service.IPaymentRecordService; import com.stylefeng.guns.modular.taxi.service.ITransactionDetailsService; import org.bouncycastle.crypto.tls.MACAlgorithm; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Value; import org.springframework.http.HttpEntity;