Merge remote-tracking branch 'origin/master'
# Conflicts:
# DriverJYXTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/account/controller/UserWithdrawalController.java
# DriverJYXTravel/guns-admin/src/main/java/com/stylefeng/guns/modular/huifu/biz/DouGongBasicDataBiz.java
| | |
| | | } |
| | | String tokenNo = (String) map.get("token_no"); |
| | | userWithdrawal.setTokenNo(tokenNo); |
| | | userWithdrawal.setType(1); |
| | | userWithdrawalService.insert(userWithdrawal); |
| | | |
| | | // 通过司机进件信息封装银行卡信息进行数据库存储 |
| | |
| | | userWithdrawal.setBankCode(bankCode); |
| | | userWithdrawal.setBankBranchCode(bankBranchCode); |
| | | userWithdrawal.setCode(code); |
| | | userWithdrawal.setType(1); |
| | | System.out.println(userWithdrawal); |
| | | Map<String, Object> resultMap = douGongBasicDataBiz.userBasicDataIndvModify(userWithdrawal); |
| | | //CusApplicationResp renew = CusApplicationExample.renew(userWithdrawal); |
| | |
| | | if(Objects.isNull(userWithdrawal)){ |
| | | return ResultUtil.success(new Object()); |
| | | } |
| | | Region province = regionService.getRegionByCode(userWithdrawal.getBankCardProvinceCode()); |
| | | Region city = regionService.getRegionByCode(userWithdrawal.getBankCardCityCode()); |
| | | userWithdrawal.setBankCardProvince(province == null ? "" : province.getName()); |
| | | userWithdrawal.setBankCardCity(city == null ? "" : city.getName()); |
| | | if(userWithdrawal!=null){ |
| | | Region province = regionService.getRegionByCode(userWithdrawal.getBankCardProvinceCode()); |
| | | Region city = regionService.getRegionByCode(userWithdrawal.getBankCardCityCode()); |
| | | userWithdrawal.setBankCardProvince(province == null ? "" : province.getName()); |
| | | userWithdrawal.setBankCardCity(city == null ? "" : city.getName()); |
| | | } |
| | | |
| | | return ResultUtil.success(userWithdrawal); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | // 查询当前操作电子用户 |
| | | // 司机进件信息 |
| | | UserWithdrawal userWithdrawal = userWithdrawalService.selectOne(new EntityWrapper<UserWithdrawal>() |
| | | .eq("phone",driver.getPhone()).eq("type", 1) |
| | | .eq("phone",driver.getPhone()) |
| | | .eq("type", 1) |
| | | //.eq("applicationStatus","succeeded") |
| | | .last("LIMIT 1")); |
| | | |
| | |
| | | // .eq("userType", 2)); |
| | | userWithdrawal = userWithdrawalService.selectOne(new EntityWrapper<UserWithdrawal>() |
| | | .eq("phone", driver.getPhone()) |
| | | .eq("type", 1) |
| | | .eq("type", 1) |
| | | .last("LIMIT 1")); |
| | | if(Objects.isNull(userWithdrawal)){ |
| | | return ResultUtil.error("该司机开户信息为空"); |
| | |
| | | out.flush(); |
| | | out.close(); |
| | | String[] split = out_trade_no.split("_"); |
| | | reassignService.payReassign(split[0], order_id, 1); |
| | | reassignService.payReassign(out_trade_no, order_id, 1); |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | |
| | | out.flush(); |
| | | out.close(); |
| | | String[] split = out_trade_no.split("_"); |
| | | reassignService.payReassign(split[0], order_id, 2); |
| | | reassignService.payReassign(out_trade_no, order_id, 2); |
| | | } |
| | | } |
| | | }catch (Exception e){ |
| | |
| | | if (ToolUtil.isEmpty(code)) { |
| | | return ResultUtil.error("参数为空"); |
| | | } |
| | | //未登录过获取openId进行授权 |
| | | String openID = null; |
| | | WxMpOAuth2AccessToken accessToken = wxMpService.oauth2getAccessToken(code); |
| | | openID = accessToken.getOpenId(); |
| | | // //未登录过获取openId进行授权 |
| | | // String openID = null; |
| | | // WxMpOAuth2AccessToken accessToken = wxMpService.oauth2getAccessToken(code); |
| | | // openID = accessToken.getOpenId(); |
| | | Driver driver = driverService.selectById(uid); |
| | | driver.setAppletsOpenId(openID); |
| | | driver.setAppletsOpenId(code); |
| | | driverService.updateById(driver); |
| | | return ResultUtil.success(); |
| | | } catch (Exception e) { |
| | | // e.printStackTrace(); //尽量不要使用这个打印异常,会造成内存锁,使用log日志就好 |
| | | e.printStackTrace(); //尽量不要使用这个打印异常,会造成内存锁,使用log日志就 |
| | | return ResultUtil.error("获取openID异常"); |
| | | } |
| | | |
| | |
| | | } |
| | | |
| | | |
| | | @Autowired |
| | | private DouGongPayUtil douGongPayUtil; |
| | | |
| | | |
| | | |
| | | /** |
| | |
| | | String out_trade_no = orderId + "_3_" + UUIDUtil.getRandomCode(5); |
| | | if(payType == 1){//微信支付 |
| | | // resultUtil = payMoneyUtil.weixinpay("完成订单", "", out_trade_no, orderMoney.toString(), "/base/wxPayCrossCity", "APP", ""); |
| | | DouGongPayUtil.wxPayOrder(orderMoney.toString(), openId, "完成订单", 3, String.valueOf(orderId), 1); |
| | | douGongPayUtil.wxPayOrder(orderMoney.toString(), openId, "完成订单", 3, String.valueOf(orderId), 1); |
| | | paymentRecordService.saveData(1, orderCrossCity.getDriverId(), 2, orderId, 3, 1, orderMoney, "", 1);//添加预支付数据 |
| | | } |
| | | if(payType == 2){//支付宝支付 |
| | |
| | | log.info("用户业务入驻修改返回参数:{}", response); |
| | | return response; |
| | | } |
| | | |
| | | /** |
| | | * 电子账户余额查询 |
| | | * |
| | |
| | | // 请求流水号 |
| | | paramsInfo.put("req_seq_id", RequestSeqUtil.generateForHuiFu()); |
| | | // 请求日期 |
| | | paramsInfo.put("req_date", com.stylefeng.guns.core.util.DateUtil.format(new Date(), "yyyyMMdd")); |
| | | paramsInfo.put("req_date", DateUtil.format(new Date(), "yyyyMMdd")); |
| | | log.info("账户余额信息查询返回参数:{}", paramsInfo); |
| | | // 3. 发起API调用 |
| | | Map<String, Object> response = BasePayRequest.requestBasePay("v2/trade/acctpayment/balance/query", paramsInfo, null, false); |
| | | log.info("账户余额信息查询返回参数:{}", response); |
| | | JSONArray accountList = JSONArray.parseArray(response.get("acctInfo_list").toString()); |
| | | JSONArray accountList = JSONArray.parseArray(JSONObject.toJSONString(response.get("acctInfo_list"))); |
| | | if (accountList != null && !accountList.isEmpty()) { |
| | | JSONObject acctInfo = accountList.getJSONObject(0); |
| | | log.info("账户余额信息查询返回余额:{}", acctInfo.getString("avail_bal")); |
| | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.huifu.properties.HuiFuProperties; |
| | | import com.stylefeng.guns.modular.system.util.RedisUtil; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | |
| | | private HuiFuProperties huiFuProperties; |
| | | |
| | | |
| | | @Value("${callbackPath}") |
| | | private static String callbackPath;//支付回调网关地址 |
| | | private static String callbackPath = "http://221.182.45.100:8007";//支付回调网关地址 |
| | | // private static String callbackPath = "https://zhentonggongsi.com:443/driver";//支付回调网关地址 |
| | | |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | |
| | | public static void main(String[] args) throws Exception { |
| | | |
| | |
| | | * @param orderId |
| | | * @return |
| | | */ |
| | | public static ResultUtil wxPayOrder(String money, String openId, String goodsDesc, int type, String orderId, int callType) { |
| | | public ResultUtil wxPayOrder(String money, String openId, String goodsDesc, int type, String orderId, int callType) { |
| | | HttpRequest post = HttpUtil.createPost("https://api.huifu.com/v4/trade/payment/create"); |
| | | String req_seq_id = orderId + "_" + type + "_" + System.currentTimeMillis() + ToolUtil.getRandomNumber(10); |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd"); |
| | |
| | | System.out.println(p); |
| | | post.body(p); |
| | | |
| | | |
| | | HttpResponse execute = post.execute(); |
| | | System.out.println(execute.body()); |
| | | |
| | | String randomString = ToolUtil.getRandomString(18); |
| | | redisUtil.setStrValue("dg_wx_pay:"+randomString,execute.body(),300); |
| | | JSONObject jsonObject = JSONObject.parseObject(execute.body()); |
| | | jsonObject.put("dg_wx_pay","dg_wx_pay:"+randomString); |
| | | return ResultUtil.success(jsonObject); |
| | | } |
| | | |
| | |
| | | DATE_FORMAT(a.networkCarlssueDate, '%Y-%m-%d') as networkCarlssueDate, |
| | | a.driverContactAddress_ as driverContactAddress_, |
| | | a.idCard as idCard, |
| | | a.appletsOpenId openid, |
| | | a.idCardImgUrl1 as idCardImgUrl1, |
| | | a.idCardImgUrl2 as idCardImgUrl2, |
| | | DATE_FORMAT(a.getDriverLicenseDate, '%Y-%m-%d') as getDriverLicenseDate, |
| | |
| | | private String callbackPath; |
| | | |
| | | |
| | | @Autowired |
| | | private DouGongPayUtil douGongPayUtil; |
| | | |
| | | |
| | | /** |
| | | * 提交改派申请 |
| | |
| | | |
| | | reassign.setState(1); |
| | | // resultUtil = payMoneyUtil.weixinpay("改派订单", "", reassign.getId() + "_" + reassign.getOrderType() + "_" + UUIDUtil.getRandomCode(5), aDouble.toString(), "/base/wxReassign", "APP", ""); |
| | | resultUtil = DouGongPayUtil.wxPayOrder(aDouble.toString(), driver.getAppletsOpenId(), "改派订单", reassign.getOrderType(), String.valueOf(reassign.getId()), 2); |
| | | resultUtil = douGongPayUtil.wxPayOrder(aDouble.toString(), driver.getAppletsOpenId(), "改派订单", reassign.getOrderType(), String.valueOf(reassign.getId()), 2); |
| | | paymentRecordService.saveData(1, uid, 2, reassign.getOrderId(), reassign.getOrderType(), 1, aDouble, "", 1);//添加预支付数据 |
| | | } |
| | | if(reassign.getPayType() == 2){//支付宝 |
| | |
| | | if ("00000000".equals(refund.get("resp_code")) && "S".equals(refund.get("trans_stat"))) { |
| | | orderCrossCity.setState(10); |
| | | }else if (!"00000000".equals(refund.get("resp_code"))) { |
| | | return ResultUtil.error("订单取消失败:" + refund.get("resp_desc").toString()); |
| | | return ResultUtil.error("订单取消:" + refund.get("resp_desc").toString()); |
| | | } |
| | | tOrderCrossCityService.updateById(orderCrossCity); |
| | | }else if(query.getPayType()==4){ |
| | |
| | | if ("00000000".equals(refund.get("resp_code")) && "S".equals(refund.get("trans_stat"))) { |
| | | orderCrossCity.setState(10); |
| | | }else if (!"00000000".equals(refund.get("resp_code"))) { |
| | | return ResultUtil.error("订单取消失败:" + refund.get("resp_desc").toString()); |
| | | return ResultUtil.error("订单取消:" + refund.get("resp_desc").toString()); |
| | | } |
| | | tOrderCrossCityService.updateById(orderCrossCity); |
| | | //添加交易明细 |
| | |
| | | import com.baomidou.mybatisplus.plugins.Page; |
| | | import com.stylefeng.guns.core.base.controller.BaseController; |
| | | import com.stylefeng.guns.core.common.constant.factory.PageFactory; |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | | import com.stylefeng.guns.core.shiro.ShiroKit; |
| | | import com.stylefeng.guns.core.shiro.ShiroUser; |
| | | import com.stylefeng.guns.core.util.ExcelUtil; |
| | | import com.stylefeng.guns.core.util.SinataUtil; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.core.util.*; |
| | | import com.stylefeng.guns.modular.cloudPayment.example.AllocationExample; |
| | | 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.LineShiftDriverMapper; |
| | | import com.stylefeng.guns.modular.system.dao.OrderCancelMapper; |
| | |
| | | import com.unionpay.upyzt.resp.AllocationResp; |
| | | import org.apache.poi.hssf.usermodel.HSSFWorkbook; |
| | | import org.springframework.beans.BeanUtils; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.stereotype.Controller; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | import org.springframework.ui.Model; |
| | | import org.springframework.web.bind.annotation.PathVariable; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import com.stylefeng.guns.core.log.LogObjectHolder; |
| | | import org.springframework.web.bind.annotation.RequestMapping; |
| | | import org.springframework.web.bind.annotation.RequestParam; |
| | | import org.springframework.web.bind.annotation.ResponseBody; |
| | | |
| | | import javax.annotation.Resource; |
| | | import javax.servlet.http.HttpServletResponse; |
| | |
| | | import java.math.BigDecimal; |
| | | import java.text.DateFormat; |
| | | import java.text.SimpleDateFormat; |
| | | import java.util.*; |
| | | import java.util.Date; |
| | | import java.util.HashMap; |
| | | import java.util.List; |
| | | import java.util.Map; |
| | | |
| | | /** |
| | | * 快车改派管理控制器 |
| | |
| | | */ |
| | | @RequestMapping(value = "/opt") |
| | | @ResponseBody |
| | | public Object opt(@RequestParam Integer tReassignId,@RequestParam Integer optType) { |
| | | public Object opt(@RequestParam Integer tReassignId,@RequestParam Integer optType) throws Exception { |
| | | ShiroUser user = ShiroKit.getUser(); |
| | | TReassign tReassign = tReassignService.selectById(tReassignId); |
| | | if (1 == optType){ |
| | | Integer originalDriverId = tReassign.getOriginalDriverId(); |
| | | String allocationReq = createAllocationReq(1, originalDriverId, 1, tReassign.getMoney()); |
| | | if("error".equals(allocationReq)){ |
| | | return ResultUtil.error("该司机未进件"); |
| | | } |
| | | if(!"ok".equals(allocationReq)){ |
| | | return ResultUtil.error(allocationReq); |
| | | } |
| | | |
| | | |
| | | // String allocationReq = createAllocationReq(1, originalDriverId, 1, tReassign.getMoney()); |
| | | // if("error".equals(allocationReq)){ |
| | | // return ResultUtil.error("该司机未进件"); |
| | | // } |
| | | // if(!"ok".equals(allocationReq)){ |
| | | // return ResultUtil.error(allocationReq); |
| | | // } |
| | | |
| | | TDriver driver = itDriverService.selectById(originalDriverId); |
| | | |
| | | UserWithdrawal userWithdrawal = userWithdrawalService.selectOne(new EntityWrapper<UserWithdrawal>().eq("phone", driver.getPhone()).eq("type", 1).last("limit 1")); |
| | | if(null == userWithdrawal){ |
| | | return ResultUtil.error("该司机未进件"); |
| | | } |
| | | |
| | | FenZhangUtil.fenzhang(RequestSeqUtil.generate("TK"), DateUtil.format(new Date(), "yyyyMMdd"),tReassign.getMoney().toString(),userWithdrawal.getHuiFuId()); |
| | | |
| | | |
| | | driver.setBalance(driver.getBalance().add(new BigDecimal(tReassign.getMoney()))); |
| | | driver.setLaveBusinessMoney(new BigDecimal(driver.getLaveBusinessMoney()).add(new BigDecimal(tReassign.getMoney())).doubleValue()); |
| | | itDriverService.updateById(driver); |
| | |
| | | |
| | | |
| | | Integer originalDriverId = tReassign.getOriginalDriverId(); |
| | | String allocationReq = createAllocationReq(1, originalDriverId, 1, tReassign.getMoney()); |
| | | if("error".equals(allocationReq)){ |
| | | return ResultUtil.error("该司机未进件"); |
| | | } |
| | | if(!"ok".equals(allocationReq)){ |
| | | return ResultUtil.error(allocationReq); |
| | | } |
| | | // String allocationReq = createAllocationReq(1, originalDriverId, 1, tReassign.getMoney()); |
| | | // if("error".equals(allocationReq)){ |
| | | // return ResultUtil.error("该司机未进件"); |
| | | // } |
| | | // if(!"ok".equals(allocationReq)){ |
| | | // return ResultUtil.error(allocationReq); |
| | | // } |
| | | |
| | | TDriver driver = itDriverService.selectById(originalDriverId); |
| | | |
| | | |
| | | UserWithdrawal userWithdrawal = userWithdrawalService.selectOne(new EntityWrapper<UserWithdrawal>().eq("phone", driver.getPhone()).eq("type", 1).last("limit 1")); |
| | | if(null == userWithdrawal){ |
| | | return ResultUtil.error("该司机未进件"); |
| | | } |
| | | |
| | | FenZhangUtil.fenzhang(RequestSeqUtil.generate("TK"), DateUtil.format(new Date(), "yyyyMMdd"),tReassign.getMoney().toString(),userWithdrawal.getHuiFuId()); |
| | | |
| | | |
| | | driver.setBalance(driver.getBalance().add(new BigDecimal(tReassign.getMoney()))); |
| | | driver.setLaveBusinessMoney(new BigDecimal(driver.getLaveBusinessMoney()).add(new BigDecimal(tReassign.getMoney())).doubleValue()); |
| | | itDriverService.updateById(driver); |
| | |
| | | TReassign tReassign = tReassignService.selectById(tReassignId); |
| | | if (1 == optType){ |
| | | Integer originalDriverId = tReassign.getOriginalDriverId(); |
| | | String allocationReq = createAllocationReq(1, originalDriverId, 1, tReassign.getMoney()); |
| | | if("error".equals(allocationReq)){ |
| | | return ResultUtil.error("该司机未进件"); |
| | | } |
| | | if(!"ok".equals(allocationReq)){ |
| | | return ResultUtil.error(allocationReq); |
| | | } |
| | | // String allocationReq = createAllocationReq(1, originalDriverId, 1, tReassign.getMoney()); |
| | | // if("error".equals(allocationReq)){ |
| | | // return ResultUtil.error("该司机未进件"); |
| | | // } |
| | | // if(!"ok".equals(allocationReq)){ |
| | | // return ResultUtil.error(allocationReq); |
| | | // } |
| | | |
| | | TDriver driver = itDriverService.selectById(originalDriverId); |
| | | |
| | | |
| | | UserWithdrawal userWithdrawal = userWithdrawalService.selectOne(new EntityWrapper<UserWithdrawal>().eq("phone", driver.getPhone()).eq("type", 1).last("limit 1")); |
| | | if(null == userWithdrawal){ |
| | | return ResultUtil.error("该司机未进件"); |
| | | } |
| | | |
| | | FenZhangUtil.fenzhang(RequestSeqUtil.generate("TK"), DateUtil.format(new Date(), "yyyyMMdd"),tReassign.getMoney().toString(),userWithdrawal.getHuiFuId()); |
| | | |
| | | driver.setBalance(driver.getBalance().add(new BigDecimal(tReassign.getMoney()))); |
| | | driver.setLaveBusinessMoney(new BigDecimal(driver.getLaveBusinessMoney()).add(new BigDecimal(tReassign.getMoney())).doubleValue()); |
| | | itDriverService.updateById(driver); |
| | |
| | | */ |
| | | @RequestMapping(value = "/optTaxi") |
| | | @ResponseBody |
| | | public Object optTaxi(@RequestParam Integer tReassignId,@RequestParam Integer optType) { |
| | | public Object optTaxi(@RequestParam Integer tReassignId,@RequestParam Integer optType) throws Exception { |
| | | ShiroUser user = ShiroKit.getUser(); |
| | | TReassign tReassign = tReassignService.selectById(tReassignId); |
| | | if (1 == optType){ |
| | | |
| | | Integer originalDriverId = tReassign.getOriginalDriverId(); |
| | | String allocationReq = createAllocationReq(1, originalDriverId, 1, tReassign.getMoney()); |
| | | if("error".equals(allocationReq)){ |
| | | return ResultUtil.error("该司机未进件"); |
| | | } |
| | | if(!"ok".equals(allocationReq)){ |
| | | return ResultUtil.error(allocationReq); |
| | | } |
| | | // String allocationReq = createAllocationReq(1, originalDriverId, 1, tReassign.getMoney()); |
| | | // if("error".equals(allocationReq)){ |
| | | // return ResultUtil.error("该司机未进件"); |
| | | // } |
| | | // if(!"ok".equals(allocationReq)){ |
| | | // return ResultUtil.error(allocationReq); |
| | | // } |
| | | |
| | | TDriver driver = itDriverService.selectById(originalDriverId); |
| | | |
| | | |
| | | UserWithdrawal userWithdrawal = userWithdrawalService.selectOne(new EntityWrapper<UserWithdrawal>().eq("phone", driver.getPhone()).eq("type", 1).last("limit 1")); |
| | | if(null == userWithdrawal){ |
| | | return ResultUtil.error("该司机未进件"); |
| | | } |
| | | |
| | | FenZhangUtil.fenzhang(RequestSeqUtil.generate("TK"), DateUtil.format(new Date(), "yyyyMMdd"),tReassign.getMoney().toString(),userWithdrawal.getHuiFuId()); |
| | | |
| | | |
| | | driver.setBalance(driver.getBalance().add(new BigDecimal(tReassign.getMoney()))); |
| | | driver.setLaveBusinessMoney(new BigDecimal(driver.getLaveBusinessMoney()).add(new BigDecimal(tReassign.getMoney())).doubleValue()); |
| | | itDriverService.updateById(driver); |
| | |
| | | |
| | | 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); |
| | | // 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); |
| | | // String balanceAcctId = enterpriseWithdrawal.getBalanceAcctId(); |
| | | // String code = enterpriseWithdrawal.getTransactionAuthorizationCode(); |
| | | // code = Base64Util.decode(code); |
| | | |
| | | |
| | | // 获取分公司分账时间 |
| | |
| | | // 开始分账 |
| | | System.out.println("-----------分公司开始分账----------"); |
| | | // 获取当前收入电子账簿id |
| | | List<TEnterpriseWithdrawal> enterpriseWithdrawal1 = enterpriseWithdrawalMapper.selectList(new EntityWrapper<TEnterpriseWithdrawal>().eq("companyId", company.getId())); |
| | | List<TEnterpriseWithdrawal> enterpriseWithdrawal1 = enterpriseWithdrawalMapper.selectList(new EntityWrapper<TEnterpriseWithdrawal>().eq("type",1).eq("companyId", company.getId())); |
| | | if (enterpriseWithdrawal1.size() > 0) { |
| | | // 获取当前公司未分账的金额 |
| | | Double sum = state.stream().filter(e -> e.getUserType() == 1 && company.getId().equals(e.getObjectId())).mapToDouble(Income::getMoney).sum(); |
| | |
| | | } |
| | | // Double v = sum * 100; |
| | | // int money = v.intValue(); |
| | | // TEnterpriseWithdrawal enterpriseWithdrawal2 = enterpriseWithdrawal1.get(0); |
| | | TEnterpriseWithdrawal enterpriseWithdrawal2 = enterpriseWithdrawal1.get(0); |
| | | // String balanceAcctId1 = enterpriseWithdrawal2.getBalanceAcctId(); |
| | | // AllocationReq allocationReq = new AllocationReq(); |
| | | // allocationReq.setOutOrderNo(ToolUtil.getRandomString(32)); |
| | |
| | | String seq_date = simpleDateFormat.format(new Date()); |
| | | try { |
| | | // AllocationResp allocationResp = AllocationExample.create(allocationReq); |
| | | Map<String, Object> fenzhang = FenZhangUtil.fenzhang(req_seq_id, seq_date, String.valueOf(sum), "1"); |
| | | Map<String, Object> fenzhang = FenZhangUtil.fenzhang(req_seq_id, seq_date, String.valueOf(sum), enterpriseWithdrawal2.getHuifuId()); |
| | | String resp_code = fenzhang.get("resp_code").toString(); |
| | | if(!"00000000".equals(resp_code)){ |
| | | continue; |
| | |
| | | } |
| | | |
| | | // 司机分账 |
| | | List<Integer> collect2 = userWithdrawalService.selectList(new EntityWrapper<UserWithdrawal>().eq("applicationStatus", "succeeded")).stream().map(e -> e.getUserId()).collect(Collectors.toList()); |
| | | List<Integer> collect2 = userWithdrawalService.selectList(new EntityWrapper<UserWithdrawal>().eq("type", 1)).stream().map(e -> e.getUserId()).collect(Collectors.toList()); |
| | | if (collect2.size() == 0) { |
| | | collect2.add(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")); |
| | | List<UserWithdrawal> userWithdrawals = userWithdrawalService.selectList(new EntityWrapper<UserWithdrawal>().eq("type", 1).eq("phone", tDriver.getPhone())); |
| | | if (userWithdrawals.size() > 0) { |
| | | // 当前司机分账金额 |
| | | Double sum = state.stream().filter(e -> (e.getUserType() == 2 && tDriver.getId().equals(e.getObjectId()))).mapToDouble(Income::getMoney).sum(); |
| | |
| | | String req_seq_id = ToolUtil.getRandomString(32); |
| | | String seq_date = simpleDateFormat.format(new Date()); |
| | | |
| | | // UserWithdrawal userWithdrawal = userWithdrawals.get(0); |
| | | UserWithdrawal userWithdrawal = userWithdrawals.get(0); |
| | | // String balanceAcctId1 = userWithdrawal.getBalanceAcctId(); |
| | | // AllocationReq allocationReq = new AllocationReq(); |
| | | // allocationReq.setOutOrderNo(); |
| | |
| | | // allocationReq.setOrderAmount(1l); |
| | | // allocationReq.setPassword(code); |
| | | try { |
| | | Map<String, Object> fenzhang = FenZhangUtil.fenzhang(req_seq_id, seq_date, String.valueOf(sum), "1"); |
| | | Map<String, Object> fenzhang = FenZhangUtil.fenzhang(req_seq_id, seq_date, String.valueOf(sum), userWithdrawal.getHuiFuId()); |
| | | // AllocationResp allocationResp = AllocationExample.create(allocationReq); |
| | | System.out.println(tDriver.getId() + "::" + tDriver.getName() + "-----分账状态" + fenzhang.toString() + "--------------"); |
| | | String resp_code = fenzhang.get("resp_code").toString(); |
| | |
| | | return "CH" + sdf.format(new Date()) + UUIDUtil.getRandomCode(5); |
| | | } |
| | | |
| | | @Autowired |
| | | private DouGongPayUtil douGongPayUtil; |
| | | |
| | | @Override |
| | | @Transactional(propagation = Propagation.REQUIRES_NEW) |
| | | public ResultUtil payThankYouFee(Integer uid, Integer orderId, Double money, Integer payType, Integer type) throws Exception { |
| | |
| | | if(payType == 1){//微信支付 |
| | | String app = type == 1 ? "APP" : "JSAPI"; |
| | | // resultUtil = payMoneyUtil.weixinpay("感谢费", "", orderId + "_6_" + UUIDUtil.getRandomCode(5), money.toString(), "/base/wxPayThankYouFee", app, userInfo.getAppletsOpenId()); |
| | | resultUtil = DouGongPayUtil.wxPayOrder(money.toString(), userInfo.getAppletsOpenId(), "感谢费", 6, String.valueOf(orderId), 4); |
| | | resultUtil = douGongPayUtil.wxPayOrder(money.toString(), userInfo.getAppletsOpenId(), "感谢费", 6, String.valueOf(orderId), 4); |
| | | |
| | | paymentRecordService.saveData(3, uid, 1, orderId, 6, 1, money, "", 1);//添加预支付数据 |
| | | } |
| | | if(payType == 2){//支付宝支付 |
| | |
| | | } |
| | | UserInfo userInfo = userInfoService.selectById(id); |
| | | UserWithdrawal userWithdrawal = userWithdrawalService.selectOne(new EntityWrapper<UserWithdrawal>().eq("phone", userInfo.getPhone()).eq("type",1)); |
| | | Region province = regionService.getRegionByCode(userWithdrawal.getBankCardProvinceCode()); |
| | | Region city = regionService.getRegionByCode(userWithdrawal.getBankCardCityCode()); |
| | | userWithdrawal.setBankCardProvince(province == null ? "" : province.getName()); |
| | | userWithdrawal.setBankCardCity(city == null ? "" : city.getName()); |
| | | if(userWithdrawal!=null){ |
| | | Region province = regionService.getRegionByCode(userWithdrawal.getBankCardProvinceCode()); |
| | | Region city = regionService.getRegionByCode(userWithdrawal.getBankCardCityCode()); |
| | | userWithdrawal.setBankCardProvince(province == null ? "" : province.getName()); |
| | | userWithdrawal.setBankCardCity(city == null ? "" : city.getName()); |
| | | } |
| | | |
| | | return ResultUtil.success(userWithdrawal==null?new UserWithdrawal():userWithdrawal); |
| | | }catch (Exception e){ |
| | | e.printStackTrace(); |
| | |
| | | |
| | | UserInfo user = userInfoService.selectById(userInfoService.getUserIdFormRedis(request)); |
| | | UserWithdrawal driverWith = userWithdrawalService.selectOne(new EntityWrapper<UserWithdrawal>() |
| | | .eq("phone", user.getPhone()) |
| | | .eq("phone", user.getPhone()).eq("type",1) |
| | | .last("LIMIT 1")); |
| | | if(driverWith==null){ |
| | | return ResultUtil.error("请先进行进件操作"); |
| | | } |
| | | try { |
| | | BalanceAcctReq balanceAcctReq = new BalanceAcctReq(); |
| | | balanceAcctReq.setCusId(driverWith.getCusId()); |
| | | BalanceAcctListResp balanceAcctListResp = BalanceAcctExample.retrieveByUserId(balanceAcctReq); |
| | | List<BalanceAcctItem> balanceAccts = balanceAcctListResp.getBalanceAccts(); |
| | | for (BalanceAcctItem balanceAcct : balanceAccts) { |
| | | if(balanceAcct.getBalanceAcctId().equals(driverWith.getBalanceAcctId())){ |
| | | if(balanceAcct.getSettledAmount().doubleValue()==0){ |
| | | return ResultUtil.success(new BigDecimal(0)); |
| | | } |
| | | return ResultUtil.success(new BigDecimal(balanceAcct.getSettledAmount()).divide(new BigDecimal(100))); |
| | | } |
| | | } |
| | | BigDecimal bigDecimal = douGongBasicDataBiz.balanceQuery(driverWith.getHuifuId()); |
| | | return ResultUtil.success(bigDecimal); |
| | | // BalanceAcctReq balanceAcctReq = new BalanceAcctReq(); |
| | | // balanceAcctReq.setCusId(driverWith.getCusId()); |
| | | // BalanceAcctListResp balanceAcctListResp = BalanceAcctExample.retrieveByUserId(balanceAcctReq); |
| | | // List<BalanceAcctItem> balanceAccts = balanceAcctListResp.getBalanceAccts(); |
| | | // for (BalanceAcctItem balanceAcct : balanceAccts) { |
| | | // if(balanceAcct.getBalanceAcctId().equals(driverWith.getBalanceAcctId())){ |
| | | // if(balanceAcct.getSettledAmount().doubleValue()==0){ |
| | | // return ResultUtil.success(new BigDecimal(0)); |
| | | // } |
| | | // return ResultUtil.success(new BigDecimal(balanceAcct.getSettledAmount()).divide(new BigDecimal(100))); |
| | | // } |
| | | // } |
| | | } catch (UpyztException e) { |
| | | e.printStackTrace(); |
| | | System.out.println("用户获取可提现余额:"+e); |
| | | return ResultUtil.error(e.getMessage()); |
| | | } |
| | | return ResultUtil.success(new BigDecimal(0)); |
| | | } |
| | | |
| | | |
| | |
| | | private String rsa_public_key; |
| | | |
| | | |
| | | @GetMapping("/api/order/getDgWxPay") |
| | | @ApiOperation(value = "获取微信支付参数", tags = {"用户端-订单"}, notes = "") |
| | | @ApiImplicitParams({ |
| | | }) |
| | | public ResultUtil<String> getDgWxPay(String param){ |
| | | String value = redisUtil.getValue(param); |
| | | return ResultUtil.success(value); |
| | | } |
| | | |
| | | |
| | | |
| | |
| | | String trans_stat = jsonObject.get("trans_stat").toString(); |
| | | if ("S".equals(trans_stat)) { |
| | | String[] split = out_trade_no.split("_"); |
| | | Integer uid = Integer.valueOf(split[0]); |
| | | Integer id = Integer.valueOf(split[1]); |
| | | Integer uid = Integer.valueOf(split[1]); |
| | | Integer id = Integer.valueOf(split[0]); |
| | | String payAmt = jsonObject.get("pay_amt").toString(); |
| | | userInfoService.payCancelUserBalance(Integer.valueOf(uid), order_id, Integer.valueOf(id), 1); |
| | | // appOrderController.createAllocationReqUser(1, Integer.valueOf(uid), 1, new BigDecimal(payAmt).divide(new BigDecimal(100)).doubleValue()); |
| | |
| | | String trans_stat = jsonObject.get("trans_stat").toString(); |
| | | if ("S".equals(trans_stat)) { |
| | | String[] split = out_trade_no.split("_"); |
| | | Integer uid = Integer.valueOf(split[0]); |
| | | Integer id = Integer.valueOf(split[1]); |
| | | Integer uid = Integer.valueOf(split[1]); |
| | | Integer id = Integer.valueOf(split[0]); |
| | | String payAmt = jsonObject.get("pay_amt").toString(); |
| | | userInfoService.payCancelUserBalance(Integer.valueOf(uid), order_id, Integer.valueOf(id), 2); |
| | | |
| | |
| | | import com.stylefeng.guns.modular.system.service.IWithdrawalService; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import com.stylefeng.guns.modular.system.warpper.WithdrawalWarpper; |
| | | import com.unionpay.upyzt.resp.CusApplicationResp; |
| | | import io.swagger.annotations.Api; |
| | | import io.swagger.annotations.ApiImplicitParam; |
| | | import io.swagger.annotations.ApiImplicitParams; |
| | |
| | | userWithdrawal.setBankCode(bankName1.getDrecCode()); |
| | | userWithdrawal.setBankBranchCode(bankName1.getBankCode()); |
| | | userWithdrawal.setCode(smsCode); |
| | | //CusApplicationResp renew = CusApplicationExample.renew(userWithdrawal); |
| | | CusApplicationResp renew = CusApplicationExample.renew(userWithdrawal); |
| | | //System.err.println("修改个人用户进件信息返回"+renew); |
| | | if("succeeded".equals(renew.getApplicationStatus())){ |
| | | // 修改银行卡信息 |
| | |
| | | @Autowired |
| | | private ISystemNoticeService systemNoticeService; |
| | | |
| | | |
| | | @Autowired |
| | | private DouGongPayUtil douGongPayUtil; |
| | | |
| | | @Override |
| | | @Transactional(propagation = Propagation.REQUIRES_NEW) |
| | |
| | | if(payType == 1){//微信支付 |
| | | String app = type == 1 ? "APP" : "JSAPI"; |
| | | // resultUtil = payMoneyUtil.weixinpay("感谢费", "", orderId + "_7_" + UUIDUtil.getRandomCode(5), money.toString(), "/base/wxPayThankYouFee", app, userInfo.getAppletsOpenId()); |
| | | resultUtil = DouGongPayUtil.wxPayOrder(money.toString(), userInfo.getAppletsOpenId(), "感谢费", 7, String.valueOf(orderId), 4); |
| | | resultUtil = douGongPayUtil.wxPayOrder(money.toString(), userInfo.getAppletsOpenId(), "感谢费", 7, String.valueOf(orderId), 4); |
| | | |
| | | paymentRecordService.saveData(3, uid, 1, orderId, 7, 1, money, "", 1);//添加预支付数据 |
| | | } |
| | |
| | | rows = rows.stream().filter(e->e.getMoney()<=orderCrossCity.getOrderMoney()|| e.getDataType()==2).collect(Collectors.toList()); |
| | | return rows; |
| | | } |
| | | |
| | | @Autowired |
| | | private DouGongPayUtil douGongPayUtil; |
| | | /** |
| | | * 订单支付 |
| | | * @param payType |
| | |
| | | if(payType == 1){//微信支付 |
| | | String app = type == 1 ? "APP" : "JSAPI"; |
| | | // resultUtil = payMoneyUtil.weixinpay("完成订单", "", orderId + "_3_" + UUIDUtil.getRandomCode(5), orderMoney.toString(), "/base/wxPayOrderTaxi", app, userInfo.getAppletsOpenId()); |
| | | resultUtil = DouGongPayUtil.wxPayOrder(orderMoney.toString(), userInfo.getAppletsOpenId(), "完成订单", 3, String.valueOf(orderId), 1); |
| | | resultUtil = douGongPayUtil.wxPayOrder(orderMoney.toString(), userInfo.getAppletsOpenId(), "完成订单", 3, String.valueOf(orderId), 1); |
| | | |
| | | paymentRecordService.saveData(1, orderCrossCity.getUserId(), 1, orderId, 3, 1, orderMoney, "", 1);//添加预支付数据 |
| | | } |
| | |
| | | } |
| | | String app = type == 1 ? "APP" : "JSAPI"; |
| | | // resultUtil = payMoneyUtil.weixinpay("完成订单", "", orderId + "_3_" + UUIDUtil.getRandomCode(5), orderMoney.toString(), "/base/wxPayOrderTaxi", app, userInfo.getAppletsOpenId()); |
| | | resultUtil = DouGongPayUtil.wxPayOrder(orderMoney.toString(), userInfo.getAppletsOpenId(), "完成订单", 3, String.valueOf(orderId), 1); |
| | | resultUtil = douGongPayUtil.wxPayOrder(orderMoney.toString(), userInfo.getAppletsOpenId(), "完成订单", 3, String.valueOf(orderId), 1); |
| | | paymentRecordService.saveData(1, orderCrossCity.getUserId(), 1, orderId, 3, 1, orderMoney, "", 1);//添加预支付数据 |
| | | } |
| | | if(payType == 2){//支付宝支付 |
| | |
| | | |
| | | String app = type == 1 ? "APP" : "JSAPI"; |
| | | // resultUtil = payMoneyUtil.weixinpay("订单取消", "", id + "_3_" + UUIDUtil.getRandomCode(5), query.getMoney().toString(), "/base/wxCancelOrderTaxi", app, userInfo.getAppletsOpenId()); |
| | | resultUtil = DouGongPayUtil.wxPayOrder(query.getMoney().toString(), userInfo.getAppletsOpenId(), "订单取消", 3, String.valueOf(id), 5); |
| | | resultUtil = douGongPayUtil.wxPayOrder(query.getMoney().toString(), userInfo.getAppletsOpenId(), "订单取消", 3, String.valueOf(id), 5); |
| | | paymentRecordService.saveData(1, orderCrossCity.getUserId(), 1, id, 3, 1, query.getMoney(), "", 1);//添加预支付数据 |
| | | |
| | | // Map<String, String> map = icbcPayUtil.placeAnOrder(id + ",3", 9, 5, uid.toString(), "订单取消", query.getMoney(), callbackPath + "/base/wxCancelOrderTaxi", "", type, appletsOpenId); |
| | |
| | | if(payType == 1){//微信支付 |
| | | String app = type == 1 ? "APP" : "JSAPI"; |
| | | // resultUtil = payMoneyUtil.weixinpay("感谢费", "", orderId + "_3_" + UUIDUtil.getRandomCode(5), money.toString(), "/base/wxPayThankYouFee", app, userInfo.getAppletsOpenId()); |
| | | resultUtil = DouGongPayUtil.wxPayOrder(money.toString(), userInfo.getAppletsOpenId(), "感谢费", 3, String.valueOf(orderId), 4); |
| | | resultUtil = douGongPayUtil.wxPayOrder(money.toString(), userInfo.getAppletsOpenId(), "感谢费", 3, String.valueOf(orderId), 4); |
| | | paymentRecordService.saveData(3, uid, 1, orderId, 3, 1, money, "", 1);//添加预支付数据 |
| | | } |
| | | if(payType == 2){//支付宝支付 |
| | |
| | | // 2.组装请求参数 |
| | | Map<String, Object> paramsInfo = new HashMap<>(); |
| | | // 请求流水号 |
| | | paramsInfo.put("req_seq_id", "rQ20251119164316677154"); |
| | | paramsInfo.put("req_seq_id", "rQ20252119164e1667715e"); |
| | | // 请求日期 |
| | | paramsInfo.put("req_date", "20251125"); |
| | | // 出款方商户号 |
| | |
| | | // 支付金额 |
| | | paramsInfo.put("ord_amt", "0.01"); |
| | | // 分账对象 |
| | | paramsInfo.put("acct_split_bunch", "{\"acct_infos\":[{\"div_amt\":\"0.01\",\"huifu_id\":\"6666000183361451\"}]}"); |
| | | paramsInfo.put("acct_split_bunch", "{\"acct_infos\":[{\"div_amt\":\"0.01\",\"huifu_id\":\"6666000183997312\"}]}"); |
| | | // 安全信息 |
| | | paramsInfo.put("risk_check_data", "{\"sub_product\":\"1\",\"transfer_type\":\"05\"}"); |
| | | // 手续费承担方标识余额支付手续费承担方标识;商户余额支付扣收规则为接口指定承担方时必填!枚举值:<br/>OUT:出款方;<br/>IN:分账接受方。<br/><font color="green">示例值:IN</font> |
| | |
| | | Map<String, Object> response = BasePayRequest.requestBasePay("v2/trade/acctpayment/pay", paramsInfo, null, false);; |
| | | System.out.println(response); |
| | | } |
| | | |
| | | /** |
| | | * 电子账户余额查询 |
| | | * |
| | | * @return |
| | | * @throws Exception |
| | | */ |
| | | public BigDecimal balanceQuery(String huifuId) throws Exception { |
| | | // 1. 数据初始化,填入对应的商户配置 |
| | | MerConfig merConfig = new MerConfig(); |
| | | merConfig.setProcutId(huiFuProperties.getProductId()); |
| | | merConfig.setSysId(huiFuProperties.getSysId()); |
| | | merConfig.setRsaPrivateKey(huiFuProperties.getRsaPrivateKey()); |
| | | merConfig.setRsaPublicKey(huiFuProperties.getRsaPublicKey()); |
| | | BasePay.initWithMerConfig(merConfig); |
| | | // 2.组装请求参数 |
| | | Map<String, Object> paramsInfo = new HashMap<>(); |
| | | // 汇付ID |
| | | paramsInfo.put("huifu_id", huifuId); |
| | | // 请求流水号 |
| | | paramsInfo.put("req_seq_id", RequestSeqUtil.generateForHuiFu()); |
| | | // 请求日期 |
| | | paramsInfo.put("req_date", DateUtil.format(new Date(), "yyyyMMdd")); |
| | | log.info("账户余额信息查询返回参数:{}", paramsInfo); |
| | | // 3. 发起API调用 |
| | | Map<String, Object> response = BasePayRequest.requestBasePay("v2/trade/acctpayment/balance/query", paramsInfo, null, false); |
| | | log.info("账户余额信息查询返回参数:{}", response); |
| | | String string = response.get("acctInfo_list").toString(); |
| | | JSONArray accountList = JSONArray.parseArray(string); |
| | | if (accountList != null && !accountList.isEmpty()) { |
| | | JSONObject acctInfo = accountList.getJSONObject(0); |
| | | log.info("账户余额信息查询返回余额:{}", acctInfo.getString("avail_bal")); |
| | | return acctInfo.getBigDecimal("avl_bal"); |
| | | } |
| | | return BigDecimal.ZERO; |
| | | } |
| | | } |
| | |
| | | import com.huifu.bspay.sdk.opps.core.net.BasePayRequest; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.huifu.properties.HuiFuProperties; |
| | | import com.stylefeng.guns.modular.system.util.RedisUtil; |
| | | import com.stylefeng.guns.modular.system.util.ResultUtil; |
| | | import org.springframework.beans.factory.annotation.Autowired; |
| | | import org.springframework.beans.factory.annotation.Value; |
| | | import org.springframework.stereotype.Component; |
| | | |
| | | import java.math.BigDecimal; |
| | | import java.math.RoundingMode; |
| | |
| | | /** |
| | | * 斗拱支付工具类 |
| | | */ |
| | | @Component |
| | | public class DouGongPayUtil { |
| | | |
| | | @Value("${huifu.product_id}") |
| | |
| | | private static String privateKeyBase64; |
| | | |
| | | |
| | | @Autowired |
| | | private RedisUtil redisUtil; |
| | | |
| | | |
| | | |
| | | private static String callbackPath = "http://221.182.45.100:8006";//支付回调网关地址 |
| | | // private static String callbackPath = "https://zhentonggongsi.com:443/user";//支付回调网关地址 |
| | | |
| | | public static void main(String[] args) throws Exception { |
| | | |
| | |
| | | String req_seq_id = System.currentTimeMillis() + ToolUtil.getRandomNumber(10); |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd"); |
| | | String req_date = simpleDateFormat.format(new Date()); |
| | | String money ="0.01"; |
| | | money = new BigDecimal(money).setScale(2, RoundingMode.HALF_UP).toString(); |
| | | String notifyUrl = ""; |
| | | // |
| | | // money = new BigDecimal(money).setScale(2, RoundingMode.HALF_UP).toString(); |
| | | // switch (callType) { |
| | | // case 1: |
| | | // // 订单支付 |
| | | // notifyUrl = callbackPath + "/base/DGCallBack"; |
| | | // break; |
| | | // case 2: |
| | | // // 支付小件物流差价支付回调 |
| | | // notifyUrl = callbackPath +"/base/DGPayOrderLogisticsSpread"; |
| | | // break; |
| | | // case 3: |
| | | // // 购买出行卡支付回调 |
| | | // notifyUrl = callbackPath+"/base/DGPayTaxiCardPaymentSpread"; |
| | | // break; |
| | | // case 4: |
| | | // // 感谢费支付回调 |
| | | // notifyUrl = callbackPath + "/base/DGPayThankYouFee"; |
| | | // break; |
| | | // case 5: |
| | | // // 取消订单 |
| | | // notifyUrl = callbackPath + "/base/DGCancelOrderTaxi"; |
| | | // break; |
| | | // case 6: |
| | | // // 充值 |
| | | // notifyUrl = callbackPath + "/base/DGCancelUserBalance"; |
| | | // break; |
| | | // } |
| | | String a = "{\n" + |
| | | " \"req_seq_id\": \"" + req_seq_id + "\",\n" + |
| | | " \"req_date\": \"" + req_date + "\",\n" + |
| | | " \"huifu_id\": \"6666000182995771\",\n" + |
| | | " \"trade_type\": \"A_NATIVE\",\n" + |
| | | " \"trans_amt\": \""+money+"\",\n" + |
| | | " \"goods_desc\": \"test\",\n" + |
| | | " \"trade_type\": \"T_MINIAPP\",\n" + |
| | | " \"trans_amt\": \"" + 0.01 + "\",\n" + |
| | | " \"goods_desc\": \"" + "goodsDesc" + "\",\n" + |
| | | " \"remark\": \"嘉易行\",\n" + |
| | | " \"notify_url\": \""+"http://221.182.45.100:8006/base/DGCallBackZfb"+"\",\n" + |
| | | " \"notify_url\": \""+notifyUrl+"\",\n" + |
| | | " }"; |
| | | // 去掉换行、空格等格式字符 |
| | | a = a.replaceAll("\\s", ""); |
| | |
| | | " \"req_seq_id\": \"" + req_seq_id + "\",\n" + |
| | | " \"req_date\": \"" + req_date + "\",\n" + |
| | | " \"huifu_id\": \"6666000182995771\",\n" + |
| | | " \"trade_type\": \"A_NATIVE\",\n" + |
| | | " \"trans_amt\": \""+money+"\",\n" + |
| | | " \"goods_desc\": \"test\",\n" + |
| | | " \"trade_type\": \"T_MINIAPP\",\n" + |
| | | " \"trans_amt\": \"" + 0.01 + "\",\n" + |
| | | " \"goods_desc\": \"" + "goodsDesc" + "\",\n" + |
| | | " \"remark\": \"嘉易行\",\n" + |
| | | " \"notify_url\": \""+"http://221.182.45.100:8006/base/DGCallBackZfb"+"\",\n" + |
| | | " \"notify_url\": \""+notifyUrl+"\",\n" + |
| | | " }\n" + |
| | | "}\n"; |
| | | System.out.println(p); |
| | |
| | | |
| | | HttpResponse execute = post.execute(); |
| | | System.out.println(execute.body()); |
| | | String body = execute.body(); |
| | | JSONObject jsonObject = JSONObject.parseObject(body); |
| | | System.out.println(jsonObject); |
| | | |
| | | // HttpRequest post = HttpUtil.createPost("https://api.huifu.com/v4/trade/payment/create"); |
| | | // String req_seq_id = System.currentTimeMillis() + ToolUtil.getRandomNumber(10); |
| | | // SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd"); |
| | | // String req_date = simpleDateFormat.format(new Date()); |
| | | // String money ="0.01"; |
| | | // money = new BigDecimal(money).setScale(2, RoundingMode.HALF_UP).toString(); |
| | | // String a = "{\n" + |
| | | // " \"req_seq_id\": \"" + req_seq_id + "\",\n" + |
| | | // " \"req_date\": \"" + req_date + "\",\n" + |
| | | // " \"huifu_id\": \"6666000182995771\",\n" + |
| | | // " \"trade_type\": \"T_MINIAPP\",\n" + |
| | | // " \"trans_amt\": \""+money+"\",\n" + |
| | | // " \"goods_desc\": \"test\",\n" + |
| | | // " \"remark\": \"嘉易行\",\n" + |
| | | // " \"notify_url\": \""+"http://221.182.45.100:8006/base/DGCallBackZfb"+"\",\n" + |
| | | // " }"; |
| | | // // 去掉换行、空格等格式字符 |
| | | // a = a.replaceAll("\\s", ""); |
| | | // |
| | | // |
| | | // a = JSON.toJSONString(JSONObject.parseObject(a, TreeMap.class)); |
| | | // String sign = sign(a, "MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCR6W3ynQJL7f2C8vFYMcQkcirpkif9ZhLq1374jIlV87nv0T9uIm6DoW8LyNEl9w2Yc5qoBv70tt/oVpemA6IZY6NXzE2USNi/sv2qUTtapcIRYxe4acCfY8K+x+p7W2e6wUWIpl9qgZA+UnFmHQ0HT6Ywzq2jJL92JdIs147Ud1aVi3aX8LYItj0z3ZKwZQkaJawZSWQk2+EdPfN059L2qFkPtnT7JIthAdUTJYZA13K4tzw6mXp/DbgwVmLhrlmwl/ccSv2Q0ABfEk7jIxF1nZmCmSy3HrEw9xWyrg1BC+DgXBdyF0OEtpNfv+UW080syUVBNN0irHVuDP81BaAjAgMBAAECggEAGlBZprZQErdxz6rWgYxADj6UpJjaI2XEJZwFZveZUOnqb2hyIv+MpKp5Z0upBErApey7SHAyjJlqWfE72hGvqxp/+7Z5izNz+2ZhPtT1ekyIajBPt89CkLwiA9vz2plKZLC0RIeUj5WcGNEvaDX3AomHtCehwtk+uiTp+XJKbOBtkkQszcdCGY1DVoQ0ppFoINnM9VLbEzaFaG7VS3eFkU4cf2CwcrnJB1RncyPFK+bGFvjkLM/eQbsh8YxkBqaGz/8UM1Na1SEidqdyUF71ltqnI0u8pLe0V+5jugVW+3lPL/p1C3i7mAbQOs4yqRWlFaGVTzOawoQUOPVwDpzeeQKBgQDs1P7F4wURqX1qZR0hSTqOigg48ychaOF66new3SuWk2CVBy8Q8b7odGSPyxJSGZvFLoznPYuSaXCtQ935WWfjB7Z5JpSWCi9BmJnkh41k/KvgMqAEGkZP6ul/zFnDWj94VwXEBz3TuRk574vK2coWoxjM6h1dlJjRBVVTs8dnrQKBgQCduKCjPDUuOHbcNn3VsaHEZX1XyiXN5gds08o61PjiHM42wYXxfUt59nBJmg2yAVRIrKYHfswJcxb5XUTDI5ZhCBnIPrdrQzj7FNadm/7mKDvSsvZdpfTiHY341XnvCq7OcNNj8g5fVsWF769strepQReSug7xgX7ojPvVcAZhDwKBgD57KwP2Er5IIuhQ6NCBS0uTqvurWqV70BDnjtBAaWF+XDq0/HvR63XUTzuIbbrvOqNY1p+jIxFrc+iiQQupxLimrkNkJEs5QKJjqiYahPkhmA68DG9Ip0gqR5QJy5y4UIplGwZOiscyzC72vcC0mJZETSSylzC7JV3vtEUy5ua5AoGAEwlDqjAMIyYBgpa5HV+xLKkrNbtaUL2gy8vMLsmhuHjNkuJMrlb3EyNhbiC/4moyqArehy0Qp1tSvIo7UGotLkzx/69CKBoW+IcNWDyJyXG1trqO7cKoCdqTViM98lIRwyzu9rMydONeN8o0HCT5id4nYDhAsXl1vc+2XY6F1pUCgYEA0dxGHBTKD/WzIvTYGYD6Xx224Y84mO6x2Mu16zFoq/NjuIdKi2O+92yrKDCMMCqaY77fXvWD3eI7QYYlbKAOqdLKVipTbhnBccDyNbtYHVg59t4xS+K6HyD+quVkL9n40UkxSZbKZBQhqt+vlQy0FUgONFii1ACZO0A8Sc/bvn4="); |
| | | // System.out.println(a); |
| | | // String p = "{\n" + |
| | | // " \"sys_id\": \"6666000182995771\",\n" + |
| | | // " \"product_id\": \"KAZX\",\n" + |
| | | // " \"sign\": \"" + sign + "\",\n" + |
| | | // " \"data\": {\n" + |
| | | // " \"req_seq_id\": \"" + req_seq_id + "\",\n" + |
| | | // " \"req_date\": \"" + req_date + "\",\n" + |
| | | // " \"huifu_id\": \"6666000182995771\",\n" + |
| | | // " \"trade_type\": \"T_MINIAPP\",\n" + |
| | | // " \"trans_amt\": \""+money+"\",\n" + |
| | | // " \"goods_desc\": \"test\",\n" + |
| | | // " \"remark\": \"嘉易行\",\n" + |
| | | // " \"notify_url\": \""+"http://221.182.45.100:8006/base/DGCallBackZfb"+"\",\n" + |
| | | // " }\n" + |
| | | // "}\n"; |
| | | // System.out.println(p); |
| | | // post.body(p); |
| | | // |
| | | // HttpResponse execute = post.execute(); |
| | | // System.out.println(execute.body()); |
| | | // String body = execute.body(); |
| | | // JSONObject jsonObject = JSONObject.parseObject(body); |
| | | // System.out.println(jsonObject); |
| | | } |
| | | |
| | | |
| | |
| | | * @param orderId |
| | | * @return |
| | | */ |
| | | public static ResultUtil wxPayOrder(String money, String openId, String goodsDesc, int type, String orderId, int callType) { |
| | | public ResultUtil wxPayOrder(String money, String openId, String goodsDesc, int type, String orderId, int callType) { |
| | | HttpRequest post = HttpUtil.createPost("https://api.huifu.com/v4/trade/payment/create"); |
| | | String req_seq_id = orderId + "_" + type + "_" + System.currentTimeMillis() + ToolUtil.getRandomNumber(10); |
| | | SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyyMMdd"); |
| | |
| | | |
| | | HttpResponse execute = post.execute(); |
| | | System.out.println(execute.body()); |
| | | |
| | | String randomString = ToolUtil.getRandomString(18); |
| | | redisUtil.setStrValue("dg_wx_pay:"+randomString,execute.body(),300); |
| | | JSONObject jsonObject = JSONObject.parseObject(execute.body()); |
| | | jsonObject.put("req_seq_id",req_seq_id); |
| | | jsonObject.put("dg_wx_pay","dg_wx_pay:"+randomString); |
| | | return ResultUtil.success(jsonObject); |
| | | } |
| | | |
| | |
| | | if(payType == 1){//微信支付 |
| | | String app = type == 1 ? "APP" : "JSAPI"; |
| | | // resultUtil = payMoneyUtil.weixinpay("小件物流下单支付", "", orderId + "_" + orderLogistics.getType() + "_" + UUIDUtil.getRandomCode(5), orderMoney.toString(), "/base/wxPayOrderTaxi", app, userInfo.getAppletsOpenId()); |
| | | resultUtil = DouGongPayUtil.wxPayOrder(orderMoney.toString(), userInfo.getAppletsOpenId(), "完成订单", orderLogistics.getType(), String.valueOf(orderId), 1); |
| | | resultUtil = douGongPayUtil.wxPayOrder(orderMoney.toString(), userInfo.getAppletsOpenId(), "完成订单", orderLogistics.getType(), String.valueOf(orderId), 1); |
| | | |
| | | paymentRecordService.saveData(1, orderLogistics.getUserId(), 1, orderId, orderLogistics.getType(), 1, orderMoney, "", 1);//添加预支付数据 |
| | | } |
| | |
| | | } |
| | | String app = type == 1 ? "APP" : "JSAPI"; |
| | | // resultUtil = payMoneyUtil.weixinpay("小件物流下单支付", "", orderId + "_" + orderLogistics.getType() + "_" + UUIDUtil.getRandomCode(5), orderMoney.toString(), "/base/wxPayOrderTaxi", app, userInfo.getAppletsOpenId()); |
| | | resultUtil = DouGongPayUtil.wxPayOrder(orderMoney.toString(), userInfo.getAppletsOpenId(), "小件物流下单支付", orderLogistics.getType(), String.valueOf(orderId), 1); |
| | | resultUtil = douGongPayUtil.wxPayOrder(orderMoney.toString(), userInfo.getAppletsOpenId(), "小件物流下单支付", orderLogistics.getType(), String.valueOf(orderId), 1); |
| | | paymentRecordService.saveData(1, orderLogistics.getUserId(), 1, orderId, orderLogistics.getType(), 1, orderMoney, "", 1);//添加预支付数据 |
| | | } |
| | | if(payType == 2){//支付宝支付 |
| | |
| | | if(payType == 1){//微信支付 |
| | | String app = type == 1 ? "APP" : "JSAPI"; |
| | | // resultUtil = payMoneyUtil.weixinpay("小件物流补差价", "", orderId + "_" + orderLogistics.getType() + "_" + UUIDUtil.getRandomCode(5), orderMoney.toString(), "/base/wxPayOrderLogisticsSpread", app, userInfo.getAppletsOpenId()); |
| | | resultUtil = DouGongPayUtil.wxPayOrder(orderMoney.toString(), userInfo.getAppletsOpenId(), "小件物流补差价", orderLogistics.getType(), String.valueOf(orderId), 2); |
| | | resultUtil = douGongPayUtil.wxPayOrder(orderMoney.toString(), userInfo.getAppletsOpenId(), "小件物流补差价", orderLogistics.getType(), String.valueOf(orderId), 2); |
| | | paymentRecordService.saveData(1, orderLogistics.getUserId(), 1, orderId, orderLogistics.getType(), 1, orderMoney, "", 1);//添加预支付数据 |
| | | } |
| | | if(payType == 2){//支付宝支付 |
| | |
| | | SimpleDateFormat sdf = new SimpleDateFormat("yyyyMMddHHmmssSSS"); |
| | | return "LO" + sdf.format(new Date()) + UUIDUtil.getRandomCode(5); |
| | | } |
| | | @Autowired |
| | | private DouGongPayUtil douGongPayUtil; |
| | | |
| | | @Override |
| | | @Transactional(propagation = Propagation.REQUIRES_NEW) |
| | |
| | | if(payType == 1){//微信支付 |
| | | String app = type == 1 ? "APP" : "JSAPI"; |
| | | // resultUtil = payMoneyUtil.weixinpay("感谢费", "", orderId + "_" + orderLogistics.getType() + "_" + UUIDUtil.getRandomCode(5), money.toString(), "/base/wxPayThankYouFee", app, userInfo.getAppletsOpenId()); |
| | | resultUtil = DouGongPayUtil.wxPayOrder(money.toString(), userInfo.getAppletsOpenId(), "感谢费", orderLogistics.getType(), String.valueOf(orderId), 4); |
| | | resultUtil = douGongPayUtil.wxPayOrder(money.toString(), userInfo.getAppletsOpenId(), "感谢费", orderLogistics.getType(), String.valueOf(orderId), 4); |
| | | paymentRecordService.saveData(3, uid, 1, orderId, orderLogistics.getType(), 1, money, "", 1);//添加预支付数据 |
| | | } |
| | | if(payType == 2){//支付宝支付 |
| | | // resultUtil = payMoneyUtil.alipay("感谢费", "感谢费", "", orderId + "_" + orderLogistics.getType() + "_" + UUIDUtil.getRandomCode(5), money.toString(), "/base/aliPayThankYouFee"); |
| | | resultUtil = DouGongPayUtil.wxPayOrder(money.toString(), userInfo.getAppletsOpenId(), "感谢费", orderLogistics.getType(), String.valueOf(orderId), 4); |
| | | resultUtil = DouGongPayUtil.aliPayOrder(money.toString(), userInfo.getAppletsOpenId(), "感谢费", orderLogistics.getType(), String.valueOf(orderId), 4); |
| | | paymentRecordService.saveData(1, uid, 1, orderId, orderLogistics.getType(), 2, money, "", 1);//添加预支付数据 |
| | | } |
| | | if(payType == 3){//余额支付 |
| | |
| | | map.put("id", integer); |
| | | return ResultUtil.success(map); |
| | | } |
| | | |
| | | @Autowired |
| | | private DouGongPayUtil douGongPayUtil; |
| | | |
| | | /** |
| | | * 取消订单操作 |
| | |
| | | orderCancelService.updateById(orderCancel); |
| | | String app = type == 1 ? "APP" : "JSAPI"; |
| | | // resultUtil = payMoneyUtil.weixinpay("订单取消", "", id + "_1_" + UUIDUtil.getRandomCode(5), query.getMoney().toString(), "/base/wxCancelOrderTaxi", app, userInfo.getAppletsOpenId()); |
| | | resultUtil = DouGongPayUtil.wxPayOrder(query.getMoney().toString(), userInfo.getAppletsOpenId(), "订单取消", 1, String.valueOf(id), 5); |
| | | resultUtil = douGongPayUtil.wxPayOrder(query.getMoney().toString(), userInfo.getAppletsOpenId(), "订单取消", 1, String.valueOf(id), 5); |
| | | paymentRecordService.saveData(1, orderPrivateCar.getUserId(), 1, id, 1, 1, query.getMoney(), "", 1);//添加预支付数据 |
| | | } |
| | | if(payType == 2){//支付宝支付 |
| | |
| | | if(payType == 1){//微信支付 |
| | | String app = type == 1 ? "APP" : "JSAPI"; |
| | | // resultUtil = payMoneyUtil.weixinpay("完成订单", "", orderId + "_1_" + UUIDUtil.getRandomCode(5), orderMoney.toString(), "/base/wxPayOrderTaxi", app, userInfo.getAppletsOpenId()); |
| | | resultUtil = DouGongPayUtil.wxPayOrder(orderMoney.toString(), userInfo.getAppletsOpenId(), "完成订单", 1, String.valueOf(orderId), 1); |
| | | resultUtil = douGongPayUtil.wxPayOrder(orderMoney.toString(), userInfo.getAppletsOpenId(), "完成订单", 1, String.valueOf(orderId), 1); |
| | | |
| | | paymentRecordService.saveData(1, orderPrivateCar.getUserId(), 1, orderId, 1, 1, orderMoney, "", 1);//添加预支付数据 |
| | | } |
| | |
| | | String app = type == 1 ? "APP" : "JSAPI"; |
| | | // resultUtil = payMoneyUtil.weixinpay("完成订单", "", orderId + "_1_" + UUIDUtil.getRandomCode(5), orderMoney.toString(), "/base/wxPayOrderTaxi", app, userInfo.getAppletsOpenId()); |
| | | // DG支付 |
| | | resultUtil = DouGongPayUtil.wxPayOrder(orderMoney.toString(), userInfo.getAppletsOpenId(), "完成订单", 1, String.valueOf(orderId), 1); |
| | | resultUtil = douGongPayUtil.wxPayOrder(orderMoney.toString(), userInfo.getAppletsOpenId(), "完成订单", 1, String.valueOf(orderId), 1); |
| | | paymentRecordService.saveData(1, orderPrivateCar.getUserId(), 1, orderId, 1, 1, orderMoney, "", 1);//添加预支付数据 |
| | | } |
| | | if(payType == 2) {//支付宝支付 |
| | |
| | | if(payType == 1){//微信支付 |
| | | String app = type == 1 ? "APP" : "JSAPI"; |
| | | // resultUtil = payMoneyUtil.weixinpay("感谢费", "", orderId + "_1_" + UUIDUtil.getRandomCode(5), money.toString(), "/base/wxPayThankYouFee", app, userInfo.getAppletsOpenId()); |
| | | resultUtil = DouGongPayUtil.wxPayOrder(money.toString(), userInfo.getAppletsOpenId(), "感谢费", 1, String.valueOf(orderId), 4); |
| | | resultUtil = douGongPayUtil.wxPayOrder(money.toString(), userInfo.getAppletsOpenId(), "感谢费", 1, String.valueOf(orderId), 4); |
| | | paymentRecordService.saveData(3, uid, 1, orderId, 1, 1, money, "", 1);//添加预支付数据 |
| | | } |
| | | if(payType == 2){//支付宝支付 |
| | |
| | | return taxiCardWapper; |
| | | } |
| | | |
| | | @Autowired |
| | | private DouGongPayUtil douGongPayUtil; |
| | | @Override |
| | | public ResultUtil payTaxiCard(Integer uid, Integer id, Integer payType, Integer type) throws Exception { |
| | | UserInfo userInfo = userInfoService.selectById(uid); |
| | |
| | | if(payType == 1){//微信支付 |
| | | String app = type == 1 ? "APP" : "JSAPI"; |
| | | // resultUtil = payMoneyUtil.weixinpay("购买出行卡", "", ToolUtil.getRandomString(10), taxiCard.getSellingPrice().toString(), "/base/wxPayTaxiCardPaymentSpread", app, userInfo.getAppletsOpenId()); |
| | | resultUtil = DouGongPayUtil.wxPayOrder(taxiCard.getSellingPrice().toString(), userInfo.getAppletsOpenId(), "购买出行卡", 1, String.valueOf(id), 3); |
| | | resultUtil = douGongPayUtil.wxPayOrder(taxiCard.getSellingPrice().toString(), userInfo.getAppletsOpenId(), "购买出行卡", 1, String.valueOf(id), 3); |
| | | paymentRecordService.saveData(4, taxiCardPayment.getUserId(), 1, taxiCardPayment.getId(), null, 1, taxiCard.getSellingPrice(), "", 1);//添加预支付数据 |
| | | } |
| | | if(payType == 2){//支付宝支付 |
| | |
| | | userInfoMapper.setUrgentUser(name, phone, uid); |
| | | } |
| | | |
| | | |
| | | @Autowired |
| | | private DouGongPayUtil douGongPayUtil; |
| | | /** |
| | | * 充值余额 |
| | | * @param payType |
| | |
| | | String app = type == 1 ? "APP" : "JSAPI"; |
| | | // return payMoneyUtil.weixinpay("余额充值", uid.toString(), integer.toString(), money.toString(), "/base/wxCancelUserBalance", app, userInfo.getAppletsOpenId()); |
| | | |
| | | return DouGongPayUtil.wxPayOrder(money.toString(), appletsOpenId, "余额充值", uid, String.valueOf(integer), 6); |
| | | return douGongPayUtil.wxPayOrder(money.toString(), appletsOpenId, "余额充值", uid, String.valueOf(integer), 6); |
| | | |
| | | // Map<String, String> map = icbcPayUtil.placeAnOrder(integer.toString(), 9, 5, uid.toString(), "余额充值", money, callbackPath + "/base/wxCancelUserBalance", uid.toString(), type, appletsOpenId); |
| | | // if(map.get("code").equals("200")){ |
| | |
| | | orderCancelService.updateById(orderCancel); |
| | | String app = type == 1 ? "APP" : "JSAPI"; |
| | | // resultUtil = payMoneyUtil.weixinpay("订单取消", "", id + "_2_" + UUIDUtil.getRandomCode(5), query.getMoney().toString(), "/base/wxCancelOrderTaxi", app, userInfo.getAppletsOpenId()); |
| | | resultUtil = DouGongPayUtil.wxPayOrder(query.getMoney().toString(), userInfo.getAppletsOpenId(), "订单取消", 2, String.valueOf(id), 5); |
| | | resultUtil = douGongPayUtil.wxPayOrder(query.getMoney().toString(), userInfo.getAppletsOpenId(), "订单取消", 2, String.valueOf(id), 5); |
| | | paymentRecordService.saveData(1, orderTaxi.getUserId(), 1, id, 2, 1, query.getMoney(), "", 1);//添加预支付数据 |
| | | |
| | | // Map<String, String> map = icbcPayUtil.placeAnOrder(id + ",2", 9, 5, uid.toString(), "订单取消", query.getMoney(), callbackPath + "/base/wxCancelOrderTaxi", "", type, appletsOpenId); |
| | |
| | | orderCancel.setPayType(2); |
| | | orderCancelService.updateById(orderCancel); |
| | | // resultUtil = payMoneyUtil.alipay("订单取消", "订单取消", "", id + "_2_" + UUIDUtil.getRandomCode(5), query.getMoney().toString(), "/base/aliCancelOrderTaxi"); |
| | | resultUtil = DouGongPayUtil.wxPayOrder(query.getMoney().toString(), userInfo.getAppletsOpenId(), "订单取消", 2, String.valueOf(id), 5); |
| | | resultUtil = DouGongPayUtil.aliPayOrder(query.getMoney().toString(), userInfo.getAppletsOpenId(), "订单取消", 2, String.valueOf(id), 5); |
| | | paymentRecordService.saveData(1, orderTaxi.getUserId(), 1, id, 2, 2, query.getMoney(), "", 1);//添加预支付数据 |
| | | |
| | | // Map<String, String> map = icbcPayUtil.placeAnOrder(id + ",2", 10, 5, uid.toString(), "订单取消", query.getMoney(), callbackPath + "/base/aliCancelOrderTaxi", "", type, null); |
| | |
| | | if(payType == 1){//微信支付 |
| | | String app = type == 1 ? "APP" : "JSAPI"; |
| | | // resultUtil = payMoneyUtil.weixinpay("完成订单", "", orderId + "_2_" + UUIDUtil.getRandomCode(5), orderMoney.toString(), "/base/wxPayOrderTaxi", app, userInfo.getAppletsOpenId()); |
| | | resultUtil = DouGongPayUtil.wxPayOrder(orderMoney.toString(), userInfo.getAppletsOpenId(), "完成订单", 2, String.valueOf(orderId), 1); |
| | | resultUtil = douGongPayUtil.wxPayOrder(orderMoney.toString(), userInfo.getAppletsOpenId(), "完成订单", 2, String.valueOf(orderId), 1); |
| | | |
| | | paymentRecordService.saveData(1, orderTaxi.getUserId(), 1, orderId, 2, 1, orderMoney, "", 1);//添加预支付数据 |
| | | } |
| | | if(payType == 2){//支付宝支付 |
| | | // resultUtil = payMoneyUtil.alipay("完成订单", "完成订单", "", orderId + "_2_" + UUIDUtil.getRandomCode(5), orderMoney.toString(), "/base/aliPayOrderTaxi"); |
| | | resultUtil = DouGongPayUtil.wxPayOrder(orderMoney.toString(), userInfo.getAppletsOpenId(), "完成订单", 2, String.valueOf(orderId), 1); |
| | | resultUtil = DouGongPayUtil.aliPayOrder(orderMoney.toString(), userInfo.getAppletsOpenId(), "完成订单", 2, String.valueOf(orderId), 1); |
| | | |
| | | paymentRecordService.saveData(1, orderTaxi.getUserId(), 1, orderId, 2, 2, orderMoney, "", 1);//添加预支付数据 |
| | | } |
| | |
| | | } |
| | | String app = type == 1 ? "APP" : "JSAPI"; |
| | | // resultUtil = payMoneyUtil.weixinpay("完成订单", "", orderId + "_2_" + UUIDUtil.getRandomCode(5), orderMoney.toString(), "/base/wxPayOrderTaxi", app, userInfo.getAppletsOpenId()); |
| | | resultUtil = DouGongPayUtil.wxPayOrder(orderMoney.toString(), userInfo.getAppletsOpenId(), "完成订单", 2, String.valueOf(orderId), 1); |
| | | resultUtil = douGongPayUtil.wxPayOrder(orderMoney.toString(), userInfo.getAppletsOpenId(), "完成订单", 2, String.valueOf(orderId), 1); |
| | | |
| | | paymentRecordService.saveData(1, orderTaxi.getUserId(), 1, orderId, 2, 1, orderMoney, "", 1);//添加预支付数据 |
| | | } |
| | |
| | | return "TA" + sdf.format(new Date()) + UUIDUtil.getRandomCode(5); |
| | | } |
| | | |
| | | @Autowired |
| | | private DouGongPayUtil douGongPayUtil; |
| | | |
| | | @Override |
| | | @Transactional(propagation = Propagation.REQUIRES_NEW) |
| | | public ResultUtil payThankYouFee(Integer uid, Integer orderId, Double money, Integer payType, Integer type) throws Exception { |
| | |
| | | if(payType == 1){//微信支付 |
| | | String app = type == 1 ? "APP" : "JSAPI"; |
| | | // resultUtil = payMoneyUtil.weixinpay("感谢费", "", orderId + "_2_" + UUIDUtil.getRandomCode(5), money.toString(), "/base/wxPayThankYouFee", app, userInfo.getAppletsOpenId()); |
| | | resultUtil = DouGongPayUtil.wxPayOrder(money.toString(), userInfo.getAppletsOpenId(), "感谢费", 2, String.valueOf(orderId), 4); |
| | | resultUtil = douGongPayUtil.wxPayOrder(money.toString(), userInfo.getAppletsOpenId(), "感谢费", 2, String.valueOf(orderId), 4); |
| | | paymentRecordService.saveData(3, uid, 1, orderId, 2, 1, money, "", 1);//添加预支付数据 |
| | | } |
| | | if(payType == 2){//支付宝支付 |