general_create_trans_flowchart
2016-03-09 13:06:13 0 举报
`general_create_trans_flowchart` 是一个用于创建通用事务流程图的函数。该函数接收一系列事务步骤作为输入,并生成一个可视化的流程图,以帮助用户理解和分析事务的处理过程。通过使用此函数,用户可以清晰地看到事务的各个阶段、决策点和数据流向,从而更好地管理和优化业务流程。此外,该函数还支持自定义样式和布局,以满足不同用户的需求。总之,`general_create_trans_flowchart` 是一个实用且易于使用的函数,适用于各种规模的企业和项目。
作者其他创作
大纲/内容
计算并行支付类型,放入info.parallel_type1)如传入有付款方案,10102)如传入有分润或分账方案,01013)啥都没有,0000
info.channel_id = trans_settlement_info::CHANNEL_ID_DEFAULT(1)
N
从in_pack读入其它MISC信息,放入infoext_time、deadline_time放入info.extrasource_ip、user_mac、comments
if (cm == create_trans_by_allocated_trans_id)如果利用预生成交易单创建交易单
Y
从in_pack读取交易属性,放入infotrans_id_exttrans_typetrans_tagcan_modifytrans_mode从模板获取payment_mode,放入info
委托分账必须实时分润is_entrust_billing_solution && info.share_profit_type != SHARE_PROFIT_TYPE_REALTIME
in_pack中是否传入trans_id
从in_pack读取买家属性,放入info.buyeruser_idlogin_nametrue_namecurrency赋默认值info.buyer.sub_account_type = SUB_ACCOUNT_TYPE_DEFAULT
卖家买家user_id不同
即在redis里又在库里,且判断trans_id是否一致if (is_used && in_redis && trans_id_in_redis != info.trans_id)
if (has_share_profit_solution && is_entrust_billing_solution)|| has_share_profit_solution && info.share_billing_type != trans_info::SHARE_TRANS_TYPE_NORMAL如果传入有分润方案,则不能为委托分账或分普通类型分账
fee_account != info.seller收益账户不与卖家相同
从in_pack读入商品信息,放入infogoods_namegoods_urlgoods_typegoods_channelgoods_channel_sp_id
目前只有中介和直付交易才支持多进并行支付类型if ((info.PARALLEL_TYPE_MULTIPLE_IN_MASK & info.parallel_type)&& (info.PAYMENT_MODE_MEDIATE != payment_mode)&& (info.PAYMENT_MODE_DIRECT != payment_mode))
从In_pack读取分润与分账信息,放入infoshare_profit_typeshare_billing_type设置has_share_profit_type、is_entrust_billing_solution
buyer_fee_account必须存在(查DB)
如果是预下单if (cm == pre_mode_to_create_trans) {
switch (info.can_modify)要么传入,要么默认cannot
buyer_fee_amount != 0
info.share_profit_type = info.SHARE_PROFIT_TYPE_REALTIME如果有分润方案默认使用实时分润
has_share_profit_solution
TRANS_CANNOT_MODIFY
seller是customer或者merchantuser_id分布规则
获取redis重入keyredis_key = cmd_trans_id_ext_logid;
是否传入平台商户if (!has_up_merchant)
校验金额info.validate()total_good_amount = unit_price_amount * unit_count + transport_amount + adjust_price_amount + adjust_transport_amount;total_payment_amount = cash_amount + coupon_amount + pay_solution_amount + mkt_solution_amount + coupon_amount_new;total_good_amount必须等于total_payment_amount
给trans_id赋值如果redis里面有,直接用如果redis里没有库里有。用库里的如果redis和库里都没有,生成info.trans_id = trans_id_in_redis;
if ((has_share_profit_solution || is_entrust_billing_solution)&& (info.SETTLEMENT_TYPE_REALTIME != info.settlement_type))前只有实时结算才支持分润或者分账
check_up_merchant_info
!in_redis如redis中没有
info.seller.sub_account_type = SUB_ACCOUNT_TYPE_DEFAULT(1)卖家使用已结算账户
buyer_fee_account != info.seller收益账户不与卖家相同
赋值给pay_solution_amountinfo.pay_solution_amount = solution_info.pay_trans_solution().get_total_amount();
info.seller.sub_account_type = SUB_ACCOUNT_TYPE_UNSETTLED(3)卖家使用待结算账户
buyer_fee_account != info.buer收益账户不与买家相同
if (0 != info.fee_amount)只有fee_amount不为0时才需要fee_user_id
fee_account收益账户必须是C账户
if (0 info.coupon_strategy_id)
从in_pack读入端信息,放入infoclient_source_flag_create并设置has_client_source_flag_create
检查state是否不为createjudge_repeat_pay(trans)
从in_pack读入价格、优惠信息,放入infounit_price_amountunit_counttransport_amountadjust_price_amountadjust_transport_amountcash_amountcash_amount_newcoupon_amountcoupon_startegycoupon_strategy_id
从in_pack读入info.fee_account.user_idinfo.fee_account.sub_account_type = SUB_ACCOUNT_TYPE_DEFAULT(1)info.fee_account.currency = info.buyer.currency
TRANS_CAN_MODIFY_GATEWAY_INFO
TRANS_CAN_MODIFY_ALL
has_read_channel_id?
DEFAULT
buyer_fee_account收益账户必须是C账户
从In_pack读取付款以及分润方案信息,放入solution_infopay_trans_solutionshare_profit_solution设置has_pay_trans_solution、has_share_profit_solution
依据info.trans_id_ext从redis中查询trans_id,放入trans_id_in_redis,并设置in_redis
if (0 != info.coupon_amount)目前不支持coupon_amount,所以coupon_amount一定要为0
service_exception
手续费不能大于交易总现金金额if (info.fee_amount info.get_total_cash_amount())((cash_amount + pay_solution_amount + mkt_solution_amount - _mkt_total_no_settlement_amount))
从in_pack读入结算信息,放入infochannel_idfee_amountsettlement_typebuyer_fee_amount设置has_read_channel_id
从in_pack读取create_mode,放入cm
本地变量trans_create_info info;trans_create_info merchant_trans;trans_solution_info solution_info;string coupon_error_info;up_merchant_info merchant_info;bool has_up_merchant;
fee_account必须存在(查DB)
in_redis如果缓存里面有
分润总金额不能大于分润前支付给卖家的金额if (solution_info.share_profit_solution().get_total_amount() (info.get_total_cash_amount() - info.fee_amount))
has_pay_trans_solution如果传入有付款方案
如果是新订单且为委托分账if (is_entrust_billing_solution && !is_used)
从in_pack读入上层商户信息,放入infoup_merchant_info设置has_up_merchant
从in_pack读入卖家信息,放入info.sellersp_iduser_idlogin_nametrue_name设置seller.currency=buyer.currency
去DB中查询是info.trans_id_ext去否存在如存在,将trans_id放入info.trans_id设置is_used
如果传入付款方案分润方案,则赋值给本地变量,if (has_pay_trans_solution/has_share_profit_solution) {trans_solution.pay_trans_solution/share_profit_solution = solution_info.pay_trans_solution/share_profit_solution;
buyer是customer或者merchantuser_id分布规则
info.settlement_type!=realtime为异步结算
数据库有的话用数据库的,否则调用billNo新生成一个trans_id_in_redis = is_used ? info.trans_id : trans_id_client_.info_bill_no(
从in_pack读入info.buyer_fee_account.user_idinfo.buyer_fee_account.sub_account_type = SUB_ACCOUNT_TYPE_DEFAULT(1)info.buyer_fee_account.currency = info.buyer.currency
初始化一些值bool is_modified = false;info.state = info.TRANS_STATE_CREATED;info.share_profit_flag = info.SHARE_PROFIT_FLAG_UNDO;
检查平台商户传入是否正确
0 条评论
下一页
为你推荐
查看更多