| | |
| | | |
| | | import com.alibaba.fastjson.JSONObject; |
| | | import com.baomidou.mybatisplus.mapper.EntityWrapper; |
| | | import com.stylefeng.guns.core.util.DateUtil; |
| | | import com.stylefeng.guns.core.util.GetOpenBodySig; |
| | | import com.stylefeng.guns.core.util.NotifyDemo; |
| | | import com.stylefeng.guns.core.util.RequestSeqUtil; |
| | | import com.stylefeng.guns.core.util.ToolUtil; |
| | | import com.stylefeng.guns.modular.CharteredCar.model.OrderCharteredCar; |
| | | import com.stylefeng.guns.modular.CharteredCar.server.IOrderCharteredCarService; |
| | |
| | | import com.stylefeng.guns.modular.crossCity.model.OrderCrossCity; |
| | | import com.stylefeng.guns.modular.crossCity.server.IOrderCrossCityService; |
| | | import com.stylefeng.guns.modular.enums.PaymentTypeEnum; |
| | | import com.stylefeng.guns.modular.huifu.biz.FenZhangUtil; |
| | | import com.stylefeng.guns.modular.smallLogistics.server.IOrderLogisticsService; |
| | | import com.stylefeng.guns.modular.specialTrain.server.IOrderPrivateCarService; |
| | | import com.stylefeng.guns.modular.system.dao.UserInfoMapper; |
| | |
| | | |
| | | AllocationReq allocationReq= new AllocationReq(); |
| | | allocationReq.setOutOrderNo(ToolUtil.getRandomString(32)); |
| | | if(type==1){ |
| | | allocationReq.setPayBalanceAcctId(tEnterpriseWithdrawals.get(0).getBalanceAcctId()); |
| | | allocationReq.setRecvBalanceAcctId(userWithdrawals.get(0).getBalanceAcctId()); |
| | | |
| | | allocationReq.setPassword(Base64Util.decode(tEnterpriseWithdrawals.get(0).getTransactionAuthorizationCode())); |
| | | }else { |
| | | allocationReq.setRecvBalanceAcctId(tEnterpriseWithdrawals.get(0).getBalanceAcctId()); |
| | | allocationReq.setPayBalanceAcctId(userWithdrawals.get(0).getBalanceAcctId()); |
| | | allocationReq.setPassword(Base64Util.decode(userWithdrawals.get(0).getTransactionAuthorizationCode())); |
| | | } |
| | | money=money*100; |
| | | allocationReq.setAmount((int)money); |
| | | allocationReq.setProductName("分账"); |
| | | allocationReq.setProductCount(1); |
| | | allocationReq.setOrderNo(ToolUtil.getRandomString(32)); |
| | | allocationReq.setOrderAmount(1l); |
| | | try { |
| | | AllocationResp allocationResp = AllocationExample.create(allocationReq); |
| | | System.out.println(allocationResp); |
| | | return "ok"; |
| | | } catch (UpyztException e) { |
| | | e.printStackTrace(); |
| | | return e.getMessage(); |
| | | Map<String, Object> result; |
| | | if(type==1){ |
| | | //allocationReq.setPayBalanceAcctId(tEnterpriseWithdrawals.get(0).getBalanceAcctId()); |
| | | //allocationReq.setRecvBalanceAcctId(userWithdrawals.get(0).getBalanceAcctId()); |
| | | // |
| | | //allocationReq.setPassword(Base64Util.decode(tEnterpriseWithdrawals.get(0).getTransactionAuthorizationCode())); |
| | | result = FenZhangUtil.fenzhang(RequestSeqUtil.generate("TK"), DateUtil.formatDate(new Date(), "yyyyMMdd"), String.valueOf(money), userWithdrawals.get(0).getHuifuId()); |
| | | }else { |
| | | //allocationReq.setRecvBalanceAcctId(tEnterpriseWithdrawals.get(0).getBalanceAcctId()); |
| | | //allocationReq.setPayBalanceAcctId(userWithdrawals.get(0).getBalanceAcctId()); |
| | | //allocationReq.setPassword(Base64Util.decode(userWithdrawals.get(0).getTransactionAuthorizationCode())); |
| | | result = FenZhangUtil.payFromUser(RequestSeqUtil.generate("TK"), DateUtil.formatDate(new Date(), "yyyyMMdd"), String.valueOf(money), userWithdrawals.get(0).getHuifuId()); |
| | | } |
| | | if ("00000000".equals(result.get("respCode").toString())) { |
| | | return "ok"; |
| | | } else { |
| | | return result.get("respDesc").toString(); |
| | | } |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | //money=money*100; |
| | | //allocationReq.setAmount((int)money); |
| | | //allocationReq.setProductName("分账"); |
| | | //allocationReq.setProductCount(1); |
| | | //allocationReq.setOrderNo(ToolUtil.getRandomString(32)); |
| | | //allocationReq.setOrderAmount(1l); |
| | | //try { |
| | | // AllocationResp allocationResp = AllocationExample.create(allocationReq); |
| | | // System.out.println(allocationResp); |
| | | // return "ok"; |
| | | //} catch (UpyztException e) { |
| | | // e.printStackTrace(); |
| | | // return e.getMessage(); |
| | | //} |
| | | |
| | | } |
| | | |
| | |
| | | |
| | | AllocationReq allocationReq= new AllocationReq(); |
| | | allocationReq.setOutOrderNo(ToolUtil.getRandomString(32)); |
| | | if(type==1){ |
| | | allocationReq.setPayBalanceAcctId(tEnterpriseWithdrawals.get(0).getBalanceAcctId()); |
| | | allocationReq.setRecvBalanceAcctId(userWithdrawals.get(0).getBalanceAcctId()); |
| | | |
| | | allocationReq.setPassword(Base64Util.decode(tEnterpriseWithdrawals.get(0).getTransactionAuthorizationCode())); |
| | | }else { |
| | | allocationReq.setRecvBalanceAcctId(tEnterpriseWithdrawals.get(0).getBalanceAcctId()); |
| | | allocationReq.setPayBalanceAcctId(userWithdrawals.get(0).getBalanceAcctId()); |
| | | allocationReq.setPassword(Base64Util.decode(userWithdrawals.get(0).getTransactionAuthorizationCode())); |
| | | } |
| | | money=money*100; |
| | | allocationReq.setAmount((int)money); |
| | | allocationReq.setProductName("分账"); |
| | | allocationReq.setProductCount(1); |
| | | allocationReq.setOrderNo(ToolUtil.getRandomString(32)); |
| | | allocationReq.setOrderAmount(1l); |
| | | Map<String, Object> result; |
| | | try { |
| | | AllocationResp allocationResp = AllocationExample.create(allocationReq); |
| | | System.out.println(allocationResp); |
| | | return "ok"; |
| | | } catch (UpyztException e) { |
| | | e.printStackTrace(); |
| | | return e.getMessage(); |
| | | if(type==1){ |
| | | //allocationReq.setPayBalanceAcctId(tEnterpriseWithdrawals.get(0).getBalanceAcctId()); |
| | | //allocationReq.setRecvBalanceAcctId(userWithdrawals.get(0).getBalanceAcctId()); |
| | | // |
| | | //allocationReq.setPassword(Base64Util.decode(tEnterpriseWithdrawals.get(0).getTransactionAuthorizationCode())); |
| | | result = FenZhangUtil.fenzhang(RequestSeqUtil.generate("TK"), DateUtil.formatDate(new Date(), "yyyyMMdd"), String.valueOf(money), userWithdrawals.get(0).getHuifuId()); |
| | | }else { |
| | | //allocationReq.setRecvBalanceAcctId(tEnterpriseWithdrawals.get(0).getBalanceAcctId()); |
| | | //allocationReq.setPayBalanceAcctId(userWithdrawals.get(0).getBalanceAcctId()); |
| | | //allocationReq.setPassword(Base64Util.decode(userWithdrawals.get(0).getTransactionAuthorizationCode())); |
| | | result = FenZhangUtil.payFromUser(RequestSeqUtil.generate("TK"), DateUtil.formatDate(new Date(), "yyyyMMdd"), String.valueOf(money), userWithdrawals.get(0).getHuifuId()); |
| | | } |
| | | if ("00000000".equals(result.get("respCode").toString())) { |
| | | return "ok"; |
| | | } else { |
| | | return result.get("respDesc").toString(); |
| | | } |
| | | } catch (Exception e) { |
| | | throw new RuntimeException(e); |
| | | } |
| | | //money=money*100; |
| | | //allocationReq.setAmount((int)money); |
| | | //allocationReq.setProductName("分账"); |
| | | //allocationReq.setProductCount(1); |
| | | //allocationReq.setOrderNo(ToolUtil.getRandomString(32)); |
| | | //allocationReq.setOrderAmount(1l); |
| | | //try { |
| | | // AllocationResp allocationResp = AllocationExample.create(allocationReq); |
| | | // System.out.println(allocationResp); |
| | | // return "ok"; |
| | | //} catch (UpyztException e) { |
| | | // e.printStackTrace(); |
| | | // return e.getMessage(); |
| | | //} |
| | | |
| | | } |
| | | } |